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 Bojan Šmid <bo...@gmail.com> on 2013/07/15 16:52:14 UTC
Aggregating data with Solr, getting group stats
Hi,
I see there are few ways in Solr which can "almost" be used for my use
case, but all of them appear to fall short eventually.
Here is what I am trying to do: consider the following document structure
(there are many more fields in play, but this is enough for example):
Manufacturer
ProductType
Color
Size
Price
CountAvailableItems
Based on user parameters (search string, some filters), I would fetch a
set of documents. What I need is to group resulting documents by different
attribute combinations (say "Manufacturer + Color" or "ProductType + Color
+ Size" or ...) and get stats (Max Price, Avg Price, Num of available
items) for those groups.
Possible solutions in Solr:
1) StatsComponent - provides all stats I would need, but its grouping
functionality is basic - it can group on a single field (stats.field +
stats.facet) while I need field combinations. There is an issue
https://issues.apache.org/jira/browse/SOLR-2472 which tried to deal with
that, but it looks like it got stuck in the past.
2) Pivot Faceting - seems like it would provide all the grouping logic I
need and in combination with
https://issues.apache.org/jira/browse/SOLR-3583"Percentiles for
facets, pivot facets, and distributed pivot facets" would
bring percentiles and averages. However, I would still miss things like
Max/Min/Sum and the issue is not committed yet anyway. I would also depend
on another yet to be committed issue
https://issues.apache.org/jira/browse/SOLR-2894 for distributed support.
3) Configurable Collectors -
https://issues.apache.org/jira/browse/SOLR-4465- seems promissing, but
it allows grouping by just one field and, probably
a bigger problem, seem it was just a POC and will need overhauling before
it is anywhere near being ready for commit
Are there any other options I missed?
Thanks,
Bojan