Pagination with Answers Core

Hello,

I am attempting to retrieve 3 results back for a vertical search query using Answers Core and then get the next 3 on a subsequent call.

        const vSearchResults = await core.verticalSearch({
            query: '',
            verticalKey: 'products',
            retrieveFacets: true,
            limit: 3,
            facets
        })

Is there an easy way to do this?

Thanks.

Hi Aaron, welcome to the community! You can use the offset property to paginate, which can be found here, https://github.com/yext/answers-core/blob/master/docs/answers-core.verticalsearchrequest.md.

You can use this property in combination with the resultsCount from the VerticalSearchResponse to paginate.

1 Like

This is what I was looking for, thanks!