Adding attributes to Wordpress InstantSearch

Hi,

I have pushed a custom field to Algolia and can see the data in the dashboard. I have also amended the autocomplete search to feature this snippet within search results, but I can’t work out how to do the same in InstantSearch results.

In my autocomplete file I added the following to allow me to use the data in my template:

attributesToSnippet: [ 'searchDescription' ]

Is there something similar required for InstantSearch to get the data available to use within my template?

1 Like

Hi @jack,

You will need to update your templates to show that new field.

Documentation about customizing the search page is available here: https://community.algolia.com/wordpress/customize-search-page.html#algolia-search

You can copy paste the following logic: https://github.com/algolia/algoliasearch-wordpress/blob/master/templates/instantsearch.php#L34

Let me know if that helps,

I have added this code but the information still isn’t appearing. Is there anything I need to add similar to the attributesToSnippet array to make the data available in my template? Do I need to add this attribute somewhere in the dashboard first or will Algolia pull all data out automatically?