Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Wrong number of found Items in DropDown List
- This topic has 7 replies, 2 voices, and was last updated 3 years, 5 months ago by
Ernest Marcinko.
-
AuthorPosts
-
December 5, 2022 at 12:16 pm #40389
Peter Sippel
ParticipantHi. there is a strange behaviour of Ajax Search Pro DropDown List. It increases the number of found items after scrolling, but the original number seems to be correct and it only shows these. When I go to the end it says – for example – 43 items of 45.
Please see the short screen clip I have attached.
Regards. PeterDecember 5, 2022 at 2:42 pm #40404Ernest Marcinko
KeymasterHi Peter,
This usually happens when a custom code is being used either to change some query arguments or other aspects of the results list.
There are other special cases too, when the plugin changes the final results list count during the post-process, which obviously is not known up until the very last batch of results is processed – so there is a minor difference in the intially anticipated and the actualy results list.
The results are definitely correct, you don’t need to worry about that, it is only the counter at fault. If you happen to use any custom code in relation to the plugin or the search in general, that can explain the minor difference of the anticipaged and the actual results count.December 5, 2022 at 5:51 pm #40410Peter Sippel
ParticipantHi Ernest,
I’m using the code you have suggested here: https://wp-dreams.com/forums/topic/show-document-related-posts/
This is not a critical issue, but the wrong count is confusing…Regards
PeterDecember 6, 2022 at 10:48 am #40425Ernest Marcinko
KeymasterOh I remember now. That is the cause of it then. The number results and the actual results array is modified after the counter is set and at that point of execution there is no way of “resetting” it, as it has to be fetched during the actual search query. The only way around this is either not using the information header feature, or changing the text to not to include the overall number.
For the box with the phrase:
Results for <strong>{phrase}</strong> (<strong>{results_count}</strong>and for the box without the phrase:
Displaying <strong>{results_count}</strong> resultsSee this screenshot where to find these settings.
December 6, 2022 at 2:50 pm #40440Peter Sippel
ParticipantSo the workaround it is to remove the information completely ?
December 6, 2022 at 3:20 pm #40443Ernest Marcinko
KeymasterI’m afraid yes – that or remove the custom code regarding the attachments, which shows the related posts.
I have looked through the source code to see if there is any way to make this happen, but there is simply no way to account for the changes in the results list during the post process. To be able to do that, I would have to change the plugin code to process all of the results all at once, then count how many there are actually left when everything is finished – but as simple as it sounds, that is the worst possible thing to do. The search performance would drop drastically and the server load will increase by a lot, because everything is processed all at once.
December 7, 2022 at 11:51 am #40457Peter Sippel
ParticipantOK understood. I will check the different options then.
Thanks. Peter.
* Still a great plugin and great support *December 8, 2022 at 1:09 pm #40463Ernest Marcinko
KeymasterThank you very much Peter 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.