• Resolved avalanchedigital

    (@avalanchedigital)


    Hi there,

    Thanks for an excellent plugin.

    Is there a way to access Relevanssi User Searches (Common Queries specifically) without making a custom SQL Query?

    Many thanks.

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

    (@msaari)

    relevanssi_date_queries( $days, $title, $version ) generates the HTML code for the display. $days is the number of days of results to show, $title is the element heading and $version is either good for hits or bad for misses.

    This echoes out the results, so if you want to use it for something else, you need to capture it with an output buffer:

    ob_start();
    relevanssi_date_queries( 7, 'title', 'good' );
    $content = ob_get_contents();
    ob_end_clean();

    Now you have the most common queries for the past 7 days in $content. It’s a HTML table formatted for the User searches page, so you may need to clean it up a bit.

    Thread Starter avalanchedigital

    (@avalanchedigital)

    That is fantastic, thanks Mikko. Have a good day sir.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Accessing Relevanssi User Searches programatically’ is closed to new replies.