Thanks for getting back Chris/Mikko. I do not have any relevanssi plugin filters. I am using Searchautocomplete plugin(https://en-ca.www.ads-software.com/plugins/search-autocomplete/) which has ability to integrate with Relevanssi.
Here is the relevant code I believe which is using relevanssi_do_query:
public function acCallback() {
global $wpdb,
$query,
$wp_query;
$resultsPosts = array();
$resultsTerms = array();
$term = sanitize_text_field( $_GET['term'] );
if ( count( $this->options['autocomplete_posttypes'] ) > 0 ) {
<strong>if ( ( function_exists( 'relevanssi_do_query' ) && ( $this->options['autocomplete_relevanssi'] !== 'false' ) ) ) </strong>{
$query->query_vars['s'] = $term;
$query->query_vars['posts_per_page'] = $this->options['autocomplete_numrows'];
$query->query_vars['post_type'] = $this->options['autocomplete_posttypes'];
$query->query_vars['post_status'] = 'publish';
$query->query_vars['paged'] = 0;
$query->is_admin = $wp_query->is_admin;
relevanssi_do_query( $query );
$tempPosts = $query->posts;
} else {
$tempPosts = get_posts( array(
'suppress_filters' => false,
's' => $term,
'numberposts' => $this->options['autocomplete_numrows'],
'post_type' => $this->options['autocomplete_posttypes'],
) );
}
foreach ( $tempPosts as $post ) {
$tempObject = array(
'id' => $post->ID,
'type' => 'post',
'taxonomy' => null,
'postType' => $post->post_type
);
Any quick thoughts?