Back to Kodaris

Operations Search: Partial Code Search 

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.

2866_partialcodesearch_image1.png

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.

2866_partialcodesearch_img2.png

What happens if there is no code match?

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.

2866_partialcodesearch_image3.png

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.

2866_partialcodesearch_image4.png

Adding Partial Code Search

The Rule

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.

2866_paritalcodesearch_5.png

Rule Type - preProcessing

  • This is the default. Can be set to “None” if needed.

Query - \b[\w-]{1,5}\b

  • This is the regular expression that dictates when the rule will be used. If the search string matches the regular expression, the rule will be processed.  For this example, paste it exactly like it is for the default function. If a change is needed, a developer can tweak this code to enact almost any kind of change to it.

Action - searchRule

  • This is the default. Cannot be changed.

Language Code - {your default code}

  • Usually your normal default language in use on your site. Would only change if you were using multilingual and needed a search rule for other languages.

Active - Yes

  • Yes or no. Yes if rule is in use.

Action Data - WILDCARD

  • The type of search action. Paste into the field exactly as seen here.

Adding Rule Details

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.

2866_partialcodesearch_image6.png

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.

2866_partialcodesearch_image7.png

Field - code_s_lower

  • This tells the system which field/s to look at when trying to find a partial code search match. You can add more fields than just the default field. Any field that is “searchable” can be added here. It is just a matter of knowing the right code to add. However, adding too many fields can defeat the purpose of “partial code search” and be a detriment to the search.
  • If you wish your searching on partial codes to be case sensitive, you can adjust the value to only add “code_s” instead. This will only return results that are case sensitive. This means if your code contains “ARM” and you search on “arm”, you will not find any matches on the term.

Wildcard - Yes

In this article