This document is created with the purpose to give an explanation of and setup for the Partial Code Search rule.
A partial code search is a Product Search rule that is added to match search terms to any part of a product code, and if it finds a match it will return those search results instead of the standard search results.
What are the results returned? If a site is set up for AI search, normally all search results will be returned by AI. However, with the partial code search rule turned on, any matching results will be returned with Text Search results instead of AI results. What does this mean? It means the results will only show the exact matches and not return the full 100 results that AI normally returns. If your site is not using AI search, then you are by default already using Text search. Text search normally already returns good results against product codes but if you want to enable the Partial Code search, you can further refine and enhance the results returned.
An example of the search results is shown below for “arm78”. You can see it returned 21 results and all the results have “arm78” in the product code.
The partial code search can be for any part of the product code. It does not need to be for the beginning. Using the same example I next searched for just “780”.
You can now see 19 results returned with all showing “780” somewhere inside the product code.
If there is no “match” on your partial code search to any product code, the results will “fall back” to your default search method. If that is AI search, then you will see AI results returned as shown in the image below. If your default is Text search, then you will see normal Text search results.
The limitations of the partial code search is really up to your own discretion. By default it is limited to matching only on product codes, but if you wish it to also match against other product data fields it can certainly do so. Also by default it is limited to a string of up to five values, as in the first example of “arm78”. If I search on “arm780” as shown below, the partial code search does not activate and normal AI results are returned. However, this “limitation” is also easily changed to any number, both higher and lower.
The partial code search is a “Product Search” rule and is added by navigating to Search > Tuning in the Operations Portal. Once there, on the Product Search Rules tab, add a search rule using the Add row at the bottom of the screen. Use the values below to add your partial code search rule.
Rule Type - preProcessing
Query - \b[\w-]{1,5}\b
Action - searchRule
Language Code - {your default code}
Active - Yes
Action Data - WILDCARD
After your new search rule is added in the previous step, you will need to add a little more information to the details screen under the rule.
Click the small icon shown in the image below to go to the details for the search rule.
Once you are on the Details screen for the rule, you can now fill out the “Field” and “Wildcard” columns. Use the values as indicated in the image below.
Field - code_s_lower
Wildcard - Yes