Search.PerformSearch in Knowledge Center 12

I am using the API documentation for Tridion docs 13, but I am using Knowledge Center 12. About Search.PerformSearch, it says that results are no longer cached and the caller has to manage retrieving results in chunks. I'm guessing that what I am seeing is the old behavior.

If I request 0 hits, it returns the number of hits, without the results. But, if I request 1000, it returns the first 1000, over and over, rather than retrieving the next chunk.

If I request all of the hits, it returns them all in that call, e.g. PerformSearch(query, 3214, out result), returns 3214 hits.

How can I retrieve results in chunks? Or, can I? 

 

Parents
  • As Raf described, there's no way -- using the API alone -- to chunk the results (though you can chunk the subsequent requests for metadata). If you suspect the results will be limited (the 3,214 you used in your example), I would just get the results for everything. However, I have had use cases where I expect large results from a search (in the hundreds of thousands). For these use cases, I use a query based on the CREATED-ON or MODIFIED-ON date-times, and run run my query by a given set of dates (for example, one month at a time). This allows for a certain sense of enforced chunking. My code makes iterative calls to the search function to collect the results for each date-time span.
Reply
  • As Raf described, there's no way -- using the API alone -- to chunk the results (though you can chunk the subsequent requests for metadata). If you suspect the results will be limited (the 3,214 you used in your example), I would just get the results for everything. However, I have had use cases where I expect large results from a search (in the hundreds of thousands). For these use cases, I use a query based on the CREATED-ON or MODIFIED-ON date-times, and run run my query by a given set of dates (for example, one month at a time). This allows for a certain sense of enforced chunking. My code makes iterative calls to the search function to collect the results for each date-time span.
Children