From solr-user-return-143412-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Sat Sep 1 08:37:19 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 4E7E1180630 for ; Sat, 1 Sep 2018 08:37:19 +0200 (CEST) Received: (qmail 79286 invoked by uid 500); 1 Sep 2018 06:37:17 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 79213 invoked by uid 99); 1 Sep 2018 06:37:16 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Sep 2018 06:37:16 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 078EB18043E for ; Sat, 1 Sep 2018 06:37:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.131 X-Spam-Level: X-Spam-Status: No, score=-0.131 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id iddfQEysU_xB for ; Sat, 1 Sep 2018 06:37:15 +0000 (UTC) Received: from mail-oi0-f54.google.com (mail-oi0-f54.google.com [209.85.218.54]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id DD0015F27D for ; Sat, 1 Sep 2018 06:37:14 +0000 (UTC) Received: by mail-oi0-f54.google.com with SMTP id 8-v6so25533692oip.0 for ; Fri, 31 Aug 2018 23:37:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=JakRUn//4NAXh6/yGtj6dcVnVs147p9Q2fKwPMRsB4U=; b=GiKL8TP4HvQEGf51as5CguzGq83s656cZiCaHNnunJHFv8D5SehaRftaUKltAWHP4H Ah8symg+GgljqDcXN+GZookm3P5BjGj9qb7JecHLYSrghKD+JivY5Fxi0Mdgt5jz8Za/ pYF1GruMC4sMk3dIWlLvoJTcBM5Ha2wK1Ls+Dzm97ZCpHVipqrUraFDcvrKnQxKXuiSc B9asbJCk6r+LfrLpAdi7mTMe020EN9CgbNRN6osQsFBsakSt7I4VVpe2xpjgxrSSYrfu ObP0C393XTLaDzCG9Bt5611fg0VUhCNiWgAZtXgfHrwEzh75VpiaOOCDYVV+6QLaNl66 iHwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=JakRUn//4NAXh6/yGtj6dcVnVs147p9Q2fKwPMRsB4U=; b=q9S6W8YGFJsVvPNmZGNQjuSkbb1O854lgAFSV32cljeUGAw27AvFedWGX+XSEdWwyX h6cH7YGwdyZk0myBM4zxB3FLyV4eIwe97RUZI+BL+6oOOGyJuQJk00TRqz02OlfHg0ij 3gM5PEDOq+vW+57swgYqRJ2BcvXFz7Ua5tQp3I9AtqCLzb6TBYBufVWUuNB2A5B+m0rI 0pwGS/2Yx53f0ccXSY9A/DVngsrewqZ5xwAa4yJqKWX9Sh78tvUy5cJS7fPKgjdEaMZY 1G4bF0IVX+rhteP7gwQOhoWA4l+x6LiAtIuhK79AMhMmihxgtF+vpdZnoMwypbDqsFk7 zCIQ== X-Gm-Message-State: APzg51Cnpn5wZcpm7LTIxJIhdI8hpak0b4y+mUNY1+Xd7PWOLxGd/BPT N5mksKcDeZibjqB18J2zZPrL+XnmqSGsvHhr19zh5a5N X-Google-Smtp-Source: ANB0Vdb9G4O37rSmhNq/Q4ryITC6PZcmeJrOh3PODEnke6K2riZ3KLxkHTSXNRTZIaA3aqSDicWGibclUJ+xRbR6PFI= X-Received: by 2002:aca:36d7:: with SMTP id d206-v6mr9714367oia.63.1535783828133; Fri, 31 Aug 2018 23:37:08 -0700 (PDT) MIME-Version: 1.0 From: Salvo Bonanno Date: Sat, 1 Sep 2018 08:36:56 +0200 Message-ID: Subject: Sorting by custom order To: solr-user@lucene.apache.org Content-Type: text/plain; charset="UTF-8" Hello I need to sort a results set in a particolar way... the documents looks like this: { "customer_id":28998, "name_txt":["Equal Corp"], "address_txt":["Austin Ring Center"], "municipality_txt":["Austin"], "province_txt":["Austin"], "region_txt":["TX"], "profile_txt":["Base"], "visibility_weight_txt":["2"] }, { "customer_id":28997, "name_txt":["Mustard Ltd"], "address_txt":["Telegraph Road"], "municipality_txt":["London"], "province_txt":["London"], "region_txt":["UK"], "profile_txt":["Gold"], "visibility_weight_txt":["2"] } I need to sort them by profile_txt value (it's a multiValue field but actually it contains just a single value), but since the possible values are just 5, I'd like to tokenize them for deciding in wich order the should came. the order should follows a simple schema: 1. profile_txt = "Gold" 2. profile_txt = "Super" 3. profile_txt = "Smart" 4. profile_txt = "Base" 5. profile_txt = "Essential" Then an additional sort by visibility_weight_txt should be done Is it possible to do this someway using FunctionQueries? Unfortunally I can't modify the schema. Thanks for reading