Separate Search Instance with Only Specific Custom Post Types

I want to use instantsearch.js for my default WordPress search, but I also want a separate search form that uses instantsearch.js to only search two specific custom post types.

I’m thinkging this can be accomplished by tweaking the instantsearch config on the separate search page. I’m not sure the best way to go about altering these settings on one specific page. Any help would be much appreciated!

I think I figured out the easiest way to accomplish this! I’m modifying the autocomplete config based on the page by utilizing the “algolia_autocomplete_config” filter. In this filter I am able to unset() the autocomplete sources I don’t need.

1 Like

Hi Adam!

I’m new to Algolia, and that is one of my first requirements - to have search “instances” specific to a few different custom post types.

Can you share the filter that you used for your example, did you additionally filter based on the page by its ID ? Let me know how well it worked.

I’m still evaluating if Algolia will work, as I have a lot of custom fields (ACF), taxonomy, and taxonomy synonyms I need to work into the search.

Thanks for any tips!