cancel
Showing results for 
Search instead for 
Did you mean: 

pagination with search

satish_kandi
Explorer
0 Kudos

Hi,

We are trying to paginate search results. $top works fine with the search api but when we use $skip, the system generates an error.

Thanks,

Satish

Message was edited by: Ruediger Mueller

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Satish,

To go to the next page of search results, use the $skiptoken value at the bottom of the search results. This will go to the next page of search results. Indeed $skip is not supported for this endpoint as the error message indicates.

Thanks,

Bo

satish_kandi
Explorer
0 Kudos

Thanks Bo.

Can we configure the page size(the number of search results returned per call)?

Satish

0 Kudos

Hi Satish,

Not really. You can still use the $top query parameters to return fewer results, but then you won't get a $skiptoken value for the next set.

Bo

satish_kandi
Explorer
0 Kudos

Thanks Bo.

Search results always don't return a consistent number of results if it has __next url at the bottom of the results. I thought the number of results is fixed at 20, but looks like this is not the case. In one example call(https://jam8.sapjam.com/api/v1/OData/Search?Query=) it returns 18 and a next url, which inturn returns 4.

Can you please clarify?

Thanks,

Satish

0 Kudos

Satish,

It is not a paginated api, but a stream api, so you need to just call the url with the $skiptoken to get more results. The technical implementation reason for this is due to filtering of results for security reasons. Are you trying to paginate this on your client side rather than work with a stream (next page/previous page) style search?

Thanks,

Bo

satish_kandi
Explorer
0 Kudos

Yes, Pepsi wants to display the results in paginated fashion. Is this achievable?

Also, the number of results was not consistent. It returns 18 results in one call and after using skiptoken fetches the next four.

Thanks,

Satish

0 Kudos

Right, so you would need to keep calling until you have enough results to fill your "page". Is the next call fetching 4 because there are no further results? What is the next set after? (you call tell by a further $skiptoken link at the end of the response in the result returning 4).

Bo

Answers (0)