Rails - Some pages are not returned when making a request

Hello all,

I have a specific issue. When I am making a request to index our blog_post page type, sometimes some of the pages are missing from the response. The pattern tends to be that when we add a new blog_post page and publish it, one or more of the other blog_post pages are not included in the response. We can sometimes work around this by unpublishing and republishing the blog_post that is not in the response. However, this does not always work. Any ideas? Do you think this could be possibly be a bug on Prismic's end?

The request currently looks like this:

 api = Prismic.api(URL, TOKEN)

@items = api.query(Prismic::Predicates.at('document.type', 'blog_post'))
            .map { |i| i if i['blog_post.published_to_blog']&.value }
            .sort_by {|i| i.first_publication_date }

I was wondering if anyone has experienced the same thing and can help me!

Many thanks in advance!

Hi Zac,

Welcome to the Prismic community,

We currently don't have any general issues related to this matter, but I will keep this issue open to see if other users have such an issue.

Also, it would be cool to if you could provide a screen recording of the issue; for example, once you have missing content, please visit the API browser and make a query that showcases the missing to content in a screen recording before unpublish/publish again.

Looking forward for that,

I've checked my team, and it seems this issue can be related to pagination.
Meaning that you might need to increase the number of Items returned (20 items by default).

Another way would be to run multiple queries the fetch the following pages.
You can learn more about pagination in this document.

Please let us know if that helps solve the issue.

Here is the documentation for pagination w/ Ruby.

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