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 "Michael J. Prichard" <mi...@mac.com> on 2006/09/25 18:03:32 UTC

"Greater than" equivalent?

I have a filtering process that checks my index for various things.  I 
have an "itemid" field in this index and I keep track of the last itemid 
I search up to.  I was wondering if there was an equivalent to doing a 
search with a "greater than" clause?  Sort of like:

to:blah@blah.com AND subject:happy AND itemid: >125688

-Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: "Greater than" equivalent?

Posted by Erick Erickson <er...@gmail.com>.
I think you could use a range (either a RangeQuery or RangeFilter).  So your
range (from your example) would be between 125688 and 1000000000 or some
such...

Be careful of a RangeQuery throwing TooManyClauses if your range contains
more than 1024 (default) distinct entries, which means I'd recommend using
the RangeFilter is your first option.....

Erick

On 9/25/06, Michael J. Prichard <mi...@mac.com> wrote:
>
> I have a filtering process that checks my index for various things.  I
> have an "itemid" field in this index and I keep track of the last itemid
> I search up to.  I was wondering if there was an equivalent to doing a
> search with a "greater than" clause?  Sort of like:
>
> to:blah@blah.com AND subject:happy AND itemid: >125688
>
> -Michael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>