You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Jake Conk <ja...@gmail.com> on 2008/08/26 20:38:01 UTC
Querying Greater Than and Less Than
Hello,
I was trying to figure out how to query ranges greater than and less
than. The closest solution I could find was using the range format:
field:[x TO z]
While this solution works for querying greater than items how would I
query all items less than 10 assuming I have some items that have a
negative number that should be selected as well. The closest thing
I've came to was this:
field:[0 TO 10]
Given I don't know what is the smallest negative number but I want to
be able to somehow be able to get all items, is there a way somehow?
Thanks,
- Jake
Re: Querying Greater Than and Less Than
Posted by mike topper <mt...@riseup.net>.
you can also use queries like field:[* to Z] or field:[Z TO *]
-Mike
Jake Conk wrote:
> Hello,
>
> I was trying to figure out how to query ranges greater than and less
> than. The closest solution I could find was using the range format:
>
> field:[x TO z]
>
> While this solution works for querying greater than items how would I
> query all items less than 10 assuming I have some items that have a
> negative number that should be selected as well. The closest thing
> I've came to was this:
>
> field:[0 TO 10]
>
> Given I don't know what is the smallest negative number but I want to
> be able to somehow be able to get all items, is there a way somehow?
>
> Thanks,
>
> - Jake
>