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/
138 stars 54 forks source link

Checkbox to stop auto-indexing on Development / Staging servers #419

Closed asha23 closed 1 month ago

asha23 commented 1 month ago

Is your feature request related to a problem? Please describe.

Dev and staging servers with the plugin enabled seem to index these sites

Describe the solution you'd like

The ability to turn off auto-indexing on these sites if needed - They were contaminating my search results with content from these dev/staging servers.

tw2113 commented 1 month ago

Good day @asha23

We would recommend checking out https://github.com/WebDevStudios/wp-search-with-algolia/wiki/Constants where we have some defined constants options available. Most specifically these:

ALGOLIA_APPLICATION_ID ALGOLIA_SEARCH_API_KEY ALGOLIA_API_KEY ALGOLIA_INDEX_NAME_PREFIX

You can use the constants to define the same values used on the settings page, via say your wp-config.php file, and each install would get their own values, from outside of the database.

At minimum, in case of having just one application in Algolia, We'd recommend setting the ALGOLIA_INDEX_NAME_PREFIX to say dev_ or staging_ instead of the default wp_. This would give each environment their own indexes and would prevent cross "pollution" of the content.

Alternatively, you could give each environment their own Application ID/Key sets and thus still prevent cross pollution, while still facilitating potential database content migrations.

Let us know if you have any questions about this, we'll answer as best we can.

asha23 commented 1 month ago

Fab. I'll give this a try. Many thanks.

tw2113 commented 1 month ago

Closing as a non-issue at the moment.