Skip to content

Commit

Permalink
Update comments to reference opensearch
Browse files Browse the repository at this point in the history
Update comments to reference opensearch instead of elasticsearch
  • Loading branch information
ItIsJordan committed Jul 28, 2022
1 parent eb23368 commit ee06833
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions fixes/cleanup_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion hepdata/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def _(x):
ADMIN_EMAIL = '[email protected]'
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"

Expand Down
2 changes: 1 addition & 1 deletion hepdata/ext/opensearch/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down
2 changes: 1 addition & 1 deletion hepdata/ext/opensearch/document_enhancers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hepdata/modules/records/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hepdata/modules/submission/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit ee06833

Please sign in to comment.