0

Are advanced search operators supported by the SxA out of the box search components? If so, where can I find documentation on the syntax?

AND, OR, Exclude and "exact match" is what I am looking for, nothing more sophisticated than that.

2

The SXA search renderings don't allow to modify the query on such a low level. If you would like to modify the query which is built you need to override SearchService. It shouldn't be hard to do that as this service is registered in the DI container, but modifying SXA queries might not be the best idea because:

  • modifying the query might break SXA logic - e.g.: in geo-search queries we expect certain data to be returned
  • when using boosting the query need to have certain syntax and specific set of conditions - changing that might break boosted order of results
  • modifications to the query might break Search Box logic - search box is looking for content in the AggregatedContent computed field

I can provide a few more examples of what can go wrong if you will modify the query build in SXA.

  • I hear you. Can you expand on why modifying SXA queries might not be the best idea? What drawbacks/pitfalls you envisage? – Pedro Fonseca Sep 3 at 22:15
  • 1
    @PedroFonseca I've updated my comment with few examples. – Dawid Rutkowski Sep 5 at 7:34
  • Excellent Dawid. Thanks. – Pedro Fonseca Sep 5 at 10:29

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.