• Resolved sybrenwebmixnl

    (@sybrenwebmixnl)


    Hi there,

    We are using Search & Filter Pro for a filter page and want to track the search query using your plugin. We do see the search terms in the overview after adding the query parameter in the settings. But the average number of results is always 1.00, even though there are plenty results for the used terms.
    We also use AJAX to update the search form/results, but switching AJAX off didn’t make any difference.

    Any idea what might be causing this? Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Cornel Raiu

    (@cornelraiu-1)

    Hi @sybrenwebmixnl ,

    Thanks for reaching out.

    Unfortunately, I am not familiar with that plugin and given the fact that it’s a pro/paid plugin I cannot look at it to provide a solution.

    I am not sure how they process the database queries and what is the information they send back on the global $wp_query->found_posts. By looking at your message, it looks like they always return 1 on that so my plugin cannot know what is the actual number of posts.

    I looked in here: https://searchandfilter.com/documentation/action-filter-reference/ and there is this action do_action('search_filter_query_posts', 96); which looks of potential interest to what you are trying to achieve. But without looking at their code, it’s impossible for me to see what happens under the hood.

    I will try to get my hands on the plugin and test it on a clean WordPress install with only Search Analytics and the Search & Filter Pro to see if I can come up with an easy solution.

    I am way underway with the V2 of the plugin which will be a complete rewrite and that will allow other plugin/theme developers to develop addons for my plugin so then more integrations will be done.

    I will try to have a look at it sometimes this week.

    Thanks!

    Thread Starter sybrenwebmixnl

    (@sybrenwebmixnl)

    Hi @cornelraiu-1 ,

    Thanks for your reply!

    The found_posts function does seem to return the correct amount of posts in our template. I’m not sure though either how Search Filter Pro handles this. I will look into it myself once more as well to see if I can figure out what happens.

    Thanks for the effort and for looking into this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘‘Average no. of results’ not correct’ is closed to new replies.