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

Reply via email to