Commit 495599f68e85e9c4fd8a0f049e09484e5c3bf3c4
1 parent
9febe2f8
Exists in
master
and in
21 other branches
Added request_params option - #484
Showing
4 changed files
with
15 additions
and
0 deletions
Show diff stats
CHANGELOG.md
README.md
... | ... | @@ -1314,6 +1314,12 @@ products = Product.search("carrots", execute: false) |
1314 | 1314 | products.each { ... } # search not executed until here |
1315 | 1315 | ``` |
1316 | 1316 | |
1317 | +Add [request parameters](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-uri-request.html), like `search_type` and `query_cache` [master] | |
1318 | + | |
1319 | +```ruby | |
1320 | +Product.search("carrots", request_params: {search_type: "dfs_query_then_fetch"}) | |
1321 | +``` | |
1322 | + | |
1317 | 1323 | Make fields unsearchable but include in the source |
1318 | 1324 | |
1319 | 1325 | ```ruby | ... | ... |
lib/searchkick/query.rb
test/query_test.rb
... | ... | @@ -28,4 +28,8 @@ class QueryTest < Minitest::Test |
28 | 28 | def test_timeout_override |
29 | 29 | assert_equal "1s", Product.search("*", body_options: {timeout: "1s"}, execute: false).body[:timeout] |
30 | 30 | end |
31 | + | |
32 | + def test_request_params | |
33 | + assert_equal "dfs_query_then_fetch", Product.search("*", request_params: {search_type: "dfs_query_then_fetch"}, execute: false).params[:search_type] | |
34 | + end | |
31 | 35 | end | ... | ... |