Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Incorrect total result count
- This topic has 5 replies, 2 voices, and was last updated 1 year, 10 months ago by
Ernest Marcinko.
-
AuthorPosts
-
August 2, 2024 at 3:56 pm #48889
pbaines
ParticipantHi,
We’re seeing an Incorrect total result count, dependent on filters applied. I believe its {results_count_total}.
You’ll see from the video, we have well over 1000 pieces of content across the multisite, but the total count doesn’t seem to take this into account.
Is this a bug, or is there some way we can correct the count?
We’re using the index table engine if that helps.
Thanks,
Peter
August 5, 2024 at 9:36 am #48905Ernest Marcinko
KeymasterHi,
It is sort of a bug but also by intention. The plugin will try to calculate the possible results matched by the current filter setup. However on multisite it’s a bit different as it requires multiple blog switches and many other very resource heavy things.
So there is a “guessing” algorithm involved to help out the peformance, and it is unfortunately in these cases not very accurate. If the fully correct count was calculated, that would very likely bring down the website as it takes too much time. It sounds stupid I know, but it is what it is.August 5, 2024 at 9:53 am #48906pbaines
ParticipantThanks Earnest, I get that this search is already quite resource-heavy, so in some ways this does make sense. Please keep us posted if you do find another less resource-heavy method of getting this count, but in the meantime, we’ll look into other options.
August 5, 2024 at 9:54 am #48907Ernest Marcinko
KeymasterSure!
There is going to be a minor bugfix in the upcoming release today/tomorrow regards the results count, but I don’t think it will affect this.
August 5, 2024 at 10:58 am #48912pbaines
ParticipantThanks Earnest,
Just out of interest, would we be able to apply a temp fix for this using the javascript API and getting the result count?
My thoughts are…
Search, if load more button does not appear, results count message will read Showing X results
Search, if load more button does appear, results count message will read Showing first X results
I’ve been trying to tap in to the search using the javascript API but can’t seem to get a result count from anywhere. Perhaps you could point me in the right direction?
August 5, 2024 at 3:32 pm #48914Ernest Marcinko
KeymasterI’m afraid that wouldn’t work very well, because the text itself is changed via javascript, usually creating conflicts with that is not a good idea.
I would rather suggest using either one or the other variation.
-
AuthorPosts
- You must be logged in to reply to this topic.