Search by Algolia
Building a performant search bar in Nuxt with Algolia & Storefront UI
engineering

Building a performant search bar in Nuxt with Algolia & Storefront UI

In today's highly competitive e-commerce landscape, providing customers with a seamless and efficient search experience can make all ...

Jakub Andrzejewski

Senior Developer and Dev Advocate at Vue Storefront

How to use AI to build your business
ai

How to use AI to build your business

The world of technology is constantly evolving with generative Artificial Intelligence (AI) currently leading the charge. We’re suddenly surrounded ...

Abhijit Mehta

Director of Product Management

Haystack EU 2023: Learnings and reflections from our team
ai

Haystack EU 2023: Learnings and reflections from our team

If you have built search experiences, you know creating a great search experience is a never-ending process: the data ...

Paul-Louis Nech

Senior ML Engineer

What is k-means clustering? An introduction
product

What is k-means clustering? An introduction

Just as with a school kid who’s left unsupervised when their teacher steps outside to deal with a distraction ...

Catherine Dee

Search and Discovery writer

Feature Spotlight: Synonyms
product

Feature Spotlight: Synonyms

Back in May 2014, we added support for synonyms inside Algolia. We took our time to really nail the details ...

Jaden Baptista

Technical Writer

Feature Spotlight: Query Rules
product

Feature Spotlight: Query Rules

You’re running an ecommerce site for an electronics retailer, and you’re seeing in your analytics that users keep ...

Jaden Baptista

Technical Writer

An introduction to transformer models in neural networks and machine learning
ai

An introduction to transformer models in neural networks and machine learning

What do OpenAI and DeepMind have in common? Give up? These innovative organizations both utilize technology known as transformer models ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

What’s the secret of online merchandise management? Giving store merchandisers the right tools
e-commerce

What’s the secret of online merchandise management? Giving store merchandisers the right tools

As a successful in-store boutique manager in 1994, you might have had your merchandisers adorn your street-facing storefront ...

Catherine Dee

Search and Discovery writer

New features and capabilities in Algolia InstantSearch
engineering

New features and capabilities in Algolia InstantSearch

At Algolia, our business is more than search and discovery, it’s the continuous improvement of site search. If you ...

Haroen Viaene

JavaScript Library Developer

Feature Spotlight: Analytics
product

Feature Spotlight: Analytics

Analytics brings math and data into the otherwise very subjective world of ecommerce. It helps companies quantify how well their ...

Jaden Baptista

Technical Writer

What is clustering?
ai

What is clustering?

Amid all the momentous developments in the generative AI data space, are you a data scientist struggling to make sense ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

What is a vector database?
product

What is a vector database?

Fashion ideas for guest aunt informal summer wedding Funny movie to get my bored high-schoolers off their addictive gaming ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

Unlock the power of image-based recommendation with Algolia’s LookingSimilar
engineering

Unlock the power of image-based recommendation with Algolia’s LookingSimilar

Imagine you're visiting an online art gallery and a specific painting catches your eye. You'd like to find ...

Raed Chammam

Senior Software Engineer

Empowering Change: Algolia's Global Giving Days Impact Report
algolia

Empowering Change: Algolia's Global Giving Days Impact Report

At Algolia, our commitment to making a positive impact extends far beyond the digital landscape. We believe in the power ...

Amy Ciba

Senior Manager, People Success

Retail personalization: Give your ecommerce customers the tailored shopping experiences they expect and deserve
e-commerce

Retail personalization: Give your ecommerce customers the tailored shopping experiences they expect and deserve

In today’s post-pandemic-yet-still-super-competitive retail landscape, gaining, keeping, and converting ecommerce customers is no easy ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

Algolia x eTail | A busy few days in Boston
algolia

Algolia x eTail | A busy few days in Boston

There are few atmospheres as unique as that of a conference exhibit hall: the air always filled with an indescribable ...

Marissa Wharton

Marketing Content Manager

What are vectors and how do they apply to machine learning?
ai

What are vectors and how do they apply to machine learning?

To consider the question of what vectors are, it helps to be a mathematician, or at least someone who’s ...

Catherine Dee

Search and Discovery writer

Why imports are important in JS
engineering

Why imports are important in JS

My first foray into programming was writing Python on a Raspberry Pi to flicker some LED lights — it wasn’t ...

Jaden Baptista

Technical Writer

Looking for something?

facebookfacebooklinkedinlinkedintwittertwittermailmail

Good search relevance is about finding the right information as well as putting customers and online businesses on an equal footing. Search relevance not only tries to satisfy the intent of the customers as expressed in their search query, it also enables online businesses to present their products and services most advantageously without breaking the relevance expectations of their customers. 

In this article, we’ll see how this broader sense of search relevance extends to include browsing and discovery, activities that do not necessarily need to start with a search box. 

What is relevance? Or better, what is relevance trying to accomplish? 

