Search API Results Starting at Incorrect Index

I’ve noticed that some of my searches are returning results starting at an index offset that is different than the offset that I’ve specified with the start_index parameter, for example:

That search currently finds 75 total items, so I would have expected the response to start at the 58th item, and return only 17 items. It actually returns results starting at index offset 30 and includes 30 results, which is completely different from what I expected.

I’ve noticed this kind of behavior with other searches too.
Is this a bug, or does it work differently than I expected?

Hi Rob,

This looks like it’s an bug with the API - the start_index works as long as it’s a multiple of the items_per_page. So for example if you used a start_index of 60 it works. Thanks for spotting this - we’ll look to fix this as soon as possible.


1 Like

I’m not sure if this is a different manifestation of the same bug or something else but I don’t seem to be able to find any relationship between the start_index and items_per_page parameters and the results returned. In fact I’d say they are both ignored.

Example 1:

JSON results end with:


Example 2 (here using start_index as a multiple of items_per_page):

ends with:


I have found that to make it work, as previously mentioned, you have to use a multiple of number of items per page.
I maintain a page_no (starting at 0) and items_per_page variables.
I calculate the start_index as
page_no * items_per_page
so the 4th standard page has a start_index of 60 (3 * 20)

This seems to work for me