Getting all documents for document type - Swiftype

I'm using Swiftype Site Search documentation to get all documents of a certain documentType. However, I was originally only able to get 50 documents. After going through the threads, I saw that I could add the query parameter per_page, which got capped at 200.

I have a little under 400 documents for this document type. Ideally I want to get everything in one call but I don't mind paging. I tried paging as seen in the public search API but that didn't work. Perhaps I'm doing it wrong. The reason I am trying to do this is to sync data in swiftype with my database, so that I can then automate updates to the swiftype engine by referring to swiftype document's external_id.

This is an example endpoint:

https://api.swiftype.com/api/v1/engines/test_company/document_types/specs/documents.json?auth_token={authToken}&per_page=200

Have you fetched the subsequent pages?
Like:
&page=2

Amazing, thank you!

For future reference, what doc url did you use to resolve my question with?

It's documented here: Pagination | Swiftype Documentation

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.