Mailing List Archive

Search result ordering question
I've been using Lucene a bit, and find it very flexible and fast.

However, I need to order search results by date (or, equally, document
id); I've looked a bit into (re)writing a collect method without any
luck. I'm not programming Java too much, so I'm not getting any way with
the (few) hints I've seen regarding date-sorted result sets.

Does anyone have a quick solution/example to give?

thanks,
Kent Vilhelmsen





--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
RE: Search result ordering question [ In reply to ]
Is this question still pending?
Well I haven't tried it but DateFilter might be what you're looking for:

http://jakarta.apache.org/lucene/docs/api/org/apache/lucene/search/DateF
ilter.html

You could also add a field that's a kind of enumerated indicating how
recent the doc is.
You add a field "when" with a value of "day", "week", "month", "year",
to indicate
if it is a day old, week old etc.
Then you query using a boost:

when:day^2.0 when:week^1.8 when:month^1.6 when:year:^1.4

and priority will be given to newer docs.





-----Original Message-----
From: Kent Vilhelmsen [mailto:kentv@a.sol.no]
Sent: Tuesday, March 12, 2002 12:00 PM
To: lucene-user@jakarta.apache.org
Subject: Search result ordering question



I've been using Lucene a bit, and find it very flexible and fast.

However, I need to order search results by date (or, equally, document
id); I've looked a bit into (re)writing a collect method without any
luck. I'm not programming Java too much, so I'm not getting any way with
the (few) hints I've seen regarding date-sorted result sets.

Does anyone have a quick solution/example to give?

thanks,
Kent Vilhelmsen





--
To unsubscribe, e-mail:
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:lucene-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>