When your customers search, they want to see results when there is a partial match of a product or manufacturer number. Commerce Search provides Ngram Indexing to do so.
With Ngram Indexing enabled, searches for partial matches that meet the character lengths of the minimum through maximum ngram length return results for products with the entered search string within their product number or manufacturer item.
Commerce Search lets you ignore non-alphanumeric characters. For example, if you set your Minimum Ngram Length to 6 and your Maximum Ngram Length to 7, search returns product ABC-00-1234 when your customers search for 001234 or 00-1234.
Enable Ngram Indexing
- Go to Administration > Settings in the Admin Console.
- Search for Enable Ngram Indexing.
- Set the toggle to Yes. If yes, product number and manufacturer item values are indexed using ngram indexing. This indexes 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 are indexed, and a search for it returns a match for the product. Values are indexed both with special characters included and with them stripped out. The default is No.
- 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 that your customers would search for matches on product numbers. For performance reasons and to prevent erroneous matches, the minimum value is 3. The default is 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. The default is 8.
Please sign in to leave a comment.