I need to list the ranking (or position, as you might prefer) or each document after a query in solr. the thing i wanna see is something like this:
<doc>
<int name="field1">1</int>
<str name="someotherfield">blabla</str>
<int name="position">1</int>
</doc>
<doc>
<int name="field1">2</int>
<str name="someotherfield">blabla</str>
<int name="position">2</int>
</doc>
<doc>
<int name="field1">3</int>
<str name="someotherfield">blabla</str>
<int name="position">3</int>
</doc>
is this possible? or i need to implement or find a plugin?
well after digging the source code, I am now able to see dynamic positions for each different search.. I have simply added a position function to
DocIteratorand implemented in in subclasses. Then I have added a control block inReturnFieldsfor checking if fl has position in it. It is working in a similar way withscore. and the last thing to do was adding a custom augmenter class likePositionAugmenter– similar toScoreAugmenter. Then I am done 🙂thank you for David Faber for giving me idea of dealing with the results of raw XML