Hi @adrien99
Sounds like the autocomplete section is working just fine, but the search is being a bit too inclusive for what you’re trying to achieve here, which is exclusively indexing products for the instantsearch functionality.
Give the following a try, as this should set the searchable content to only be a post type of product
instead of all post types that are not excluded from search with their post type registration.
function wds_algolia_override_searchable_post_types( $searchable_posts ) {
return [ 'product' => 'product' ];
}
add_filter( 'algolia_searchable_post_types', 'wds_algolia_override_searchable_post_types' );
Once saved to your active theme’s functions.php file, you should be able to do a bulk re-index from the Search settings page and get your searchable posts index cleared out of everything except your product post type items.
Ok thanks, finaly i have just changed index name. It’s possible to filter only on the names of the products and not the content ?
Not quite following with that last part, are you referring to only which attributes on the objects are searched through?
You should be able to change the searchable attributes either through code samples which I can help point to documentation for, or you can remove the post_content from being a searchable attribute via your Algolia Dashboard.
Note that if you’re using the “Push settings” buttons in WP Search With Algolia, those will override settings managed directly from the Algolia Dashboard. Best to use one or the other.
Did you ever get this resolved @adrien99 ?