lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Samuru Jackson" <>
Subject Re: inclusive range search
Date Wed, 15 Mar 2006 16:31:02 GMT
> Try making bother terms mandatory with "+"
> "+date:[20040101 TO 20040101]  +Paris"

That was it .. however it does not exactly suite my needs. I want to
create a few combo boxes to let the user create a datefilter (From and
To) on the search queries using a webform.

Now if he chooses 20040101 to 20040201 and enters "Paris" (without +)
into the searchfield he will get back all documents according to the
date plus all documents containing Paris.

This result would be valid but not intuitive because if someone is
creating a date range he assumes that the delivered results of
documents containing Paris will only be inside this daterange.

So obviously I want to create a datefilter on the "Paris"-results.

What I did is this:

TermsFilter filter = new TermsFilter();
filter.addTerm(new Term("date", "20060304 TO 20060304"));
Query query = QueryParser.parse(search.trim(), "text", new StandardAnalyzer());

But somehow the filter does not work with the "TO" syntax.

Can you point me out how to create a "daterange" filter using the QueryParser?

Thanks again!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message