0

I want to know the best practice in using Item Queries and Search scope.

When should i use Item queries and when to use search scope as both of them is used in building queries

Any advise?

1 Answer 1

3

The two features are similar in that they make use of the Query Builder field type, and are used in searching for items by SXA.


Item Queries is used by list components such as the following:

  • Archive
  • Link List
  • Page List
  • Tags
  • ...

You can create custom queries under Settings > Item Queries, which will be bundled up with queries that come OOTB. You can also code a custom one like here from Richard Seal.

On the Page List you can see the query configured using the Source Type parameter. enter image description here


Search Scope is used by other search enabled components which all get wired together using a common search signature. You can scope search in the following ways:

  • Globally for the tenant on the Settings item because it inherits from the _Search Criteria template.
  • Locally for the page because it inherits from _Page Search Scope.
  • At a component level on the Search Results component.

On the Search Results component you can see the scope configured using the Search Scope parameter.

enter image description here

On the page you can configure the scope under the Search Criteria section.

enter image description here

On the Settings item you can configure the scope under Search Criteria section.

enter image description here


Note: Something I am not clear on is whether the Item Queries acknowledge the scope defined under Settings or on the page.

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.