I am using sxa sitecore 9.3, my requirement is to get search result on the basis of sxa tags on the pages, for which I have applied query and rule in search scope. But the tag result is not accurate, event after doing indexing several time. The pages which don't have the tag "Energy Managment" is also coming up in the search result.

This is my search scope enter image description here

[![Page on which the search result need to be displayed][2]][2]

This is my main page to show result on the basis of this filed value [2]: https://i.stack.imgur.com/jwSu9.png

Any suggestion or other approach is appreciated. Thanks

  • What is your exact requirement? As you are using the tags for boosting and not scoping it is possible to have results that do not match the boost rule. – Gatogordo Sep 3 '20 at 8:15
  • @Gatogordo My requirement is to have a search result based on the field value in my current page, which is "Energy management" here, and the page template in search query which is having this "Energy Management" as tag selected under tagging section should appear in search result. – Tabbuu Sep 3 '20 at 8:23
  • As @Gatogordo has written, boosting will not scope the results. It will just try to boost certain results (put them at first). – Dawid Rutkowski Sep 3 '20 at 8:24

If you want to limit the results of your search, you need to use the scope and not the boost as that will not limit (just boost). So you need to add the tag requirement to the scope where you now only have the template.

You might be able to use the out-of-the-box SXA tokens in the search scope to match your needs. Check out the documentation here: https://doc.sitecore.com/users/sxa/93/sitecore-experience-accelerator/en/extend-search.html#UUID-3cbc7b12-9aed-f7d2-cd98-fcca239042ee_id__Extend_data_source_body

If the oob stuff doesn't get you what you need, you can always extend the tokens with a custom one. You can check out my blog to see how that can be done: https://ggullentops.blogspot.com/2019/01/extending-sxa-search-query-tokens.html This way you can really match the scope to anything you like.

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.