-
Notifications
You must be signed in to change notification settings - Fork 368
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
Add unlimited method to fetch all records from ES #393
Conversation
61c12c2
to
aa6af74
Compare
@@ -5,7 +5,7 @@ class Query | |||
class Criteria | |||
include Compose | |||
ARRAY_STORAGES = [:queries, :filters, :post_filters, :sort, :fields, :types, :scores] | |||
HASH_STORAGES = [:options, :request_options, :facets, :aggregations, :suggest, :script_fields] | |||
HASH_STORAGES = [:options, :request_options, :facets, :aggregations, :suggest, :script_fields, :search_options] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move it before request_options please
e41928e
to
8a9a6bb
Compare
@@ -96,13 +96,15 @@ | |||
specify { expect(subject.limit(10)).not_to eq(subject) } | |||
specify { expect(subject.limit(10).criteria.request_options).to include(size: 10) } | |||
specify { expect { subject.limit(10) }.not_to change { subject.criteria.request_options } } | |||
specify { expect(subject.offset { 20/2 }.criteria.request_body[:body]).to include(size: 10) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shell not pass!
8a9a6bb
to
b3c79a6
Compare
Awesome! Thanks! |
@sergey-kintsel does this require ES 5.x or a special max_results_window value? Tried to use it locally with my ES 2.3 installation, and it complains about going beyond the max results window |
@binarydev Hi! It does not require the latest ES, but it does require max_results_window. The problem is that most likely you are trying to load too much data. This method is a bit unsafe I would say. So, if you really need that much data - change max results window |
It removes offset and sets response limit to the total_count value