lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <>
Subject Re: Reverse range search
Date Sun, 31 Oct 2010 02:09:39 GMT
I wonder if function queries might help you here (be aware that these aren't
my strong point though). See:


On Thu, Oct 28, 2010 at 5:24 PM, kenf_nc <> wrote:

> Doing a range search is straightforward. I have a fixed value in a document
> field, I search on [x TO y] and if the fixed value is in the range
> requested
> it gets a hit. But, what if I have data in a document where there is a min
> value and a max value and my query is a fixed value and I want to get a hit
> if the query value is in that range. For example:
> Solr Doc1:
> field  min_price:100
> field  max_price:500
> Solr Doc2:
> field  min_price:300
> field  max_price:500
> and my query is price:250. I could create a query of (min_price:[* TO 250]
> AND max_price:[250 TO *]) and that should work. It should find only doc 1.
> However, if I have several fields like this and complex queries that
> include
> most of those fields, it becomes a very ugly query. Ideally I'd like to do
> something similar to what the spatial contrib guys do where they make
> lat/long a single point. If I had a min/max field, I could call it Price
> (100, 500) or Price (300,500) and just do a query of  Price:250 and Solr
> would see if 250 was in the appropriate range.
> Looong question short...Is there something out there already that does
> this?
> Does anyone else do something like this and have some suggestions?
> Thanks,
> Ken
> --
> View this message in context:
> Sent from the Solr - User mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message