Skip to content

Commit

Permalink
ES: remove option for index basename
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Apr 8, 2024
1 parent 10aa586 commit 9c0a948
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion default.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion woudc_data_registry/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
1 change: 0 additions & 1 deletion woudc_data_registry/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
7 changes: 2 additions & 5 deletions woudc_data_registry/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand All @@ -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"""
Expand Down

0 comments on commit 9c0a948

Please sign in to comment.