1

By counting in facet results I mean resolve the problem:

I have 7 documents:

A1   B1   C1
A2   B1   C1
A3   B2   C1
A4   B2   C2
A5   B3   C2
A6   B3   C2
A7   B3   C2

If I make the facet query by field B, get the result: B1=2, B2=2, B3=3.

A1   B1   C1
A2   B1   C1     2 - facing by B
--------------====
A3   B2   C1
A4   B2   C2     2 - facing by B
--------------====
A5   B3   C2
A6   B3   C2
A7   B3   C2     3 - facing by B
--------------====

I want to get additional information, something like count in results, by field C. So, how can I query to get a result similar to the following:

A1   B1   C1
A2   B1   C1     2, 1 - facing by B, count C in facet results
--------------=======
A3   B2   C1
A4   B2   C2     2, 2 - facing by B, count C in facet results
--------------=======
A5   B3   C2
A6   B3   C2
A7   B3   C2     2, 1 - facing by B, count C in facet results
--------------=======

Thanks

Tom_LK
  • 113
  • 1
  • 2
  • 7

1 Answers1

2

What you need is Facet Pivots
This will help you get the results and counts of hierarchies.

This is available in Solr 4.0 trunk build. So you may need to apply the patch.

References -
http://wiki.apache.org/solr/HierarchicalFaceting
http://wiki.apache.org/solr/SimpleFacetParameters#Pivot_.28ie_Decision_Tree.29_Faceting

Jayendra
  • 52,349
  • 4
  • 80
  • 90
  • I use Solandra that integrates Solr 3.4 with Cassandra. So, is there any way to solve this problem with Solr 3.4? – Tom_LK Nov 14 '11 at 10:54
  • Thanks I have calculated some aggregation data to get appropriate result. Thanks for your advice – Tom_LK Nov 29 '11 at 09:44