Good search practices - before release

This checklist describes LupaSearch recommendations to make the most of our engine and give the best search experience to your users.

Make sure to check this list before running LupaSearch in production.

Configure and generate autocomplete suggestion index

Why?

Autocomplete suggestions can improve the user experience of in-site search by making it faster, more accurate, and more user-friendly by helping the user to refine their search query and find what they are looking for faster.

How?

Create suggestion search index - a place to store all your generated suggestions.

Index list

New suggestion index

Setup which fields from your product feed can be included in autocomplete suggestions (for example, title) - this is done in suggestion search index mapping.

Suggestion mapping

Suggestion mapping publish

Once mapping is ready, generate your suggestions. This needs to done periodically, using dashboard or API.

Generate suggestions

Create suggestion search query. Select your suggestion index in environment dropdown and create new suggestion query from Search Queries list.

Suggestion query list

Suggestion query configuration

Links:

  • Configure your suggestion mapping in Index List;

  • Generate suggestions using API Docs.

Include category, description and other relevant fields in your query fields

In addition to product title, it is often useful to include category, description, tags and other relevant fields in your search query configuration's Query Fields.

Why?

Additional fields might contain useful information and can help to reduce the number of zero results queries.

How?

Include additional relevant fields in document import endpoints (or exported product feed) and add them into index mapping.

Usually, it makes sense to configure smaller relevance score for fields that might be less important for your domain or has a high likelihood of containing irrelevant information (like description), however exact values will depend on your domain specifics.

Recommended query fields

Make sure that all fields that you have selected in Query Fields configuration have their Mapping property set to text or text_keyword. This will tell LupaSearch to optimize these fields for querying operations.

Recommended query field mapping

Links

Include sku, product code fields in your query fields

Why?

Your search is often used not only by regular users, but by your store employees too. Often they expect to find products by their unique codes.

How?

Include product code fields in document import endpoints (or exported product feed), add them into index mapping and configure them in query fields.

Sku Query Fields

If you want to find products by partial sku or productCode matches, make sure to set text_keyword mapping type for these fields, and include them in Search Query configuration.

Sku mapping

Additionally, if searching by sku or productCode is especially popular in your store, consider adding these fields to suggestion index mapping to make them available in autocomplete options.

Sku suggestion mapping

Links

Include additional fields in autocomplete suggestions

Usually, autocomplete suggestion index mapping only includes product titles. However, it might be useful to add them

Why?

Autocomplete fields like category, brand, tag and so on can help users find what they are looking for much faster, especially when they do not have a specific product in mind.

How?

Add additional fields into suggestion search index mapping.

Category suggestions with boost

It is often useful to boost these fields, so that they would appear higher in the suggested autocomplete options list.

However, if you use facets in your suggestions, categories (or similar fields) will already be displayed with your suggestions and it might not be practical to duplicate these autocomplete results.

  • Configure your suggestion mapping in Mapping Configuration. Make sure to select suggestion index in the environment dropdown before following this link

Use matchType: all

Why?

Match type set to all ensures that search only matches all of the words in users search query phrase. Match type any would match any of the words in user's search query (while still keeping most relevant results at the top). This is especially important when using the query with alternative sort options (without using the relevance).

This might depend on your use case, but it is usually a good practice to keep match type set to all to guarantee that the vest

How?

Set match type to all in search query configuration:

Match type all

Currently, match type defaults to any, but this should change in the future versions.

Links

Enable Did You Mean (Spellcheck) and Similar Queries functionality

Why?

Spellcheck functionality automatically and saves user time resulting from unfortunate typos.

Similar queries functionality automatically suggests shorter search phrases if original multi-word query returned no results. This allows to suggest similar products, even if search results do not match user search query exactly.

How?

Enable Did You Mean (Spellcheck) and Similar Queries in search query configuration:

Spellcheck and similar queries

Similar queries and some of the did you mean functionality (like when there are results, but it is lower than configured threshold) needs additional support from your front-end integration to handle the new data. If you use LupaSearch plugin, it already handles this for you.

Links

  • Configure your queries in Query List;

  • Did you mean API and responses docs;

  • Similar query API and responses docs

If you use custom sort options, include default sort by relevance in your front-end integration

Why?

LupaSearch relevance score sorts search results by taking many different parameters into account. It is automatically adjusted to give users the best search experience.

If you override relevance sort with your own options (and use this option by default), this might result in lower quality search result ranking.

How?

Feel free to use other sort options (like sorting by name or price), but avoid using them as defaults.

For default searches (when user has no custom search option selected), do not include any sort options, or use special _relevance key.

If you still want to include other parameters together with relevance sorting, you can add multiple sort options, while using the special _relevance key. For example, the following Public Query would result in out of stock products being at the bottom, while still keeping relevance score for products with the same in_stock value.

const query = {
  searchText: "tv",
  limit: 5,
  sort: [
    {
      in_stock: "desc",
    },
    {
      _relevance: "desc",
    },
  ],
};

If you don't use any sort options with your query, default behavior is to sort by relevance, so there no need to change anything in this case.

Links

Good search practices - after release

Monitor zero result queries

Once your integration is live, LupaSearch dashboard analytics allows you to track a number of useful metrics, and Zero result queries is one of them. This metric displays the most frequent queries that returned zero results.

Zero result terms

You can use these stats to manage your query fields, add new synonyms or maybe even make decisions about including new products in your store.

Links

Add Synonyms for frequent zero result phrases

If in your Zero result queries you can see any words that should have been found (but the user has used an incorrect phrase or jargon), you can add such word or phrase to the list of manual synonyms.

Synonyms

Links