lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: RangeQuery question?
Date Wed, 12 Jul 2006 07:46:35 GMT

1) RangeQuery is the devil, don't use it.  If I weren't so lazy I would
change the javadocs for RangeQuery so that sentence was the class summary.
Takes a look at RangeFilter or ConstantScoreRangeQuery.

2) it's not clear what exactly you want your example to mean ... perhaps
you mean you want to match all docs with a field of "startDate
greater then "20060710" and a field of "endDate" less then "20060711", in
which case what you want to do is make a BooleanQuery containing two
ConstantScoreRangeQueries -- one on the startDate and one on the endDate.
... If that's not what you mean, then I don't understand your question.

: Is there a RangeQuery equivalent that can query date range on two
: different fields?
: Term startTerm = new Term("startDate", "20060710");
: Term endTerm = new Term("endDate", "20060711");
: RangeQuery q = new RangeQuery(startTerm, endTerm, true);


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

View raw message