You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having some challenges figuring out how to handle multiple indices for different environments and looking for some tips.
As index_name is a part of the configuration when using the Algoliax.Indexer macro the index name needs to be set at compile time. Often variables that can differ between environments are set as environment variables at startup/runtime as one would have a separate index for each environment.
For now I have used if(Mix.env() == :prod, do: :prod_index_name, else: :dev_index_name) which is fine for a while but when we need to introduce a staging environment which would have the same mix env as production.
I hoped there was a way to do this with environment variables but I cant see how as it is required at compile time.
One alternative would be to create one module per environment and use config to select between them but I hoped it would be a better way to handle it.
Does anyone use this library with multiple environments and different index names or have any tips of how to handle this?
Are there any plans to change this or would you consider changing how index_names can be provided to support using environment variables?
The text was updated successfully, but these errors were encountered:
Hi,
I'm having some challenges figuring out how to handle multiple indices for different environments and looking for some tips.
As
index_name
is a part of the configuration when using theAlgoliax.Indexer
macro the index name needs to be set at compile time. Often variables that can differ between environments are set as environment variables at startup/runtime as one would have a separate index for each environment.For now I have used
if(Mix.env() == :prod, do: :prod_index_name, else: :dev_index_name)
which is fine for a while but when we need to introduce a staging environment which would have the same mix env as production.I hoped there was a way to do this with environment variables but I cant see how as it is required at compile time.
One alternative would be to create one module per environment and use config to select between them but I hoped it would be a better way to handle it.
Does anyone use this library with multiple environments and different index names or have any tips of how to handle this?
Are there any plans to change this or would you consider changing how index_names can be provided to support using environment variables?
The text was updated successfully, but these errors were encountered: