0

Environment: Sitecore 9.3 & SXA 1.9

Scenario: I would like to get the first 10 items while using the search query builder. This is the query I am using +template:{25a72111-ea49-56e0-97ca-3247ffa9a569};sxa:TaggedWithAtLeastOneTagFromCurrentPage|SxaTags;sort:__smallcreateddate[desc].

I tried to use the custom tag in the query to get the rows (like this +custom:rows|10) but it didn't work. How to achieve this functionality? Thanks.

4
  • Did you try entering a number (eg. 10) in the Page Size parameter while utilizing this component as explained here amitkumarmca04.blogspot.com/2020/08/… Aug 26, 2021 at 15:41
  • @RamanGupta This is a custom component (VariantsController), and not extended from SXA Search Results component hence does not contains the Page Size parameter. That's why I would like to make it work using the search query builder.
    – PSS
    Aug 26, 2021 at 15:45
  • You can make your custom component paginable: ggullentops.blogspot.com/2018/12/… I can elaborate in an answer if that is an option for you. If that is not an option, please add more information about your non-working custom tag.
    – Gatogordo
    Aug 26, 2021 at 16:17
  • @Gatogordo by custom means trying to insert rows using +custom:rows|10. But as Michael mentioned it is not possible with query builder.
    – PSS
    Aug 27, 2021 at 7:28

1 Answer 1

2

The Query Builder field does not support specifying a page size or offset.

You can write your own code with the Content Search API where you first parse the Query Builder text and then add on the necessary calls to Take, Skip, Select to control what is returned.

Your Answer

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

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