You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by James O'Rourke <ja...@bittorrent.com> on 2007/05/17 09:07:25 UTC
date window
Hi All,
I've been thinking about this problem for some time now. I'm trying
to figure out a way to store date windows in lucene so that I can
easily filter as follows.
A particular document can have several date windows.
Give a specific date, only return those documents where that date
falls within at least one of those windows.
From what I can see, the only way I can think of doing it is to
create a special field format and create a custom filter. The filter
isn't that useful for caching though, because every query will have
new date (essentially NOW())
Also, note that there are multiple windows here for a single
document, we can't just search between min start and max end.
Ideas from those more familiar with lucene would be greatly appreciated.
James
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: date window
Posted by Chris Hostetter <ho...@fucit.org>.
: A particular document can have several date windows.
: Give a specific date, only return those documents where that date
: falls within at least one of those windows.
: Also, note that there are multiple windows here for a single
: document, we can't just search between min start and max end.
This can tehoreticaly be done using a custom varient of
PhraseQuery and "parallel fields" where you have a range_start field and a
range_end field and the positions of the dates in each field "line up" so
that you can tell which start corrisponds with which end.
I mentioned this idea (which actual came from on off hand comment Doug
made about PhraseQuery at last year's ApacheCon US) in this Solr thread
when someone asked a similar question...
http://www.nabble.com/One-item%2C-multiple-fields%2C-and-range-queries-tf2969183.html#a8404600
..i have never tried implementing this in practice.
-Hoss
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org