• I have some confusion over user query logging, because it doesn’t seem to work as I have it currently set.

    I have checked the box to enable “keep a log of user queries” because in the documentation it says this:
    “Logs are necessary for the Did you mean function to work […]”

    And I DO want the “did you mean” to work…..however, even though I have excluded myself (and 2 other users) in the list of excluded users, it is still logging our back-end searches.

    We have a LOT of posts (thousands) so when we need to update one we go to the list of all Posts and enter into the search box at the upper right a single word that we’re certain is in the title and it does indeed find the Post, but we see the same searches in our daily reports….this is a frequent occurrence and it’s really messing with our search reports.

    Is there another way to (for example) exclude ALL searches done via the WP back-end and ONLY record searches done from the front end? This would then record only visitor searches not User searches because my Users only use the search function while logged into the back-end.

    Thanks for any advice you can offer, we love the Plugin but just don’t want user searches in our results, and don’t want to lose the “did you mean” function.

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

    (@msaari)

    I can’t reproduce this issue on my site: if I exclude my username from the logs, it also applies to backend searches.

    You can do this:

    add_filter( 'relevanssi_ok_to_log', function( $ok ) {
        if ( isset( $_REQUEST['m'] ) ) {
            $ok = false;
        }
        return $ok;
    } );
    

    This makes it so that when the m parameter is set in the search, the search is not logged. This parameter is generally not used in the front-end search, but is set in the backend posts search.

    Thread Starter TrishaM

    (@trisham)

    Thank you so much, Mikko! I deeply appreciate this, I’ll implement it today and see if it helps, I anticipate success! I’ll be sure to post back my results in another day or two. ??

    XO
    Trisha

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘User query logging not working?’ is closed to new replies.