Relevance algorithms attempt to (1) match the text of a query to some underlying content while (2) anticipating and satisfying the needs of both customer and business. This definition is a reasonably good summation, simple in some ways, but loaded with a wealth of unstated potential and power – or complexity, depending on whether you see things half full or half empty. 

The push/pull of relevance

If we simplify search relevance to be about looking for information, then a more general sense of relevance can mean something in addition to that. Our article on search and browse discussed the advantages of pulling and pushing content, i.e., searching and browsing. Users pull content when they actively search and expect to find the right information. A business pushes content when it actively suggests or surfaces information as the user searches (or browses) the company’s various digital interfaces. 

Let’s compare the two:

Pulling / Searching content Pushing / Browsing content
  • Matching letters, words, and phrases to content, and also filtering to drill down
  • Weighing the strength or weakness of a particular match (discussed below)
  • Results ranking: Ordering results by relevance (showing the strongest matches first)
  • Adding a custom ranking to sort by popularity, margin, or other such business metrics, as well as business needs
  • Promoting your products and services with merchandising campaigns
  • Curating content and media
  • Personalizing search results with user profiles
  • Dynamically adjusting results to fast-changing market trends and user behavior
  • Recommending related and ‘frequently bought together’ items
  • And more

Pulling and pushing are two parts of a whole. You can’t really separate them. Pushing the right information at the right moment (Browse) is not very different from a user pulling the right content as they search (Search). In other words, they are both designed to satisfy user intent – albeit in different ways. While this article focuses more on the pull than on the push (search instead of browse and discovery), in practice, they are never separated; they always act as a complete whole. We call this complete picture the relevance cycle.

The first part of this article focuses on basic search algorithms. There’s a companion article that goes deeper into how search engines achieve the best search relevance. At the end of the article, we provide links for further reading on the second part of the cycle, the browse/push functionality.

The relevance cycle explained

Technical relevance cycle – how the search engine manages relevance:

Search relevance cycle - technical view

Functional relevance cycle – what a user expects from relevance:

As you can see from both images, relevance travels along a cycle that includes both pulling and pushing information. The complete search experience starts with the search query, where the search engine applies finding and ordering algorithms to return a set of relevant search results. Then the search engine enhances the search results with merchandising, content management, AI-powered personalization, and recommendations – all of which depend on how you have configured these features in your system. 

Good search relevance – You know it when you see it 

A measure of good relevance is that the best matches show up on page 1 of your search results. But that’s not really what relevance is.  

A more appropriate definition of search relevance is: Whatever best matches a search query. But what does “best match” mean? Is it some kind of abstract relevance score? Or is it whatever feels right? As in: if it feels like the results match the query, or it appears to be what I was looking for, then it’s relevant

Unfortunately, this is a bit too subjective. If I type in Beetles and see a lot of scary-looking bugs, did the engine show me relevant search results? Yes – even if I were looking for the famous long-haired musicians, The Beatles. 

In fact, there’s a difference between what appears to be relevant and what is actually relevant. Good relevance has no intention of its own. Only the words in the query matter. 

However, the best search engines can read between the lines. If you’re selling music, the query “beetles” should find the music of The Beatles – which can be accomplished with techniques like typo tolerance and synonyms.

And suppose you sell both beetles and Beatles. In that case, two other aspects of relevance may come in handy: 

  • filtering, which allows you to filter by categories (bugs vs. music)
  • the user interface, where you can display a set of query suggestions, such as “beetles bugs” and “beatles music”, or multiple results – music on one side, bugs on the other 

There are many other UI possibilities for search results pages – for example, category pages and redirects. The techniques are many, with the goal to satisfy the full possibilities of a searcher’s intention and customer experience.

But still, what is relevance? Relevance is both subjective and objective

Taking all of the above into account, one thing is (unfortunately) true: What you consider relevant might not show up on Page 1. This can be a frustrating user experience – and should be avoided wherever possible. And yet, in some contexts, such as music, there will always be a strong subjective aspect.

For example: should we show the Rolling Stones on Page 1 for the query “famous rock groups”? Should the results show only British and American rockers? Other countries were also rocking in the 60s. Besides, how does a search engine know which musical groups were “famous”?

Another common problem is how to resolve a tie? For example, “bea” could equally bring up artists like Beans on Toast and Joe “Bean” Esposito who have a devoted but smaller audience. There are solutions to this (breaking results into categories, or limiting the number of results for the same artist). But the most important “fix” to this problem is the as-you-type, instant-results interface, where search results instantly appear on the web page as people type. With instant results, fans of Joe “Beans” Esposito can continue typing until their artist shows up. This extra typing is fine because today’s users are comfortable with being more precise to find lesser-known items.

Luckily, not every topic has such a strong subjective element. If someone is looking for the “right” shoes, a good search engine should guide the user to the best answer. This is made possible by structuring the shoe data. 

Structured versus unstructured information

Getting relevance right is no small task. A google search or any web search engine has to get it right for billions of people sifting through trillions of (largely) unstructured pieces of information. 

