1

I have a sxa search component, In the sxacontent_txm field in Solr have indexing value( ex: Test search - result). In the searchbox I tried input "Test search - result" it response 0 results. enter image description here

But I tried removed '-' and using "Test search result" it response have results.

I'm using Sitecore 9.2 - SXA 1.9

Is there any way I can fix this issue?

Please helps me!

Thank so much.

1

SXA has a custom pipeline called normalizeSearchPhrase which is removing all special characters from the search phrase. All the characters from this HashSet are removed:

new HashSet<string> { "-", "+", "&", "|", "!", "{", "}", "[", "]", "^", "(", ")", "~", ":", ";", "/", @"\", "?", @"""" }

So it actually doesn't matter if you will search with - or without, you should see results. Please check Solr settings and see how tokenization is configured as what you have in my opinion is related to the Solr configuration.

Unless you are using an older version of SXA. If yes, then please contact Sitecore Support as we had such issues in the past.

2
  • Thanks for your response @Dawid Rutkowski, After I has decompiled Dll: Sitecore.XA.Foundation.Search with JetBrains, I see the Escape Character Set: "+", "&", "|", "!", "{", "}", "[", "]", "^", "(", ")", "~", ":", ";", "/", "\\", "?", "\"". It's not include "-" I will try create custom pipeline remove special search characters. Thanks Again! Aug 3 at 8:41
  • 1
    Hi @Dawid Rutkowski, After I created custom a pipeline, it fixed this issue of SXA search result. Thank you so much! Aug 4 at 3:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.