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 Jonathan Rochkind <ro...@jhu.edu> on 2010/07/12 22:54:52 UTC

range faceting with integers

So I want to provide some range facets with an integer (probably tint, 
that is trie field with non-0 precision) solr field.

It's clear enough how to do this, along the lines of facet.query=[1 TO 
100]&facet.query=[101 TO 200]&facet.query=[201 TO 300]

etc.

The issue is that I'd like to calculate N equal ranges based on the min 
and max value found in the field. 

I can't think of any way to do this that doesn't require two querries -- 
one to get the min and max (within the current search set), then 
calculate the ranges client-side (possibly making the boundaries 'nice' 
numbers instead of strictly equal ranges), then do another query with 
the calculated facet.queries set.

Is there any other trick I'm missing here?  If there were date values, 
you could possibly use facet.date.gap, although I'm not even sure if 
that works without explicitly setting the facet.date.start, not sure if 
you can leave facet.date.start unset meaning "the minimum value in the 
field" or not.  But I'm not dealing with dates here anyway, but with 
integers.

So anything I'm missing, or just have the client do two queries?   For 
that matter, is there an easy way to ask for minimum and maximum values 
in a field, within a result set?

Thanks for any advice,
Jonathan

Re: range faceting with integers

Posted by Chris Hostetter <ho...@fucit.org>.
: Subject: range faceting with integers
: References: <AA...@mail.gmail.com>
: In-Reply-To: <AA...@mail.gmail.com>

http://people.apache.org/~hossman/#threadhijack
Thread Hijacking on Mailing Lists

When starting a new discussion on a mailing list, please do not reply to 
an existing message, instead start a fresh email.  Even if you change the 
subject line of your email, other mail headers still track which thread 
you replied to and your question is "hidden" in that thread and gets less 
attention.   It makes following discussions in the mailing list archives 
particularly difficult.
See Also:  http://en.wikipedia.org/wiki/User:DonDiego/Thread_hijacking




-Hoss