I believe that keeping you code as is but initializing the query parameters
should do the trick:
....
HashMap params = new HashMap();
params.add("fl", "id score"); // field list is id & score
...
Regards


John Reuning-2 wrote:
> 
> My first pass was to implement the embedded solr example:
> 
> ----------
> MultiCore mc = MultiCore.getRegistry();
> SolrCore core = mc.getCore(mIndexName);
> 
> SolrRequestHandler handler = core.getRequestHandler("");
> HashMap params = new HashMap();
> 
> SolrQueryRequest request = new LocalSolrQueryRequest(core, query, 
> "standard", 0, 100, params);
> SolrQueryResponse response = new SolrQueryResponse();
> core.execute(handler, request, response);
> 
> DocList docs = (DocList) response.getValues().get("response");
> ----------
> 
> Is the only way to access scores to call directly to SolrIndexSearcher? 
>   I was wondering if there's a solr config option I'm missing somewhere 
> that tells the SolrIndexSearcher to retain lucene scores.  I'll keep 
> digging.  Maybe there's a way to set a LocalSolrQueryRequest param that 
> passes the right info through to SolrIndexSearcher?
> 
> Thanks,
> 
> -jrr
> 
> Chris Hostetter wrote:
>> : The scores list in DocIterator is null after a successful query.
>> There's a
>> : flag in SolrIndexSearcher, GET_SCORES, that looks like it should
>> trigger
>> : setting the scores array for the resulting DocList, but I can't figure
>> out how
>> : to set it.  Any suggestions?  I'm using the svn trunk code.
>> 
>> Can you elaborate (ie: paste some code examples) on how you are aquiring 
>> your DocList ... what method are you calling on SolrIndexSearcher? what 
>> arguments are you passing it?
>> 
>> NOTE: the SolrIndexSearcher.getDocList* methods may choose to build 
>> the DocList from a DocSet unless:
>>     a) you use a sort that inlcudes score
>> or  b) you use a method sig that takes a flags arg and explicitly set 
>>        the GET_SCORES mask on your flags arg.
>> 
>> 
>> 
>> 
>> -Hoss
>> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/GET_SCORES-flag-in-SolrIndexSearcher-tf4641637.html#a13297657
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to