0

We are using Sitecore 9.3 SXA with solr. We have facet filter dropdown on the page for Title field which can contain special characters Ex:("Test™ (value)").

I can see the The value is encoded during search in the SXA EncodeFacetValue Pipeline to ("Test%E2%84%A2 %28value%29")

But in the Solr log I see the "%" got once again encoded to "%25" and the facet query value in the search url is "Test%25E2%2584%A2+%2528value%2529" which does not return any result.

localhost:8983/solr/test_sxa_master_index/select?q=topic_title_sm:("Test%25E2%2584%25A2+%2528value%2529")

If I copy the url and change "%25" to "%" it returns the result

localhost:8983/solr/test_sxa_master_index/select?q=topic_title_sm:("Test%E2%84%A2+%28value%29")

Not sure if I need to change some configuration in Solr or Sitecore side.

1

Did you use any custom SXA theme to achieve your search result? If yes then you need to try using the OOTB theme and check if the issue is still there.

Or to resolve this issue you can update below line in component-search-query.js (/sitecore/media library/Base Themes/SearchTheme/Scripts/component-search-query)

hashStr += key + "=" + encodeURIComponent(item).replace(/%7C/g, "|").replaceAll("%25", "%");

Just add replaceAll("%25", "%") in updateHash method, it will solve your issue.

2
  • Thanks Gaurav but this not related to the problem I have. The data that is being passed to search results API "/sxa/search/results" in the query-string is going correctly. I can see the actual value correctly in the EncodeFacetValue pipeline too. The problem is in the solr search url that I find in the solr log. What you mentioned is about how the selected search filter text gets updated in the current page url in the hash. Jun 28 at 20:21
  • Try to debug your javascript code in browser source tab then you get to know, what is flow and how things are forming, I faced the same issue mentioned by you but updating above script fixed issue for me. Jun 29 at 6:39

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.