Skip to content

Commit 0bf13a8

Browse files
committed
Add support for terminate_after parameter
1 parent ea1ca1d commit 0bf13a8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/elasticsearch/dsl/search/options.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ class Options
3535
:indices_boost,
3636
:track_scores,
3737
:min_score,
38-
:track_total_hits
38+
:track_total_hits,
39+
:terminate_after
3940
]
4041

4142
def initialize(*args, &block)

test/unit/search_options_test.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ class SearchOptionsTest < ::Elasticsearch::Test::UnitTestCase
9999
subject.min_score 0.5
100100
assert_equal( { min_score: 0.5 }, subject.to_hash )
101101
end
102+
103+
should "encode terminate_after" do
104+
subject.terminate_after 10
105+
assert_equal( { terminate_after: 10 }, subject.to_hash )
106+
end
102107
end
103108
end
104109
end

0 commit comments

Comments
 (0)