So, I found the following in QueryParsing::parseSort

      if( "score".equals(part) ) {
        if (top) {
// If thre is only one thing in the list, just do the regular thing...
          if( parts.length == 1 ) {
            return null; // do normal scoring...
          }
          lst[i] = SortField.FIELD_SCORE;
        }
        else {
          lst[i] = new SortField(null, SortField.SCORE, true);
        }

Besides the typo :), the only problem for what I want is the fact that it returns null for a default score sort instead of setting SortField.FIELD_SCORE. I want a default score desc sort, but I want the scores from the lucene Hits object. Is the only way to get score values to modify the solr code?

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


Reply via email to