On a smaller scale, say an online marketplace like Amazon, a search engine can be far more consistent. Amazon knows its content and knows the queries often used by its customers. It can therefore structure its content around this knowledge.

This is where search engines like Algolia come in, allowing you to customize your search based on what you know about your content. Algolia’s search engine is agnostic about what it searches. Its algorothms can search movies, products on ecommerce sites,, blogs, hospital and customer records, Salesforce datasets, newspaper articles, and other use cases. You need to structure your content in a way that best represents the subject matter.

We discuss this in our companion piece to this article. But it’s worth taking a quick look at what it means to structure your datasets.

Creating structured, searchable content

Here’s a good example of what we mean by structure. A shoe has:

  • Name
  • Description
  • Brand
  • Genre
  • Color
  • Price 
  • Image
  • Popularity

Algolia’s relevance algorithms rely entirely on how you make the search engine aware of what information it’s searching for. It starts with creating valuable datasets, as above. However, you also need to tell the engine the meaning of this data. It sounds like a lot of complexity, but it’s actually very intuitive: 

  • You tell the engine that “name”, “color”, and “brand” are important for finding records, not “image” or “popularity”.  
  • You tell it to order the results based on the quality of the match, taking into account typos, exact or partial matches, and many other details. For example, the query “Bee” should show a Bee before a Beetle because Bee is an exact word match. The same query should also show “Beetles” before “Beatles” because typos are less good than non-typo matches. 
  • You can customize the order with business metrics, such as popularity, bestsellers, most listened to, the number of likes, and profit margins. For example, show all popular items that match first.
  • You can add filters, synonyms, and other such logical- and language-based methods. 
  • And finally, you can add critical features like merchandising, curation, AI, natural language processing, machine learning, AB testing, and Analytics to relevance optimization (in other words, browsing and discovery techniques to start pushing relevant content). 

What is the “best match”? How relevance weighs the strengths and weaknesses of a match

We’ve used the terms “best matches”, “quality matches”, and “ranking” often. Here’s what they mean. When we say “relevance”, we often mean “textual relevance”, which refers to how a search engine compares the words of a user’s query to the content and returns matching results. But we also mean ranking, which is about ordering the results by best matches, often referred to as “order by relevance”.

So, if an item matches the words in the search box, the search engine determines whether the match is strong or weak. We’ve already seen that above with the query “bee”, where Bee is stronger than Beetle. 

The best matches are the strongest matches.

To illustrate this, imagine a search experience that uses the simplest form of relevance – a letter-by-letter comparison. 

Here are four famous quotations:

  1. “To be, or not to be: that is the question” (Author William Shakespeare)
  2. “It was the best of times, it was the worst of times” (Author Charles Dickens)
  3. “Ask not what your country can do for you – ask what you can do for your country” (US President John F. Kennedy)
  4. “For a long time I used to go to bed early” (Author Marcel Proust)

Textual matching can be exact or partial. A search for “be matches the text of 3 records: record 1 (“be”), record 2 (“best”), and record 4 (“bed”). In this example, record 1 is the strongest because it’s an exact match, whereas records 2 and 4 are weaker because they are only partial matches. 

Continuing with this example, if we allow 1-word typos, then a search for “that” would find records 1 and 3, with record 1 (“that”) stronger than record 3 (“what”), which differs from the query by 1 letter.

Beyond search – browsing and discovery

Now that the search engine has found the best records and orders them by the strongest matches, it’s time to move ahead in the cycle. At this point, the business can consider adding or reordering records based on current sales promotions or industry trends. It can also redirect the user to a page designed for the item or categorization they are interested in. It can also personalize the results, favoring items that the user prefers (learned through analytics, AI, NLP, and machine learning). Finally, it can also start recommending related items alongside the results. We discuss all that elsewhere on our blog. For example:

Conclusion – The variety of relevance

We’ll end with an new search example. Take a fairly reasonable query: “dark pointy shoes for dancing”.

As discussed, relevance begins not only with the query but with how you structure your content. Thus, the results of the “pointy dancing shoes” query comes from how your data structure can answer these questions: 

  • What kind of shoes do I sell (colors, shapes, brands, etc.)?
  • What search terms does the common user type?
  • What kinds of shoes do my customers want and look for?
  • What shoes are trending or selling the best?
  • What segments do I target (kids, adults, teens)?
  • Should I add synonyms (e.g., “pointy” = “sharp”, “dancing” = “dance clubs”) 
  • Should I add filters for color and genre?

And then sit back and relax, knowing that those pointy dancing shoes will rise to the top. 

 

About the author
Peter Villani

Sr. Tech & Business Writer

linkedinmediumtwitter

Recommended Articles

Powered byAlgolia Algolia Recommend

Algolia's top 10 tips to achieve highly relevant search results
product

Julien Lemoine

Co-founder & former CTO at Algolia

What is a search query and how is it processed by a search engine?
product

Catherine Dee

Search and Discovery writer

What is search relevance?
product

Jon Silvers

Director, Digital Marketing