On Thu, Jan 8, 2009 at 9:49 AM, Yevgeniy Belman <ysbel...@gmail.com> wrote:
> Hi, > > I am curious if this is expected behavior in a typical facet with range > query: > params={facet=true,facet.query=[price:[* TO 500], price:[500 TO > *]],q=*:*,facet.field=price > > i am getting back not only the: > facet_queries={price:[* TO 500]=2,price:[500 TO *]=3} > > but also: > facet_fields={price={150.99=1,199.99=1,699.99=1,930.0=1,2300.0=1} You are adding both facet.query=price[... and the facet.field=price parameters so the response contains results for both. I was searching for a way to create the elusive "dynamic" amount ranges, and > this would allow me to do it on the client side for sure, but is this > right? > Solr will send all of this data back? It consists of every price variant > with a count. In my case 5 prices were all unique. If real data were used > could this be too big to send across? > > SimpleFacet.getFacetCounts() populates the response object with it. Is this > an appropriate place to calculate my dymic amount ranges and replace > facet_fields: > res.add("facet_queries", getFacetQueryCounts()); > res.add("facet_fields", getFacetFieldCounts()); // <-- replace with > "Dynamic" facets > res.add("facet_dates", getFacetDateCounts()); > > or should it be done sooner, somewhere in getFieldCacheCounts() where the > itteration through all the 5 docs is happening? > By dynamic ranges, do you mean that you want min and max values? If yes, you can look at StatsComponent (it is a 1.4 feature, so you'll need to use the nightly builds). http://wiki.apache.org/solr/StatsComponent -- Regards, Shalin Shekhar Mangar.