Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User

lucene sorting

 

 

Lucene java-user RSS feed   Index | Next | Previous | View Threaded


gm.tagliani at aladus

Apr 5, 2006, 8:31 AM

Post #1 of 2 (373 views)
Permalink
lucene sorting

Hi,
I need to change the lucene sorting to give just a bit more relevance to
the recent documents (but i don't want to sort by date). I'd like to mix
the lucene score with the date of the document.

I'm following the example in "Lucene in Action", chapter 6. I'm trying
to extends the SortComparatorSource but I don't understand how to get
the lucene score of the document.

Do you have some idea about how to solve my problem?
Or do you know where get some more example on custom sorting?

Thanks,
Gian Marco



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


hossman_lucene at fucit

Apr 5, 2006, 10:08 AM

Post #2 of 2 (365 views)
Permalink
Re: lucene sorting [In reply to]

I don't know if there is anyway for a Custom Sort to access the lucene
score -- but another approach that works very well is to use the
FunctionQuery classes from Solr...

http://incubator.apache.org/solr/docs/api/org/apache/solr/search/function/package-summary.html

...you can make a FunctionQuery object that scores things linerarly (or
reciprocally, or any other funciton you impliment in java) based on the
value of any field -- and then add that query to a BooleanQuery along with
your orriginal query and use the boost to determine how much of an
influence it has on your final score.


-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene

Lucene java-user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.