Introduction to block join faceting in Solr
Jul 20, 2016 • 3 min read

A straightforward look at how block join faceting works, how it can save your customers from frustrating search experiences, and why Grid Dynamics created SOLR-5743 to bring block join faceting to Solr
Here is a simple type of faceted search you see on many e-commerce websites:
In this example, we’ve already selected “Sleeveless Dresses.” The categories shown in the left column (Price, Features, Customer Rating, Brand) represent faceted search options, which differ from simple filters because, with faceted search, we can offer our customers multiple filters at the same time. For example, you can select a “Price” of $10 – $19.99, which gives you 98 choices, then narrow your choice further by specifying your favorite “Color.” After selecting “Color,” you can choose the minimum “Customer Rating” you find acceptable. Do you have a brand of clothing you prefer? You can choose that, too, with each selection acting as one facet in a single multi-faceted search.
Here’s another faceted search example, this time showing basic implementation details:
The screenshot above is taken from an online retailer’s website. According to the graphic, a dress can be blue, pink or red, and only sizes XS and S are available in blue. However, for merchandisers and customers this dress is considered a single product, not many similar variations. When a customer navigates the site, she should see all SKUs belonging to the same product as a single product, not as multiple products. This means that for facet calculations, our facet counts should represent products, not SKUs. Thus, we need to find a way to aggregate SKU-level facets into product ones.
A common solution is to propagate properties from the SKU level to the product level and produce a single product document with multivalued fields aggregated from the SKUs. With this approach, our aggregated product looks like this:
However, this approach creates the possibility of false positive matches with regards to combinations of SKU-level fields. For example, if a customer filters by color ‘Blue’ and size ‘M’, Product_1 will be considered a valid match, even though there is no SKU in the original catalog which is both ‘Blue’ and ‘M’. This happens because when we are aggregating values from the SKU level, we are losing information about what value comes from what SKU. Even though this situation looks like an edge case, in a real life application it can result in a really bad customer experience. Imagine a situation where a customer searches for a particular item, filters by color and size, only to discover on the checkout page that there is no such item available in the catalog. This type of website behavior can really frustrate your customers and have a strong negative impact on loyalty.
Getting back to the technology, this means we should carefully support our catalog structure when searching and faceting products. The problem of searching structured data is already addressed in Solr with a powerful, high performance and robust solution: Block Join Query. We write extensively about this approach in another blog post.
However, the problem of faceting structured data required further work, so we created SOLR-5743 in February 2014 to bring faceting support to Solr, and we have worked on it ever since. Now that it is committed to trunk, we have a well-documented method of implementing block join faceting in Solr.
Tags
You might also like
The buzzword “composable commerce” has dominated digital strategy conversations since Gartner popularized the term in 2020. But behind the marketing hype lies a longstanding, proven practice of integrating specialized, best-of-breed technology components into a flexible and scalable ecosystem....

For many businesses, moving away from familiar but inherently unadaptable legacy suites is challenging. However, eliminating this technical debt one step at a time can bolster your confidence. The best starting point is transitioning from a monolithic CMS to a headless CMS. This shift to a modern c...

As a retail leader, are you in complete control of your search, browse, and recommendation strategies? Do your digital experiences align with your business goals while delivering what customers expect? Can you control product rankings to highlight specific items in search results, adjust categories...
The headless CMS market is experiencing unprecedented growth as organizations recognize its potential for delivering flexible, personalized digital experiences. Recent market analysis reveals striking momentum—the global headless CMS software market, valued at $851.48 million in 2024, is projected...
In today's fast-paced and data-driven world, accurately predicting demand is more critical than ever for businesses aiming to stay competitive. Traditional forecasting methods often provide a single-point estimate, which can be useful but falls short in accounting for the inherent uncertainties and...
Have you come across a retail marketing message lately that states, 'Bring the fitting room home and find what you love'? Many retail brands today showcase their customer-first mindset through 'try before you buy' experiences, allowing customers to order products online, try everything, and return...
Demand forecasting is a crucial aspect of retail supply chain management that involves predicting future customer demand to make informed decisions about inventory levels, production, and resource allocation. It is a statistical analysis that considers numerous variables to optimize the predict...