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.

1 Answer 1

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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