Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Backend
Commits
dff7112f
Commit
dff7112f
authored
6 years ago
by
Erwan Rouchet
Browse files
Options
Downloads
Patches
Plain Diff
Limit ES results count to 10000
parent
71a97593
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arkindex/project/elastic.py
+3
-3
3 additions, 3 deletions
arkindex/project/elastic.py
with
3 additions
and
3 deletions
arkindex/project/elastic.py
+
3
−
3
View file @
dff7112f
...
...
@@ -34,7 +34,7 @@ class ESQuerySet(object):
index
=
self
.
es_index
,
body
=
{
"
from
"
:
value
.
start
,
"
size
"
:
value
.
stop
-
value
.
start
,
"
size
"
:
min
(
value
.
stop
-
value
.
start
,
10000
),
# The Scroll API is required to go over 10K results
"
_source
"
:
self
.
_source
,
"
query
"
:
self
.
query
,
"
aggs
"
:
self
.
aggs
,
...
...
@@ -48,13 +48,13 @@ class ESQuerySet(object):
return
self
.
count
()
def
count
(
self
):
return
self
.
elastic
.
count
(
return
min
(
self
.
elastic
.
count
(
index
=
self
.
es_index
,
body
=
{
"
query
"
:
self
.
query
,
},
doc_type
=
self
.
es_type
,
)[
'
count
'
]
)[
'
count
'
]
,
10000
)
# The Scroll API is required to go over 10K results
def
__iter__
(
self
):
return
self
[
0
:
len
(
self
)]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment