It’s really hard to find the total amount of data when using coreseek for paging. I thought he would give me a method (function) or something to get it, but it turned out not to be the case.
First you need to know:
num_matches: The number of results currently returned, <= limit setting value.
max_matches: The maximum number of results returned, the default is 1000, the user can only see a maximum of 1000 search results. This is set in csft_mysql.conf.
total_found: Total number of results. The total number of documents in the index that meet the query criteria. This is included in the array in the returned results of your query. Of course, the premise is that you must set it before the query: $this->sc->SetArrayResult(true);
total: The maximum number of results returned, the value depends on the max_matches value and the total_found value. If the number of total_found exceeds max_matches, then total = max_matches, otherwise, total = total_found. This is also included in the array in the returned results of your query. Of course, the premise is that you must set it before the query: $this->sc->SetArrayResult(true);
In this way, you can do paging after understanding these attributes.
We should use the total in the return value to do the total paging data. Although this does not represent the real return value (when the return value is greater than max_matches, which is 1000, if the real return value is 2500, you can only get 1000).
The code is: