Escape Sepecial character from seaching

Vote:
 

Hi,

I'm trying exclude or escape secial character when we search the keyword without special character.

Our find index repository contains special character along with text, for example the trade mark symbol ®

Scenario:

My search and navigation repository contains trade mark symbol, but we may not expect the user to type in the trademark symbol on search.

Example

Serach repository Content : Product® Title

Search term: Product Title

With the above case I'm not getting results, So I need to programatically escape the trademark symbol when we search from the content, Also may not be able to remove the Trademark symbol from the repository.

Anyone have experienced the similer situations? any suggestions ?

Thanks in advance, 

Hari

 

#318958
Edited, Mar 14, 2024 13:31
Vote:
 

Hi Harinarayanan,

Although I have not specifically encountered this situation before, it may be worthwhile overriding the custom indexing, if you do this you can look to remove the special characters when the content is being indexed. The following section of the S&N documentation provides some information on custom indexing:

https://docs.developers.optimizely.com/digital-experience-platform/v1.1.0-search-and-navigation/docs/customizing-serialization

Another option might be to create an additional non-editable field on the variation that indexes the code without the special characters. So in your example, it would index "Product Title". Then if someone searches for "Product® Title", remove the special characters in the backend before perform the actual search, and use that "cleaned" query to search specifically on that custom field you added. If they do a search purely for "Product Title" this will be matched to the additional non-editable field.

Hope this helps.

Graham

#321457
May 03, 2024 8:33
Vote:
 

I will do it in two steps, Include a filed via conventions.

conventions.ForInstancesOf<YourPage>().IncludeField(x => x.SanitiseField()); //Sanitize your field where you want to do search.

Use sanitized field in your search.

#321770
May 09, 2024 14:57
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.