Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ezidapp/management/commands/opensearch-update.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
urllib3.disable_warnings(InsecureRequestWarning)
# end suppression of urllib3 InsecureRequestWarning

SPLIT_SIZE = 5
SPLIT_SIZE = 10
DB_PAGE_SIZE = 100

# run: python manage.py opensearch-update
Expand Down Expand Up @@ -57,7 +57,7 @@ def handle(self, *args, **options):
start_after_id = options['starting_id']
else:
start_after_id = 0

# Also adding additional filtering for additional criteria with a Q object that may be neutral or contain
# time-based criteria to limit number or results.

Expand Down Expand Up @@ -116,6 +116,7 @@ def _bulk_update_pair(identifier: SearchIdentifier) -> str:
def _do_bulk_update(string_parts: list) -> bool:
json_string = "\n".join(string_parts) + "\n" # must have a trailing newline

OpenSearchDoc.CLIENT.ping() # OpenSearch keepalive
response = OpenSearchDoc.CLIENT.bulk(body=json_string)

# Check the response
Expand Down
5 changes: 4 additions & 1 deletion impl/open_search_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ class OpenSearchDoc:
use_ssl=True,
verify_certs=True,
ssl_assert_hostname=False,
ssl_show_warn=False
ssl_show_warn=False,
timeout=30,
max_retries=3,
retry_on_timeout=True
)

def __init__(self, identifier: Identifier):
Expand Down