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:
Yonik Seeley 2008-07-15 02:24:54 +00:00
parent 46c5c167e7
commit 466513c4c5
2 changed files with 2 additions and 2 deletions

View File

@ -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());

View File

@ -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.