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 Mike Austin <ma...@gmail.com> on 2006/09/28 00:44:11 UTC

Price facet counts based on price[] query or text field

I'm trying to figure out the best way to do filters based on price.  I've
been thinking that I would do it based on the query such as price[10-20],
however I wanted opinions on whether it would be better to do it based on
pre-filtering the item into a price range and searching for the string that
represents the price range in a multivalued text field in the schema (beside
other filtering values)? I was thinking that pre-filtering or grouping items
into the respected price range would be more work operationally but might
pay off with better performance. It would limit my searches to only the
predefined price ranges, however I don't know if that is a big problem.

Maybe some info on how other people do this and why would be helpful?

Thanks,
Mike

Re: Price facet counts based on price[] query or text field

Posted by Chris Hostetter <ho...@fucit.org>.
if you are looking at totally cold searches, with no caching, then you
might see a small performance using pre-defined constraints flagged with
special terms then with range filters -- just becuase looking up the
documents matching one term is allways going to be a little faster then
looking up the documents that match a range of terms -- but that
differnece is probably going to be so small you won't even notice it.

Even if you do find that it's measurable given your index size, the
headaches of needing to reindex all of your data everytime you decide to
tweak your price ranges may overshadow the slight performance gains.

That said: as long as you've got some memory to spare, you should never
really need to worry about the speed of totally cold searches with no
caching.  Once the filterCache is populated with sets for each price facet
constraint, it won't matter if that constraint was specified with a range
or with a term.



: Date: Wed, 27 Sep 2006 17:44:11 -0500
: From: Mike Austin <ma...@gmail.com>
: Reply-To: solr-user@lucene.apache.org
: To: solr-user@lucene.apache.org
: Subject: Price facet counts based on price[] query or text field
:
: I'm trying to figure out the best way to do filters based on price.  I've
: been thinking that I would do it based on the query such as price[10-20],
: however I wanted opinions on whether it would be better to do it based on
: pre-filtering the item into a price range and searching for the string that
: represents the price range in a multivalued text field in the schema (beside
: other filtering values)? I was thinking that pre-filtering or grouping items
: into the respected price range would be more work operationally but might
: pay off with better performance. It would limit my searches to only the
: predefined price ranges, however I don't know if that is a big problem.
:
: Maybe some info on how other people do this and why would be helpful?
:
: Thanks,
: Mike
:



-Hoss