Results 1 to 1 of 1
- 01-22-2014, 01:06 PM #1Member
- Join Date
- Jan 2014
- Rep Power
Change the way lucene orders documents after scoring
Lucene scores each document and then sorts them according to relevance in descending order.
i.e. the highest scoring documents are shown first.
Also, if two documents happen to have the same score, lucene then sorts the two docs according to the docId generated while indexing the doc.
Therefore, for docs with same scores, the sort order becomes the order in which they were added in lucene.
I would like to change this implementation.
I want lucene to score docs as it currently does..but when 2 docs have the same score, i want them to be sorted according to a custom logic.
How do I do this?
Do i need to extend the PageCollector and write a custom collector class?
- By archy in forum LuceneReplies: 2Last Post: 12-24-2013, 07:53 PM
- By Moskovskaya in forum LuceneReplies: 2Last Post: 08-13-2012, 12:52 AM
- By yotamoo in forum New To JavaReplies: 6Last Post: 12-08-2010, 01:39 AM
- By Allasso in forum LuceneReplies: 9Last Post: 06-04-2010, 04:00 AM