Struggling with pagination within search/query.json

(Daniel Thompson) #1

I’m trying to grab the posts within a date interval from our discourse server using the API. I’m struggling quite a lot with pagination.

Firstly I tried using search.json but that limits us to 50 results:

I tried to use the paginated query instead (but page 2 and page 3 end up the same for some queries):

That’s odd because simpler queries appear to paginate correctly: (more_pages becomes null here, although we can fetch higher pages)

Is is possible to combine advanced search and pagination?

(Vinoth Kannan) #2

Second (3rd, 4th, etc.,) query string should look like below. & symbol instead of ?

not like this

(Jay Pfaffman) #3

I don’t know if it’ll help, but I wrote a little ruby program that will download all of a topic or category. (It doesn’t pay attention to dates, though.)

(Daniel Thompson) #4

Oops. Getting the links wrong is what made me believe discourse support pagination using page=X in the first place (my own bad conversion from curl to a web browser).

Perhaps I should have ask a more general question: If search/query.json has a grouped_search_result with more_posts set true, how do I get to see the additional posts?