lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Høydahl / Cominvent <jan....@cominvent.com>
Subject Re: Reverse range search
Date Mon, 01 Nov 2010 19:26:01 GMT
Hi,

I think I have seen a comment on the list from someone with the same need a few months ago.
He planned to make a new fieldType to support this, e.g. MinMaxRangeFieldType which would
be a polyField type holding both a min and max value, and then you could query it
q=myminmaxfield:123

I did not find it as a Jira issue however, but I can see how it would be useful for a lot
of usecases. Perhaps you can create a Jira issue for it and supply a patch? :)

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com

On 28. okt. 2010, at 23.24, 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: http://lucene.472066.n3.nabble.com/Reverse-range-search-tp1789135p1789135.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Mime
View raw message