mirror of https://github.com/apache/lucene.git
SOLR-626: DistributedSearch - fix so scores are returned if requested in field list
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@676789 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
46c5c167e7
commit
466513c4c5
|
@ -318,7 +318,7 @@ public class QueryComponent extends SearchComponent
|
|||
// and any fields needed for merging.
|
||||
sreq.params.set(ResponseBuilder.FIELD_SORT_VALUES,"true");
|
||||
|
||||
if (rb.getSortSpec().includesScore()) {
|
||||
if ( (rb.getFieldFlags() & SolrIndexSearcher.GET_SCORES)!=0 || rb.getSortSpec().includesScore()) {
|
||||
sreq.params.set(CommonParams.FL, rb.req.getSchema().getUniqueKeyField().getName() + ",score");
|
||||
} else {
|
||||
sreq.params.set(CommonParams.FL, rb.req.getSchema().getUniqueKeyField().getName());
|
||||
|
|
|
@ -453,7 +453,7 @@ public class TestDistributedSearch extends TestCase {
|
|||
|
||||
// these queries should be exactly ordered and scores should exactly match
|
||||
query("q","*:*", "sort",i1+" desc");
|
||||
//query("q","*:*", "sort",i1+" desc", "fl","*,score");
|
||||
query("q","*:*", "sort",i1+" desc", "fl","*,score");
|
||||
handle.put("maxScore", SKIPVAL);
|
||||
query("q","{!func}"+i1);// does not expect maxScore. So if it comes ,ignore it. NamedListCodec.writeSolrDocumentList()
|
||||
//is agnostic of request params.
|
||||
|
|
Loading…
Reference in New Issue