+ Reply to Thread
Results 1 to 4 of 4
-
05-20-2012 10:05 PM #1
Pagination issue with standard query?
Hi, In the past I was able to generate my pages by dividing TotalRecordsFound by the limit to determine how many pages were needed. Now if I send a request of lets say a limit of 10 for the query "Automotive+Belts" I see in total that there are 62 results. With a page limit of 10, we need 7 pages. Browsing the pages, everything is correct with sorting etc. However once I get to page 6 I am told there are now 100 results. If I have sorting enabled, the duplicate results are also not sorted.
From the api request: (using standard query)
Another odd part: If I change my script to use extended queries and everything works properly and only the results requested are returned.Code:"page":1,"limit":10,"totalRecords":10,"totalRecordsAvailable":62,"totalRecordsFound":62, "page":5,"limit":10,"totalRecords":10,"totalRecordsAvailable":62,"totalRecordsFound":62, "page":6,"limit":10,"totalRecords":10,"totalRecordsAvailable":100,"totalRecordsFound":1020, "page":7,"limit":10,"totalRecords":10,"totalRecordsAvailable":100,"totalRecordsFound":1020 "page":8,"limit":10,"totalRecords":10,"totalRecordsAvailable":100,"totalRecordsFound":1020
From the api request: (using extended query)
Code:"page":1,"limit":10,"totalRecords":10,"totalRecordsAvailable":62,"totalRecordsFound":62 "page":5,"limit":10,"totalRecords":10,"totalRecordsAvailable":62,"totalRecordsFound":62 "page":6,"limit":10,"totalRecords":10,"totalRecordsAvailable":62,"totalRecordsFound":62 "page":7,"limit":10,"totalRecords":2,"totalRecordsAvailable":62,"totalRecordsFound":62
What's happening exactly? Should I be using only extended queries if I am returning detailed paginated results? If not, How can I determine the last result to display and limit it to those results using just a standard query? Thanks!Last edited by Strykerraven; 05-20-2012 at 11:11 PM.
-
05-21-2012 08:07 AM #2
The standand query runs additional related queries to find more related results. In your example, from pages 1-5, it does not run the related queries because it has enough results. After page 5, it runs the other queries and add them to the results. I'll look into this further and figure out how to prevent this from happening in the standard query. With the extended query, you will only get what is returned from the query that you send to it.
-
05-21-2012 08:10 AM #3
To add to that, extended queries are usually less relevant than our standard queries as well.
-
05-21-2012 01:29 PM #4
Thanks for the replies and information. Ya I only tested extended queries a little to see how the pagination would behave. It would be preferred to stick with standard queries if I can.
Update: Looking good! I am getting more results overall for my most of my non-broad test terms. Pagination is working correctly using standard queries.
Last edited by Strykerraven; 05-26-2012 at 08:05 PM. Reason: Update

Reply With Quote