mirror of
https://github.com/apache/lucene.git
synced 2025-02-24 03:05:06 +00:00
SOLR-6795: distrib.singlePass returns score even though not asked for
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1642774 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
224f6f59c1
commit
25bbac4a0d
@ -503,6 +503,9 @@ Bug Fixes
|
||||
* SOLR-6726: better strategy for selecting the JMX RMI port based on SOLR_PORT in bin/solr
|
||||
script (Timothy Potter)
|
||||
|
||||
* SOLR-6795: distrib.singlePass returns score even though not asked for.
|
||||
(Per Steffensen via shalin)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
|
||||
|
@ -1257,6 +1257,10 @@ public class QueryComponent extends SearchComponent
|
||||
if (sdoc != null) {
|
||||
if (returnScores) {
|
||||
doc.setField("score", sdoc.score);
|
||||
} else {
|
||||
// Score might have been added (in createMainQuery) to shard-requests (and therefore in shard-response-docs)
|
||||
// Remove score if the outer request did not ask for it returned
|
||||
doc.remove("score");
|
||||
}
|
||||
if (removeKeyField) {
|
||||
doc.removeFields(keyFieldName);
|
||||
|
@ -20,7 +20,9 @@ package org.apache.solr.handler.component;
|
||||
import org.apache.solr.BaseDistributedSearchTestCase;
|
||||
import org.apache.solr.client.solrj.SolrServerException;
|
||||
import org.apache.solr.client.solrj.response.QueryResponse;
|
||||
import org.apache.solr.cloud.AbstractFullDistribZkTestBase;
|
||||
import org.apache.solr.common.params.ModifiableSolrParams;
|
||||
import org.apache.solr.common.params.ShardParams;
|
||||
import org.apache.solr.common.util.SimpleOrderedMap;
|
||||
import org.junit.BeforeClass;
|
||||
|
||||
@ -115,6 +117,13 @@ public class DistributedQueryComponentOptimizationTest extends BaseDistributedSe
|
||||
|
||||
verifySinglePass("q", "id:19", "fl", "id,*a_sS", "sort", "payload asc", "distrib.singlePass", "true");
|
||||
verifySinglePass("q", "id:19", "fl", "id,dynamic,cat*", "sort", "payload asc", "distrib.singlePass", "true");
|
||||
|
||||
handle.clear();
|
||||
handle.put("timestamp", SKIPVAL);
|
||||
handle.put("_version_", SKIPVAL);
|
||||
// we don't to compare maxScore because most distributed requests return it anyway (just because they have score already)
|
||||
handle.put("maxScore", SKIPVAL);
|
||||
query("q", "{!func}id", ShardParams.DISTRIB_SINGLE_PASS, "true");
|
||||
}
|
||||
|
||||
private void verifySinglePass(String... q) throws SolrServerException {
|
||||
|
Loading…
x
Reference in New Issue
Block a user