WebDevStudios / wp-search-with-algolia

Improve search on your site. Autocomplete is included, along with full control over look, feel and relevance.
https://wordpress.org/plugins/wp-search-with-algolia/
141 stars 54 forks source link

Docs: Using `algolia_search_params` as a `pre_get_posts` filter for the Algolia query. #376

Closed tw2113 closed 11 months ago

tw2113 commented 1 year ago

Making use of algolia_search_params allows for amending parameters used in the query for Algolia's search.

With it, you can amend the array of parameters, as documented at https://www.algolia.com/doc/api-reference/search-api-parameters/

Most specifically, you would want to make use of the filters parameter, which is documented at https://www.algolia.com/doc/api-reference/api-parameters/filters/

Make sure to note this detail:

You must declare for each attribute you use as a filter in attributesForFaceting, except for _tags, which are automatically considered as attributesForFaceting.

tw2113 commented 11 months ago

Moving to https://github.com/WebDevStudios/algolia-snippet-library/issues/1