I had a similar issue. The solution I ended up using was a custom RequestHandler that extends SearchHandler. In handleRequestBody() it calls super.handleRequestBody(req, rsp), looks for a "pageSize" parameter (25 in your example), and loops over the array of results inside the response, pulling out the ones I want and building a new array. It performs well enough, and avoids downloading a large result set. It sounds like you're more interested in number of buckets whereas I needed a specific page size, but you could just as easily pass in the number of buckets in your param. This solution does require that you be willing to write some java code and add it to your solr deploy as a plugin. Then you configure your new request handler in solrconfig.xml and you can give it a default page size or bucket size.

I actually discussed this with some people at the training before Lucene Revolution and there wasn't a distinct right answer. Because I was looking for a three-letter prefix for my ranges, one suggestion was to add the prefix to the solr index and facet on it. Then, by adding up counts you could tell what the endpoints of an interval were. That would still require doing some calculations on the client side, and it won't be useful if you have full values with few duplicates.
-Cat Bieber


On 06/22/2012 09:32 AM, AlexR wrote:
I need even sized buckets and their borders.
100/4 = 25 entries

Border for first interval is entry 1 and entry 25
in this case Alex - John

i don't want to load all names and calculate the borders on the client.
Is there a way to get the borders from Solr?

Reply via email to