From ee0683367a96f9ad23d13b62d93ffa97c2b88c38 Mon Sep 17 00:00:00 2001 From: Jordan <21129425+ItIsJordan@users.noreply.github.com> Date: Thu, 28 Jul 2022 15:32:11 +0100 Subject: [PATCH] Update comments to reference opensearch Update comments to reference opensearch instead of elasticsearch --- fixes/cleanup_index.py | 4 ++-- hepdata/config.py | 2 +- hepdata/ext/opensearch/api.py | 2 +- hepdata/ext/opensearch/document_enhancers.py | 2 +- hepdata/modules/records/utils/common.py | 2 +- hepdata/modules/submission/models.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fixes/cleanup_index.py b/fixes/cleanup_index.py index 4860c564..4ed6bc6c 100644 --- a/fixes/cleanup_index.py +++ b/fixes/cleanup_index.py @@ -21,13 +21,13 @@ @click.option('--batch', '-b', type=int, default=5, help='Number of hepsubmission entries to cleanup at a time.') def cleanup_index(batch): - """Clean up old datasubmission entries from elasticsearch""" + """Clean up old datasubmission entries from opensearch""" cleanup_index_all(batch=batch) @default_index def cleanup_index_all(index=None, batch=5, synchronous=False): - # Find entries in elasticsearch which are from previous versions of submissions and remove + # Find entries in opensearch which are from previous versions of submissions and remove # Get all finished HEPSubmission ids with version numbers less than the max # finished version by doing a left outer join of hepsubmission with itself h1 = aliased(HEPSubmission) diff --git a/hepdata/config.py b/hepdata/config.py index 815bfc6a..8ee4f6e0 100644 --- a/hepdata/config.py +++ b/hepdata/config.py @@ -324,7 +324,7 @@ def _(x): ADMIN_EMAIL = 'info@hepdata.net' SUBMISSION_FILE_NAME_PATTERN = 'HEPData-{}-v{}-yaml.zip' -# For ignoring URLLIB3 errors on the server where we use https for elastic search, +# For ignoring URLLIB3 errors on the server where we use https for opensearch, # but the certificate is generated on our side. PYTHONWARNINGS="ignore:Unverified HTTPS request" diff --git a/hepdata/ext/opensearch/api.py b/hepdata/ext/opensearch/api.py index dd068d5a..64ec40c4 100644 --- a/hepdata/ext/opensearch/api.py +++ b/hepdata/ext/opensearch/api.py @@ -564,7 +564,7 @@ def get_all_ids(index=None, id_field='recid', last_updated=None, latest_first=Fa """Get all record or inspire ids of publications in the search index :param index: name of index to use. - :param id_field: elasticsearch field to return. Should be 'recid' or 'inspire_id' + :param id_field: opensearch field to return. Should be 'recid' or 'inspire_id' :return: list of integer ids """ if id_field not in ('recid', 'inspire_id'): diff --git a/hepdata/ext/opensearch/document_enhancers.py b/hepdata/ext/opensearch/document_enhancers.py index 500f3aee..01fdd7ca 100644 --- a/hepdata/ext/opensearch/document_enhancers.py +++ b/hepdata/ext/opensearch/document_enhancers.py @@ -21,7 +21,7 @@ # waive the privileges and immunities granted to it by virtue of its status # as an Intergovernmental Organization or submit itself to any jurisdiction. -"""Enhancers for the document sent to elastic search """ +"""Enhancers for the document sent to opensearch """ import re import datetime import logging diff --git a/hepdata/modules/records/utils/common.py b/hepdata/modules/records/utils/common.py index 2046caca..45b9b807 100644 --- a/hepdata/modules/records/utils/common.py +++ b/hepdata/modules/records/utils/common.py @@ -218,7 +218,7 @@ def get_record_contents(recid, status=None): Tries to get record from Elasticsearch first. Failing that, it tries from the database. :param recid: Record ID to get. - :param status: Status of submission. If provided and not 'finished', will not check elasticsearch first. + :param status: Status of submission. If provided and not 'finished', will not check opensearch first. :return: a dictionary containing the record contents if the recid exists, None otherwise. """ record = None diff --git a/hepdata/modules/submission/models.py b/hepdata/modules/submission/models.py index 81a3059d..c8ca2007 100644 --- a/hepdata/modules/submission/models.py +++ b/hepdata/modules/submission/models.py @@ -79,7 +79,7 @@ class HEPSubmission(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) # publication_recid remains the same for each version of a submission - # and is used as the document id in elasticsearch and as the record id + # and is used as the document id in opensearch and as the record id publication_recid = db.Column(db.Integer) inspire_id = db.Column(db.String(128))