lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Graham Stead" <gst...@ieee.org>
Subject RE: Avoiding sort by date
Date Mon, 16 Oct 2006 13:49:19 GMT
Given that you want to score new documents higher (implicitly sorting them),
I wonder whether Solr's FunctionQuery (specifically ReciprocalFloatFunction
-
http://incubator.apache.org/solr/docs/api/org/apache/solr/search/function/Re
ciprocalFloatFunction.html) may also be helpful. It gives newer documents
higher scores than older documents. 

I believe ReciprocalFloatFunction uses the document order within the index
to help accomplish this (see ReverseOrdFieldSource), so your code would have
to index new documents after older ones. Usually this is not a problem.

In your case, I'm not sure when it's better to use Sort or
ReciprocalFloatFunction. Perhaps someone with more knowledge than I could
advise?

-Graham

> -----Original Message-----
> From: yseeley@gmail.com [mailto:yseeley@gmail.com] On Behalf 
> Of Yonik Seeley
> Sent: Sunday, October 15, 2006 8:32 PM
> To: java-user@lucene.apache.org
> Subject: Re: Avoiding sort by date
> 
> On 10/12/06, rayvittal-lists@yahoo.com 
> <rayvittal-lists@yahoo.com> wrote:
> > Does the Sort function create some kind of internal cache?
> 
> Yes, it's called the FieldCache, and there is a cache with a 
> weak reference to the index reader as a key.  As long as 
> there is a reference to the index reader (even after close() 
> has been called) the cache data will exist.
> 
> -Yonik
> http://incubator.apache.org/solr Solr, the open-source Lucene 
> search server



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message