Skip to content
Snippets Groups Projects
Commit bbed85e9 authored by Erwan Rouchet's avatar Erwan Rouchet
Browse files

Use a setting for the results limit

parent 4369c0a6
No related branches found
No related tags found
1 merge request!92Limit ES results count to 10000
......@@ -34,7 +34,7 @@ class ESQuerySet(object):
index=self.es_index,
body={
"from": value.start,
"size": min(value.stop - value.start, 10000), # The Scroll API is required to go over 10K results
"size": min(value.stop - value.start, settings.ES_RESULTS_LIMIT),
"_source": self._source,
"query": self.query,
"aggs": self.aggs,
......@@ -54,7 +54,7 @@ class ESQuerySet(object):
"query": self.query,
},
doc_type=self.es_type,
)['count'], 10000) # The Scroll API is required to go over 10K results
)['count'], settings.ES_RESULTS_LIMIT)
def __iter__(self):
return self[0:len(self)]
......
......@@ -214,6 +214,8 @@ REST_FRAMEWORK = {
ELASTIC_SEARCH_HOSTS = [
os.environ.get('ES_HOST', 'localhost'),
]
# The Scroll API is required to go over 10K results
ES_RESULTS_LIMIT = 10000
ES_INDEX_TRANSCRIPTIONS = 'transcriptions'
ES_INDEX_ACTS = 'acts'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment