aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2018-01-15 19:30:01 -0500
committerAlec Warner <antarus@gentoo.org>2018-01-15 19:30:01 -0500
commit5f40a6faaf4b57ad264b31c7159042a126b0f5fe (patch)
treeb45bc9b410a4ad11e17b8a2767b1c3f31b945ebc /lib/kkuleomi
parentUpdate Elasticsearch gems to 6.0.0 (diff)
downloadpackages-5-5f40a6faaf4b57ad264b31c7159042a126b0f5fe.tar.gz
packages-5-5f40a6faaf4b57ad264b31c7159042a126b0f5fe.tar.bz2
packages-5-5f40a6faaf4b57ad264b31c7159042a126b0f5fe.zip
Update elasticsearch queries.
Similar to the previous commit: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-filtered-query.html documents that query => filtered semantic is deprecated. This fixes more references.
Diffstat (limited to 'lib/kkuleomi')
-rw-r--r--lib/kkuleomi/store/model.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/kkuleomi/store/model.rb b/lib/kkuleomi/store/model.rb
index 8d406bf..e610ada 100644
--- a/lib/kkuleomi/store/model.rb
+++ b/lib/kkuleomi/store/model.rb
@@ -9,9 +9,7 @@ module Kkuleomi::Store::Model
def find_all_by(field, value, opts = {})
search({
size: 10_000,
- query: {
- filtered: { filter: { term: { field => value } } }
- }
+ query: { bool: { filter: { term: { field => value } } }
}.merge(opts))
end
@@ -22,7 +20,7 @@ module Kkuleomi::Store::Model
search({
query: {
- filtered: { filter: { bool: { must: filter_args } } }
+ bool: { filter: { bool: { must: filter_args } } }
},
size: 10_000
}.merge(opts))
@@ -36,14 +34,14 @@ module Kkuleomi::Store::Model
search(opts.merge(
size: 10_000,
query: {
- filtered: {
+ bool: {
filter: {
has_parent: {
type: parent.class.document_type,
filter: { term: { _id: parent.id } }
}
},
- query: { match_all: {} }
+ must: { match_all: {} }
}
}
))