From 9a6c904a690b2f2a0aef896b498789499fed6f09 Mon Sep 17 00:00:00 2001 From: abram axel booth Date: Thu, 23 Jan 2025 12:41:41 -0500 Subject: [PATCH] tidy names --- api/search/views.py | 4 ++-- share/search/index_strategy/trove_indexcard_flats.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/search/views.py b/api/search/views.py index 7cf781947..f8d6b4dcd 100644 --- a/api/search/views.py +++ b/api/search/views.py @@ -32,11 +32,11 @@ def _handle_request(self, request): if 'scroll' in queryparams: return http.HttpResponseForbidden(reason='Scroll is not supported.') try: - specific_index = index_strategy.get_strategy_for_sharev2_search(requested_index_strategy) + _index_strategy = index_strategy.get_strategy_for_sharev2_search(requested_index_strategy) except exceptions.IndexStrategyError as error: raise http.Http404(str(error)) try: - response_json = specific_index.pls_handle_search__passthru( + response_json = _index_strategy.pls_handle_search__passthru( request_body=request.data, request_queryparams=queryparams, ) diff --git a/share/search/index_strategy/trove_indexcard_flats.py b/share/search/index_strategy/trove_indexcard_flats.py index e5a6488d1..49874d189 100644 --- a/share/search/index_strategy/trove_indexcard_flats.py +++ b/share/search/index_strategy/trove_indexcard_flats.py @@ -294,7 +294,7 @@ def _make_actionset(indexcard_id, *actions): def pls_handle_search__passthru(self, request_body=None, request_queryparams=None) -> dict: return self.es8_client.search( - index=self.get_index('').full_index_name, + index=self.__index.full_index_name, body={ **(request_body or {}), 'track_total_hits': True, @@ -356,7 +356,7 @@ def pls_handle_valuesearch(self, valuesearch_params: ValuesearchParams) -> Value logger.info(json.dumps(_search_kwargs, indent=2)) try: _es8_response = self.es8_client.search( - index=self.get_index('').full_index_name, + index=self.__index.full_index_name, **_search_kwargs, ) except elasticsearch8.TransportError as error: