Skip to main content
When users see no results, they may assume your site doesn’t offer what they need. To avoid this, display related results to help guide users toward relevant content. For example, showing an empty results set could occur when:
  • User queries are too specific.
  • Users sometimes enter queries that include unrelated product types. For example, a query like cutlery for outdoor table and chairs set mixes furniture and kitchenware. Since few products match all those terms, the search often returns no or irrelevant results. A more specific query, like round outdoor table, focuses on a single product type and is easier for Algolia to match accurately.
  • Poor data can prevent relevant results from showing.

Show alternatives in the UI

To improve the user experience:
  • Show a set of related but less relevant results. Use Query Suggestions to display helpful popular search alternatives if a query doesn’t return any results.
  • Show a helpful “no results” page, with suggestions for other queries and a selection of meaningful content.

How to avoid no results

Review your current solution: The next step is to use advanced settings to return more results.

Good data

To improve your records:
  • Include different phrasings and vocabulary that match how users search.
  • Add keywords users might search for.
  • Include enough attributes. Avoid records with few records: exhaustive data improves matching for unpredictable queries.

Basic configuration

Algolia offers many settings that help you ensure relevant results for most queries. The following often have the most impact:
  • Synonyms. A varied vocabulary is essential to return relevant results. Users expect search to recognize industry terms and spelling variations. For more information, see Synonyms.
  • Typo tolerance. Avoid turning off typo tolerance globally since it can significantly reduce your search results because Algolia only returns exact matches. Instead, disable typo tolerance for specific attributes where precision matters, such as SKU or product codes.
  • Removing stop words. By removing common words like “the”, “a”, and “it”, Algolia needs to match fewer words in a query, thereby increasing the number of results. A user may receive no results when searching for “The Invisible Man” because the film’s title is “Invisible Man”. By removing “The” from the query, users can find the movie.
  • Ignoring plurals. This means that singular and plural forms of the same word can match, helping users find more results. Without this feature, a query with a singular form (“spy”) won’t find a record with the plural (“spies”). For more information, see ignorePlurals.

Attribute alignment

Empty or insufficient results can occur when your attributes don’t match your data model. For example, you may be using hierarchical category attributes like the following:
JSON
{
  "categories": {
    "lvl0": "Furniture",
    "lvl1": "Outdoor",
    "lvl2": "Tables"
  }
}
If your records don’t include these attributes, queries or facets that rely on them won’t return any results. To check your attributes:
  1. Go to the Algolia dashboard and select your Algolia application.
  2. On the left sidebar, select Search.
  3. Click Show more attributes to expand a record and look for the referenced attribute. For example, categories.
  4. If the attribute is missing, either update your dataset to include it or adjust your configuration to match available attributes.

Analytics

Regularly reviewing your analytics reports helps you analyze your incoming queries and think about getting better results. By looking at your top 10 queries, the most popular words and phrases, and perhaps most importantly, which searches return no results, you can make intelligent choices about your content, search, and index settings.

Advanced settings to increase results

Algolia offers some settings explicitly designed to resolve insufficient results.

Remove words when no results are found

This technique only works with multi-word queries.
The general idea is that if the initial query doesn’t return any results, Algolia removes one of the words from the query and reruns the search. Algolia continues removing words until it finds results or runs out of words to remove. For more information, see:

Match individual words

This technique only works with multi-word queries.
By default, Algolia returns matches that contain all a query’s words:
"big hamster wheel" => "big" AND "hamster" AND "wheel"
Every result must contain all three words. You can change this by allowing Algolia to return matches that contain only one of the words.
"big hamster wheel" => "big" OR "hamster" OR "wheel"
With this setting, Algolia can return a record that contains only one word from the query, such as big, even if it doesn’t include hamster or wheel. For more information, see optionalWords.
Changing this behavior will affect ranking._ Records that match all three words will be ranked higher than records with only two, and records with two words are higher than records with only one. This is due to the Words ranking criterion.

Create a list of optional words

If you create a list of optional words, Algolia runs the query with and without the optional words and merges the results. This “double-querying” increases the number of results. For example, say you provide online videos. If users query action video, you can make video an optional word. By doing this, you’re instructing Algolia to run two separate queries: action video and action and then combine them for the ranking. For more information, see:
Changing this behavior will affect ranking. Records that match with all words present are ranked higher than words without the optional words. This is due to the Words ranking criterion.
Prefix matching is central to Algolia’s as-you-type search experience since it enables matching records based on partial words. For example, Algolia returns records containing apricot when a user types a, ap, apr. Algolia doesn’t need to wait for a full-word match before displaying results. Prefix matching helps prevent insufficient results and can also return more relevant matches. By default, Algolia uses “prefix last” logic: only the last word in a query acts as a prefix, while other words must match exactly. For example, the query ja finds the sentence “Jack and Jill went up the hill”. But ja wat won’t. That’s because Algolia treats only the last term, wat, as a prefix. ja must match a complete word, which it doesn’t. To broaden results, configure Algolia to treat all query terms as prefixes. ja wat finds “Jack and Jill went up the hill” because ja matches “Jack”, and Algolia ignores wat. This doesn’t improve relevance. Use it if you want some randomness or have a large number of records where relevance matters less. Image search is one example where near matches can be useful. For more information, see: