Looking for our logo?
When listening to professional musicians, you expect perfect harmony. When a note is off, you will notice the dissonance.
The same thing happens when a search doesn’t resonate. When you’re shopping online you expect a finely tuned search experience that delivers exactly what you’re looking for.
How many times have you looked online for something specific, like an iPhone, only to be bombarded with product listings of watches, cases, and other accessories. It feels like the search engine isn’t listening to you.
The truth is, a lot of search engines don’t know how to listen – they’re not programmed to understand the intention behind your query.
Disappointing search results for ‘iPhone’
That’s where Algolia Query Categorization (QCat) comes into play. Let’s take a look at how this functionality can turn “out-of-tune” search results into a harmonious user experience. We’ll also see how customizing QCat lets you compose unique user experiences.
The core issue with bad search results is misunderstood intent. Imagine you’re in the market for a 4K TV. You visit a website and type in ‘4K TV’ – a pretty standard query that’s very specific.
To your surprise, instead of being served results of the latest 4K TVs, you’re inundated by listings of remote cases, hdmi cables, wall mounts, – everything but the product that you’re looking for. Why is there no TV? And why is a red remote case the first result?
Misunderstood intent correlates to disappointing results
The search engine is doing what it thinks is its job – following the rules of keyword matching, but in this instance it’s not registering user intent.
Search engines that are designed to prioritize keyword matches look at the words ‘4K’, and ‘TV’ and try to find products with these exact same words within the searchable data.
The red remote case is ranked in first place because it includes both of the query words – ‘4K’ and ‘TV’ – which are adjacent at the top of the JSON record in the ‘name’ attribute. At the bottom of the data for this record, the hierarchical categorization places the case under Accessories and Remote Control.
Record for the red remote case
If we look at the getRankingInfo parameter for this result, we see that the search engine is capturing the proximity of ‘4K’ and ‘TV’ as 1, the number of exact words as 2. So while it’s doing its job, it’s not capturing the intention behind the query.
getRankingInfo for the red remote case
How can we fix the problem of misunderstanding of user intent? Train users to make better queries? Change all the data to be more prescriptive? Patch the data with rules so the results filter out ‘accessories’ when searching for ‘TV’? These solutions are neither scalable nor realistic.
So what’s the answer? Query Categorization.
Here’s how you can enable the QCat feature on your dashboard to create a harmonious experience for users.
The first step to capture user events. Dynamic, real-world behavior, like clicks and conversions, is used to train your QCat model.
When you have enough events for your App, then you can set your category attributes. QCat will then take all that information to create category predictions. This allows the model to automatically filter and boost for each query.
QCat has its own section in your dashboard with a field for Index Classification. This is where you set the facet attribute, with four optional nested levels of data.
QCat model in the Algolia Dashboard
Meanwhile the Categories with Search API toggle allows you to expose the category prediction on the front end. There are also additional settings for controlling QCat – for instance if you want to filter or boost results based on levels of confidence from the QCat model.
QCat configuration options
The earlier disappointing search results were achieved using keyword search only. But for the same query and exact same data set – but with QCat enabled – we see the results match our intent.
QCat-enabled results for ‘4K TV’ search
Looking at the response you can see that autofiltering is enabled and the maxdepth of hierarchical categories is set at the current hard limit of 5.
At the bottom of the data, we see that the facet filter applied to this response is only ‘televisions.’ This is why we’re only seeing televisions in the results.
Hierarchy of QCat-enabled results for ‘4K TV’ search
This same QCat model has a confidence level of “certain” and a depth level of 2 down at the bottom: hierarchical categories: Electronics > Television & Video > Televisions.
Confidence level “certain”
The “certain” level is a result of the user events fed into the model, because the vast majority of people typing in ‘4K TV’ are clicking and converting in the Televisions category. QCat will continue to learn as it is fed additional user events – allowing for even more depth and accuracy in the search experience over time.
As we’ve seen, QCat works its magic by applying autofiltering and boosting in the background, so you don’t actually have to make any front-end customization to get improved search relevance.
Because you can retrieve category predictions and other data directly in the search response, you can choose to provide a signal to your user in the UI. This gives you the flexibility to build custom widgets and present results in a way that suits your users and platform.
Here’s an example of a customized widget:
Searching for ‘milk’ brings up two categories: Grocery & Gourmet Food, and Personal Care.
Let’s say the user wants to soothe their dry skin with body milk. They choose Personal Care, which gets added to the search bar.
The search for ‘milk’ deepens
The user clicks through to the search results page with that category filter already applied, so that they only see relevant results.
The search for ‘milk’ continues
At this point, the user can choose to clear that filter, open up the results, or continue their journey.
Playing the right notes at the right time is essential for a harmonious performance. Similarly, delivering the right search results at the right moment is crucial for a seamless customer experience.
Keyword search limitations hinders you from hitting the right notes. But QCat is like a conductor who ensures every instrument comes at precisely the right moment – matching user intent by using real-world data.
QCat orchestrates results that are perfectly in tune with user intent. It’s not just about improving search, it’s about delivering a performance that resonates with your audience.
Learn more about query categorization from Algolia or watch my DevCon video, Fine-tuning search: How Q-Cat hits the right notes for user intent
David Bacon
Associate Customer Success Engineer