Wrong number of found Items in DropDown List

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Wrong number of found Items in DropDown List

This topic contains 7 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 1 month, 3 weeks ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #40389
    Peter Sippel
    Peter Sippel
    Participant

    Hi. 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. Peter

    Attachments:
    You must be logged in to view attached files.
    #40404
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi 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.

    Best,
    Ernest Marcinko

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


    #40410
    Peter Sippel
    Peter Sippel
    Participant

    Hi 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
    Peter

    #40425
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Oh 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> results

    See this screenshot where to find these settings.

    Best,
    Ernest Marcinko

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


    #40440
    Peter Sippel
    Peter Sippel
    Participant

    So the workaround it is to remove the information completely ?

    #40443
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    I’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.

    Best,
    Ernest Marcinko

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


    #40457
    Peter Sippel
    Peter Sippel
    Participant

    OK understood. I will check the different options then.
    Thanks. Peter.
    * Still a great plugin and great support *

    #40463
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thank you very much Peter 🙂

    Best,
    Ernest Marcinko

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


Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.