Return-Path: X-Original-To: apmail-lucene-solr-user-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 008F41747E for ; Sat, 23 May 2015 03:38:42 +0000 (UTC) Received: (qmail 25467 invoked by uid 500); 23 May 2015 03:38:39 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 25406 invoked by uid 500); 23 May 2015 03:38:38 -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 Delivered-To: moderator for solr-user@lucene.apache.org Received: (qmail 78838 invoked by uid 99); 23 May 2015 00:35:09 -0000 X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.879 X-Spam-Level: ** X-Spam-Status: No, score=2.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=qoTLi4OE23dtD3w0zpSkHoEwpRRsIppr/1CXAv1OUm8=; b=c2w8ON8yRxHxLIOi7wgabhiIAI5Rt63qEfjMXSTrNGJq+45h/q4ujtWmNYxeEAVfSn rJuVVijljnhnehJOxYxLf7ikWk479dccuTJhG1c8zirT4LfpIBskYMN8HxKfoKpEd1Xw czy9QicMeqmt1GC+pDx71/bYrNeGz1cVK6V9Zj7ILWt/8AsVHV1QvdZkUrYq3USx36Ft nm2Z92UMfJwIwtIbj3vTTklCb93SwNJyue1iYlzdzDSzdH12D38Wxi9SRSgkKzmeTKzi MQIgMH60IPobfMhS3KT/5fAG5YYK/s6m23yhW7pCx73R1V1uCDGJirIYjPAMVv+oO1EU 3jVw== MIME-Version: 1.0 X-Received: by 10.170.81.87 with SMTP id x84mr12094349ykx.113.1432341261444; Fri, 22 May 2015 17:34:21 -0700 (PDT) Date: Fri, 22 May 2015 20:34:21 -0400 Message-ID: Subject: Multivalued OR query with equal score/rankings when any one value matches From: Troy Collinsworth To: solr-user@lucene.apache.org Content-Type: multipart/alternative; boundary=001a113a908e15eeba0516b4f06b --001a113a908e15eeba0516b4f06b Content-Type: text/plain; charset=UTF-8 While trying to query a multivalued String field for multiple values, when any one value matches the score is higher for the lower value and lower for the higher. I swapped the value order and it had no affect so it isn't positional. I want the score to be the same irrespective of the value matched. I also still want the score highest when both values match. The solution has to work for 'n' values, not just two as in this example. solr-5.1.0 Indexed data and example scores: "userIds": ["931","890"] "score": 9.600372 "userIds": ["890"] "score": 2.5523214 "userIds": ["931"] "score": 2.247865 The results for 890 and 931 need to have the same score as they each matched one query value so they will be returned mixed together. I realize they wont be randomly sorted, however if they at least have the same score I can recognize and randomize them before use. Queries: "q": "userIds:931 OR userIds:890", "fl": "*,score" The edismax and bq query has the same symptoms. "defType": "edismax", "fl": "*,score", "bq": "userIds:931 OR userIds:890" Adding boost values to the query will change the order, but still doesn't give the desired behavior of results with only one value having equal score and being mixed together in the results. "defType": "edismax", "fl": "*,score", "bq": "userIds:931^2 OR userIds:890^1" Also tried quoting the values with no effect. -Troy --001a113a908e15eeba0516b4f06b--