Closed thepsalmist closed 2 months ago
Thanks for debugging this @thepsalmist. Will wait to hear from others but:
ELASTICSEARCH_INDEX_NAME_PREFIX
and INDEXES
need to be "mc_search
". Are these two settings used differently in the code? Do we need both or is one of them just a legacy setting from the pre-alias days?Thanks for debugging this @thepsalmist. Will wait to hear from others but:
- I think this should be a configurable environment variable. Updating alias name shouldn't require code change.
- This mean both
ELASTICSEARCH_INDEX_NAME_PREFIX
andINDEXES
need to be "mc_search
". Are these two settings used differently in the code? Do we need both or is one of them just a legacy setting from the pre-alias days?
INDEXES
is obsolete as per this
I wouldn't have thought it was meaningful to have it be a variable:
I thought we had decided it was OK to wire the index prefix into the story-indexer repo (ie; in the template files, and the importer)
If that's the case, where does another index come from?
Just to add my 3 cents on this:
ELASTICSEARCH_INDEX_NAME_PREFIX
in code (similar to how ESHOSTS
is a variable that defaults
to http://localhost:9200
if not explicitly set)environments
can connect to different ELASTICSEARCH_INDEX_NAME_PREFIX
(on different ESHOSTS
) e.g. test
uses mediacloud
(not sure if that needs to be updated or not) but I assume in dev
, one can connect to locally running ES without the need to connect to the production ES cluster.ESHOSTS
and ELASTICSEARCH_INDEX_NAME_PREFIX
form a "connection string" to Elasticsearch. If we allow one to be a variable, can't reason why the other needs to be a constant.On the above comments,
"index_patterns": "mc_search-*",
.This implies all our ES clusters in dev/staging/prod should have the same index patterns. We've previously stated that having a variable sourced from .env or config implies its subject to change. So I'll still to defining this on code.
Bugfix since the
ELASTICSEARCH_INDEX_NAME_PREFIX="mc_search-*"
exposed an index with the patternmc-search-*-*
that throws errors on search , not a valid index pattern remove INDEXES env variable, no longer used