lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Wettin <karl.wet...@gmail.com>
Subject Re: Help needed bubbling up relevant records with most recent date
Date Fri, 02 Oct 2009 07:38:46 GMT
Use a span near query to add boost for the phrases. If you only want  
to add boost for exact phrases (0 slop) you might want to consider  
using shingles.

In order to add greater score for a date closer in time you can choose  
between a range of solutions depending on your needs. Using a function  
query is probably the easiest way, but using payloads or field boost  
might also work.

I'm not sure about how safe it is but think the most efficient way for  
your requirements (as I understand them) is to add documents ordered  
by date, adding the closest to current date now. This will produce the  
same score for the documents matching the same phrase but will return  
the document with the lowest document number first. Or is it the other  
way around? This will however probably mean that you'll need to  
rebuild your complete index every time you add a new document. If you  
can do that nightly or your corpus is static it shouldn't be a  
problem. I never did this so please correct me if I'm wrong or confirm  
if I'm right.


     karl

2 okt 2009 kl. 04.57 skrev mitu2009:

>
> Hi,
>
> I've got 5 records in Lucene index.
>
> a.Record 1 contains--tax analysis.Date field value is March 2009
>
> b.Record 2 contains--Senior tax analyst.Date field value is Aug 2009
>
> c.Record 3 contains--Senior tax analyst.Date field value is July 2009
>
> d.Record 4 contains--tax analyst.Date field value is Feb 2009
>
> e.Record 5 contains--Senior tax analyst.Date field value is Oct 2009
>
> If the input keyword is senior tax analyst,then search results  
> should come
> up in the following order:
>
> a.Record 5--because this record is has got the most recent date and  
> has got
> the matching phrase
>
> b.Record 2--because this record has got second most recent date and  
> has got
> the matching phrase
>
> c.Record 3--because this record has got third most recent date and  
> has got
> the matching phrase
>
> d.Record 4
>
> e.Record 1
>
> Basically,I want to show the most relevant records grouped by date and
> sorted in descending order by date.And then, I want to show remaining
> records sorted by descending value of relevancy. How do i achieve  
> this with
> Lucene?
>
> Please help.
>
>
> -- 
> View this message in context: http://www.nabble.com/Help-needed-bubbling-up-relevant-records-with-most-recent-date-tp25709909p25709909.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>


---------------------------------------------------------------------
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