For an application that already has a Lucene Index, I would like to
implement a facet search that return result aggregations in two
dimensions. From the Lucene examples [1] I can see how to do a simple
facet search that collects facets in one dimension but I haven't seen
any examples for a two-step faceting.
Let's say I have a query X and two facet dimensions A and B on which I
would like to aggregate the hits. - How can I achieve the following
result (I am only interested in count of distinct pairs A|B):
X + A1 - B1 (12)
| B2 (3)
| B4 (8)
|
+ A2 - B1 (1)
| - B5 (8)
| - B9 (1)
| - B14 (15)
| - B15 (42)
| - B20 (95)
|
+ A3 - B2 (3)
| - B3 (1)
| - B4 (3)
| - B27 (7)
| - B31 (10)
| - B32 (21)
.
.
.
|
+ An - B4 (75)
- B9 (6)
- B15 (18)
- B41 (11)
For a naive solution I could perform a facet search on dim A, iterate
over A1..An and then, for each facet of A, perform another facet search
on dim B. But that is probably not efficient.
What is the recommended way to do this? I can see that Solr/ES provide
such a feature (sub-facet/nested aggregation) via their query language
but I would prefer to stick with a pure Lucene solution for now.
-Matthias
[1]
https://lucene.apache.org/core/7_7_2/demo/org/apache/lucene/demo/facet/package-summary.html
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
implement a facet search that return result aggregations in two
dimensions. From the Lucene examples [1] I can see how to do a simple
facet search that collects facets in one dimension but I haven't seen
any examples for a two-step faceting.
Let's say I have a query X and two facet dimensions A and B on which I
would like to aggregate the hits. - How can I achieve the following
result (I am only interested in count of distinct pairs A|B):
X + A1 - B1 (12)
| B2 (3)
| B4 (8)
|
+ A2 - B1 (1)
| - B5 (8)
| - B9 (1)
| - B14 (15)
| - B15 (42)
| - B20 (95)
|
+ A3 - B2 (3)
| - B3 (1)
| - B4 (3)
| - B27 (7)
| - B31 (10)
| - B32 (21)
.
.
.
|
+ An - B4 (75)
- B9 (6)
- B15 (18)
- B41 (11)
For a naive solution I could perform a facet search on dim A, iterate
over A1..An and then, for each facet of A, perform another facet search
on dim B. But that is probably not efficient.
What is the recommended way to do this? I can see that Solr/ES provide
such a feature (sub-facet/nested aggregation) via their query language
but I would prefer to stick with a pure Lucene solution for now.
-Matthias
[1]
https://lucene.apache.org/core/7_7_2/demo/org/apache/lucene/demo/facet/package-summary.html
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org