This presentation was provided at the Lucene/Solr Revolution conference in Washington, DC in 2014 by Oleg Savrasov and discusses why we need special faceting for Block Join queries as well as proposes a Block Join facet component.
3. Agenda
1. Why we need special faceting for
Block Join queries?
1. Proposed Block Join facet component.
4. Introducing myself
PRIVILEGED AND CONFIDENTIAL
Oleg Savrasov, PhD
A programmer
Working for Grid Dynamics
(griddynamics.com)
Work and live in Saint-Petersburg,
Russia
13. Separate SKU documents
q = *:*
facet.field = COLOR
facet.field = SIZE
COLOR
Blue : 1
Red : 2
SIZE
S : 2
M : 1
Wrong
numbers!
There is
only one
product
14. Search products only
q = *:*
fq = scope:product
facet.field = COLOR
facet.field = SIZE
COLOR : 0
SIZE : 0
No such
fields in
product
documents
15. Aggregated facet counts
Facets should
count products,
not SKU.
Expected
facets:
COLOR
Blue : 1
Red : 1
SIZE
S : 1
M : 1
16. Solr Block Join Support (since Lucene 3.4.0)
Green
Blue
Yello
w
Yello
w
Blue
Green
Product
Green
Yello
w
Product
Green
Blue
Yello
w
Yello
w
Product
docId
Child docs Parent doc
Query: {!parent which="scope:product"}COLOR:Blue
1 1 1
Block
1 1
scope:product
COLOR:Blue
1
ToParentQuery 1 1
17. SOLR-5743 Faceting with Block Join support
● Create BlockJoinFacetComponent
● ToParentQuery is expected
● Facet counts should correspond to
amount of parent documents
● Only DocValues fields are
supported
18. Faceting over DocSet slices
Green
Blue
Yello
w
Yello
w
Blue
Green
Product
Green
Yello
w
Product
Green
Blue
Yello
w
Yello
w
Product
docId
0 1 0 0 1 0 1
DocSet Slice
DocSet Slice counts
COLOR Blue : 2
Aggregated counts
COLOR Blue : +1