Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit the search results to 10000 records & corresponding # of pages #4993

Merged
merged 1 commit into from
Sep 24, 2019
Merged
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
2 changes: 1 addition & 1 deletion arches/app/search/components/paging_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def append_dsl(self, search_results_object, permitted_nodegroups, include_provis
search_results_object['query'].limit = limit

def post_search_hook(self, search_results_object, results, permitted_nodegroups):
total = results['hits']['total']
total = results['hits']['total'] if results['hits']['total'] <= settings.SEARCH_RESULT_LIMIT else settings.SEARCH_RESULT_LIMIT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E501 line too long (134 > 119 characters)

page = 1 if self.request.GET.get(details['componentname']) == '' else int(self.request.GET.get(details['componentname'], 1))

paginator, pages = get_paginator(self.request, results, total, page, settings.SEARCH_ITEMS_PER_PAGE)
Expand Down
1 change: 1 addition & 0 deletions arches/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@
SEARCH_DROPDOWN_LENGTH = 100
SEARCH_TERM_SENSITIVITY = 3 # a lower number will give more "Fuzzy" matches, recomend between 0-4, see "prefix_length" at https://www.elastic.co/guide/en/elasticsearch/reference/6.7/query-dsl-fuzzy-query.html#_parameters_7
WORDS_PER_SEARCH_TERM = 10 # set to None for unlimited number of words allowed for search terms
SEARCH_RESULT_LIMIT = 10000 # should be less than or equal to elasticsearch configuration, index.max_result_window (default = 10,000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E261 at least two spaces before inline comment
E501 line too long (133 > 119 characters)


ETL_USERNAME = 'ETL' # override this setting in your packages settings.py file

Expand Down