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 jay67 <jp...@gmail.com> on 2014/02/12 18:03:34 UTC

Using numeric ranges in Solr query

When user enter a price in price field, for Ex: 1000 USD, i want to fetch all
items with price around 1000 USD. I found in documentation that i can use
price:[* to 1000] like that. It will get all items with from 1 to 1000 USD.
But i want to get results where price is between 900 to 1000 USD. 

Any help is appreciated.

Thank You.



--
View this message in context: http://lucene.472066.n3.nabble.com/Using-numeric-ranges-in-Solr-query-tp4116941.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Using numeric ranges in Solr query

Posted by Jack Krupansky <ja...@basetechnology.com>.
Is price a float/double field?

price:[99.5 TO 100.5]  -- price near 100

price:[900 TO 1000]

or

price:[899.5 TO 1000.5]

-- Jack Krupansky

-----Original Message----- 
From: jay67
Sent: Wednesday, February 12, 2014 12:03 PM
To: solr-user@lucene.apache.org
Subject: Using numeric ranges in Solr query

When user enter a price in price field, for Ex: 1000 USD, i want to fetch 
all
items with price around 1000 USD. I found in documentation that i can use
price:[* to 1000] like that. It will get all items with from 1 to 1000 USD.
But i want to get results where price is between 900 to 1000 USD.

Any help is appreciated.

Thank You.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Using-numeric-ranges-in-Solr-query-tp4116941.html
Sent from the Solr - User mailing list archive at Nabble.com. 


Re: Using numeric ranges in Solr query

Posted by Rafał Kuć <r....@solr.pl>.
Hello!

Just specify the left boundary, like: price:[900 TO 1000]

-- 
Regards,
 Rafał Kuć
Performance Monitoring * Log Analytics * Search Analytics
Solr & Elasticsearch Support * http://sematext.com/


> When user enter a price in price field, for Ex: 1000 USD, i want to fetch all
> items with price around 1000 USD. I found in documentation that i can use
> price:[* to 1000] like that. It will get all items with from 1 to 1000 USD.
> But i want to get results where price is between 900 to 1000 USD. 

> Any help is appreciated.

> Thank You.



> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Using-numeric-ranges-in-Solr-query-tp4116941.html
> Sent from the Solr - User mailing list archive at Nabble.com.