Skip to content

Commit

Permalink
move called out global var back into if block, re #10804
Browse files Browse the repository at this point in the history
  • Loading branch information
whatisgalen committed Aug 20, 2024
1 parent 235dd52 commit 811990f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions arches/app/search/components/standard_search_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@
},
}

SEARCH_RESULT_PAGES = (
int(settings.SEARCH_EXPORT_LIMIT // settings.SEARCH_RESULT_LIMIT) - 1
)

logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -144,7 +140,12 @@ def execute_query(self, search_query_object, response_object, **kwargs):
if total <= settings.SEARCH_EXPORT_LIMIT:
pages = (total // settings.SEARCH_RESULT_LIMIT) + 1
else:
pages = SEARCH_RESULT_PAGES
pages = (
int(
settings.SEARCH_EXPORT_LIMIT // settings.SEARCH_RESULT_LIMIT
)
- 1
)
for page in range(int(pages)):
results_scrolled = dsl.se.es.scroll(scroll_id=scroll_id, scroll="1m")
results["hits"]["hits"] += results_scrolled["hits"]["hits"]
Expand Down

0 comments on commit 811990f

Please sign in to comment.