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 Vijay Santhanam <vi...@spectrumwired.com> on 2007/02/19 00:43:39 UTC

Multiple time ranges in a document

Hello,

 

I'm using a RangeFilter to find "Event" documents (with Start and End lucene
friendly formatted date fields) that match a Users time range query. This
works perfectly in sub-second times at decent loads, but I'm having trouble
searching multiple performances in the one document. Indexing them is no
problem, because I can add extra terms to the start and end fields.

 

Here's a situation that doesn't work to well with the RangeFilter:-

 

Let's say a comedian has a regular gig every Monday for the next 3 weeks,
from 7pm-9pm. So, the start field will be 200702191900, 200702261900,
200703051900. And, the end field will be 200702192100, 200702262100,
200703052100.

If someone searches for an event on Thursday anytime during his 3 week
stint, the comedian's event will show up, because the Range Filter will
consider the lowest term of the start field and the highest term of the end
field.

 

Also, sorting by start or end fields will break, but I could write my own
SortComparatorSource to fix that.

 

How could I get around the filter problem? I could write my own filter, but
it would need to keep track of both fields, and their respective term
positions for each field.

 

Thanks for your help,

-Vijay