• Hi,

    Is it possible to show stats of search term when and only when there are no results?

    So the user can see if the term is searched for a lot last week/month…preferably fuzzy search?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mikko Saari

    (@msaari)

    I’m not sure I understand what you’re asking for here, but given the stats are in a database table and freely accessible, I’d say yes. It’s just a question of figuring out what to query from the database.

    Thread Starter stijndemulder

    (@stijndemulder)

    I would want it to show how “popular” a (fuzzy) search query is in the last week/month (when no results available).

    But you need a custom query if I interpret your answer correctly.

    Plugin Author Mikko Saari

    (@msaari)

    Yes, a custom query is needed. All the search logs are in wp_relevanssi_log database table. The table structure is simple: you can find the search query in the query column and the query time in time.

    To see how many times a search query is made within last two weeks, you can use this:

    SELECT COUNT(*) FROM wp_relevanssi_log WHERE query = 'search query' AND time > DATE_SUB(curdate(), INTERVAL 2 WEEK)
    Thread Starter stijndemulder

    (@stijndemulder)

    OK, great! Is it possible to make this “fuzzy”?

    Plugin Author Mikko Saari

    (@msaari)

    Instead of query = 'search query' you can do a LIKE query, for example. There are lots of options there.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Show stats when nothing found’ is closed to new replies.