def remove(item)
      prev_item = Soulmate.redis.hget(database, item["id"])
      if prev_item
        prev_item = MultiJson.decode(prev_item)
        # undo the operations done in add
        Soulmate.redis.pipelined do
          Soulmate.redis.hdel(database, prev_item["id"])
          phrase = ([prev_item["term"]] + (prev_item["aliases"] || [])).join(' ')
          prefixes_for_phrase(phrase).each do |p|
            Soulmate.redis.srem(base, p)
            Soulmate.redis.zrem("#{base}:#{p}", prev_item["id"])
          end
        end
      end
    end
def remove(item)
      prev_item = Soulmate.redis.hget(database, item["id"])
      if prev_item
        prev_item = MultiJson.decode(prev_item)
        # undo the operations done in add
        Soulmate.redis.pipelined do
          Soulmate.redis.hdel(database, prev_item["id"])
          phrase = ([prev_item["term"]] + (prev_item["aliases"] || [])).join(' ')
          prefixes_for_phrase(phrase).each do |p|
            Soulmate.redis.srem(base, p)
            Soulmate.redis.zrem("#{base}:#{p}", prev_item["id"])
          end
        end
      end
    end
remove only cares about an item's id, but for consistency takes an object