Reply To: Search limits

#11839
Ernest Marcinko
Ernest Marcinko
Keymaster

Hi,

For the regular engine and the non-CPT search scripts the limit does not change anything at all. It’s basically just a number that tells where to stop the query, and cut the results list. In these cases there will be no difference in results, no matter how big or small the number is.

In one special case however this has an effect: Index table + Custom field filters

The index table in general works differently. It would be hard to explain the exact method, but basically there is a general limit set to 20 000 rows per search. After that this raw row data is processed and ordered multiple times, then cut at the user defined limit.

However if custom field filtering is introduced, it very much affects the performance of the query, and the general limit must be lowered. The exact calculation of it is 400xUser Limit. So in case of 10 results it’s 4000. Meaning that the after the search only the first 4000 raw keyword matches are considered. The lower the user limit is, the lower the number of the general matching gets. This is usually more than enough is every case I have ever seen, and affects the performance very positively.

Things to look out for
1. !!! Search cache !!! -> You have it enabled, and it does not automatically clear every time you save the plugin options. When experimenting, I highly recommend turning it off, otherwise you might get the same results every time for the same keyword.
2. Keyword logic -> This affects the search results greatly. A more restrictive logic will yield much less results. Using a more restrictive logic as primary, and a less restrictive as secondary usually is the best idea. However for the best performance I recommend using only a primary logic.
Example 1, AND primary, fill with OR: https://i.imgur.com/rYvxGyh.png
Example 2, AND primary, no secondary (better performance): https://i.imgur.com/65vTDsY.png
Example 3, AND exact + AND, very strict, very precise (lower performance): https://i.imgur.com/fXIbWuV.png

Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)