Bubbling up newest content in lucene search results

lucene

I am storing various articles in my lucene index.
When user searches for articles which contain a specific term or phrase,I need to show all th articles (could be anywhere between 1000 to 10000 articles) but with newest articles "bubbled up" in the search results.

I believe you can bubble up a search result in Lucene using "Date field Boosting".
Can someone please give me the details of how to go about this?

Thanks in advance!

Best Answer

I would implement the SortComparatorSource interface. You should write a new ScoreDocComparator, whose compare() function compares two dates. Then you will need to sort your searches using the new sorter. This advice is taken from chapter 6 of Lucene in Action.

Related Topic