Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

Ngram index for partial matches

Describes the Ngram index for partial matches in Optimizely Configured Commerce.

When your customers search, they want to see results when there is a partial match of a product or manufacturer number.

With Ngram Indexing enabled in Optimizely Configured Commerce, searches for partial matches that meet the character lengths of the minimum through maximum ngram length will return results for products with the entered search string within their product number or manufacturer item.

Search will allow ignoring of non-alphanumeric characters. For example, if you set your Minimum Ngram Length to 6 and your Maximum Ngram Length to 7, search will return product ABC-00-1234 when your customers search for 001234 or 00-1234.

To enable Ngram indexing:

  1. Go to Administration > System > Settings in the Admin Console.
  2. Search for Enable Ngram Indexing.
  3. Set the toggle to Yes. If yes, product number and manufacturer item values will be be indexed using Ngram indexing. This will index segments of the values to return relevant results for partial matches. For example, if your product numbers are formatted like ABC12345 and your customers normally search for only the numeric segments, 12345 will be indexed and a search for it will return a match for the product. Values will be indexed both with special characters included and with them stripped out. Default is No.
  4. Enter a value in the Minimum Ngram Length field. This is the smallest number of characters of Ngram segments to be indexed. This should match the smallest search term length your customers would search for matches on product numbers. For performance reasons and to prevent erroneous matches, the minimum value is 3. Default is 5.
  5. Enter a value in the Maximum Ngram Length field. This is the largest number of characters of Ngram segments to be indexed. This should match the largest character length of your product numbers. For performance reasons and to prevent erroneous matches, the minimum value is 3. Default is 8.