From 9c0a948571848c60d9d195e22d7cf8870b6698c8 Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Mon, 8 Apr 2024 15:12:24 -0400 Subject: [PATCH] ES: remove option for index basename --- default.env | 1 - woudc_data_registry/config.py | 1 - woudc_data_registry/models.py | 1 - woudc_data_registry/search.py | 7 ++----- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/default.env b/default.env index 5964ff6..345a61b 100644 --- a/default.env +++ b/default.env @@ -20,7 +20,6 @@ export WDR_DB_NAME=test.db ## search index configuration export WDR_SEARCH_TYPE=elasticsearch -export WDR_SEARCH_INDEX_BASENAME=woudc-data-registry export WDR_SEARCH_URL=http://username:password@localhost:9200/ ## waf configuration diff --git a/woudc_data_registry/config.py b/woudc_data_registry/config.py index 89678c4..c5e93e4 100644 --- a/woudc_data_registry/config.py +++ b/woudc_data_registry/config.py @@ -63,7 +63,6 @@ WDR_DB_PASSWORD = os.getenv('WDR_DB_PASSWORD') WDR_DB_NAME = os.getenv('WDR_DB_NAME') WDR_SEARCH_TYPE = os.getenv('WDR_SEARCH_TYPE', 'elasticsearch') -WDR_SEARCH_INDEX_BASENAME = os.getenv('WDR_SEARCH_INDEX_BASENAME') WDR_SEARCH_URL = os.getenv('WDR_SEARCH_URL') WDR_WAF_BASEDIR = os.getenv('WDR_WAF_BASEDIR') WDR_WAF_BASEURL = os.getenv('WDR_WAF_BASEURL', 'https://woudc.org/archive') diff --git a/woudc_data_registry/models.py b/woudc_data_registry/models.py index 2faab6d..af1cb75 100644 --- a/woudc_data_registry/models.py +++ b/woudc_data_registry/models.py @@ -1952,7 +1952,6 @@ def show_config(ctx): 'WDR_DB_PASSWORD', 'WDR_DB_NAME', 'WDR_SEARCH_TYPE', - 'WDR_SEARCH_INDEX_BASENAME', 'WDR_SEARCH_URL', 'WDR_WAF_BASEDIR', 'WDR_WAF_BASEURL', diff --git a/woudc_data_registry/search.py b/woudc_data_registry/search.py index 4559a0d..e6c408f 100644 --- a/woudc_data_registry/search.py +++ b/woudc_data_registry/search.py @@ -1062,7 +1062,7 @@ def __init__(self): self.type = config.WDR_SEARCH_TYPE self.url = config.WDR_SEARCH_URL - self.index_basename = config.WDR_SEARCH_INDEX_BASENAME + self.index_basename = 'woudc-data-registry' LOGGER.debug('Connecting to Elasticsearch') @@ -1078,10 +1078,7 @@ def generate_index_name(self, index_name): :returns: fully qualified index name """ - if self.index_basename is not None: - return f'{self.index_basename}.{index_name}' - - return index_name + return f'{self.index_basename}.{index_name}' def create(self): """create search indexes"""