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