SlideShare a Scribd company logo
Faceting with Lucene Block Join Query - Lucene/Solr Revolution 2014
Faceting with Lucene 
Block Join Query
Agenda 
1. Why we need special faceting for 
Block Join queries? 
1. Proposed Block Join facet component.
Introducing myself 
PRIVILEGED AND CONFIDENTIAL 
Oleg Savrasov, PhD 
A programmer 
Working for Grid Dynamics 
(griddynamics.com) 
Work and live in Saint-Petersburg, 
Russia
Online shopping
Jerrica is looking for a dress
Huge amount of dresses
Facet filters help 
Facet 
filters 
Reduced 
amount
Tasks to be solved 
● Performant Search 
● Facet 
calculation/filtering 
FacetComponent ?
Product has many SKU
Aggregated facet counts 
Facets should 
count products, 
not SKU. 
Expected 
facets: 
COLOR 
Blue : 1 
Red : 1 
SIZE 
S : 1 
M : 1
Flat documents don’t help 
False positive match for 
+COLOR:Blue +SIZE:M
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
Search products only 
q = *:* 
fq = scope:product 
facet.field = COLOR 
facet.field = SIZE 
COLOR : 0 
SIZE : 0 
No such 
fields in 
product 
documents
Aggregated facet counts 
Facets should 
count products, 
not SKU. 
Expected 
facets: 
COLOR 
Blue : 1 
Red : 1 
SIZE 
S : 1 
M : 1
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
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
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
Block Join Facet Component
BlockJoinFacetCollector
Facets counting
It works! 
q = 
{!parent 
which="scope:product"}COLOR:Blue 
child.facet.field = SIZE 
<response> 
... 
<lst name="facet_counts"> 
<lst name="facet_fields"> 
<lst name="SIZE"> 
<int name="S">14</int> 
<int 
name="L">22</int> 
<int 
name="XL">17</int> 
</lst> 
</lst> 
</lst> 
</response>
The dress is found
Further improvements 
● Thorough profiling 
● Performance improvements 
● Algorithmic improvements
References 
http://www.slideshare.net/MarkHarwood/proposal-for-nested-document-support-in- 
lucene 
http://blog.mikemccandless.com/2012/01/searching-relational-content-with.html 
http://blog.griddynamics.com/2013/09/solr-block-join-support.html
Big thanks! 
Please vote for SOLR-5743. 
Do you have any questions?

More Related Content

More from Grid Dynamics (20)

PPTX
"Challenges for AI in Healthcare" - Peter Graven Ph.D
Grid Dynamics
 
PPTX
Dynamic Talks: "Applications of Big Data, Machine Learning and Artificial Int...
Grid Dynamics
 
PPTX
Dynamic Talks: "Digital Transformation in Banking & Financial Services… a per...
Grid Dynamics
 
PDF
Dynamic Talks: "Data Strategy as a Conduit for Data Maturity and Monetization...
Grid Dynamics
 
PDF
Dynamics Talks: "Writing Spark Pipelines with Less Boilerplate Code" - Egor P...
Grid Dynamics
 
PPTX
"Trends in Building Advanced Analytics Platform for Large Enterprises" - Atul...
Grid Dynamics
 
PPTX
The New Era of Public Safety Records Management: Dynamic talks Chicago 9/24/2019
Grid Dynamics
 
PPTX
Dynamic Talks: "Implementing data quality automation with open source stack" ...
Grid Dynamics
 
PDF
"Implementing AI for New Business Models and Efficiencies" - Parag Shrivastav...
Grid Dynamics
 
PPTX
Reducing No-shows and Late Cancelations in Healthcare Enterprise" - Shervin M...
Grid Dynamics
 
PDF
Customer intelligence: a Machine Learning Approach: Dynamic talks Atlanta 8/2...
Grid Dynamics
 
PPTX
"ML Services - How do you begin and when do you start scaling?" - Madhura Dud...
Grid Dynamics
 
PPTX
Realtime Contextual Product Recommendations…that scale and generate revenue -...
Grid Dynamics
 
PDF
Decision Automation in Marketing Systems using Reinforcement Learning: Dynami...
Grid Dynamics
 
PPTX
Best practices for enterprise-grade microservices implementations with Google...
Grid Dynamics
 
PPTX
Attribution Modelling 101: Credit Where Credit is Due!: Dynamic talks Seattle...
Grid Dynamics
 
PDF
Building an algorithmic price management system using ML: Dynamic talks Seatt...
Grid Dynamics
 
PDF
Customer intelligence: a machine learning approach- Dynamic talks Dallas Q2
Grid Dynamics
 
PDF
Improving Customer Experience via Experimentation Dynamic Talks: San Francisc...
Grid Dynamics
 
PDF
Customer intelligence: a machine learning approach 5/21/2019
Grid Dynamics
 
"Challenges for AI in Healthcare" - Peter Graven Ph.D
Grid Dynamics
 
Dynamic Talks: "Applications of Big Data, Machine Learning and Artificial Int...
Grid Dynamics
 
Dynamic Talks: "Digital Transformation in Banking & Financial Services… a per...
Grid Dynamics
 
Dynamic Talks: "Data Strategy as a Conduit for Data Maturity and Monetization...
Grid Dynamics
 
Dynamics Talks: "Writing Spark Pipelines with Less Boilerplate Code" - Egor P...
Grid Dynamics
 
"Trends in Building Advanced Analytics Platform for Large Enterprises" - Atul...
Grid Dynamics
 
The New Era of Public Safety Records Management: Dynamic talks Chicago 9/24/2019
Grid Dynamics
 
Dynamic Talks: "Implementing data quality automation with open source stack" ...
Grid Dynamics
 
"Implementing AI for New Business Models and Efficiencies" - Parag Shrivastav...
Grid Dynamics
 
Reducing No-shows and Late Cancelations in Healthcare Enterprise" - Shervin M...
Grid Dynamics
 
Customer intelligence: a Machine Learning Approach: Dynamic talks Atlanta 8/2...
Grid Dynamics
 
"ML Services - How do you begin and when do you start scaling?" - Madhura Dud...
Grid Dynamics
 
Realtime Contextual Product Recommendations…that scale and generate revenue -...
Grid Dynamics
 
Decision Automation in Marketing Systems using Reinforcement Learning: Dynami...
Grid Dynamics
 
Best practices for enterprise-grade microservices implementations with Google...
Grid Dynamics
 
Attribution Modelling 101: Credit Where Credit is Due!: Dynamic talks Seattle...
Grid Dynamics
 
Building an algorithmic price management system using ML: Dynamic talks Seatt...
Grid Dynamics
 
Customer intelligence: a machine learning approach- Dynamic talks Dallas Q2
Grid Dynamics
 
Improving Customer Experience via Experimentation Dynamic Talks: San Francisc...
Grid Dynamics
 
Customer intelligence: a machine learning approach 5/21/2019
Grid Dynamics
 

Recently uploaded (20)

PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Ad

Faceting with Lucene Block Join Query - Lucene/Solr Revolution 2014