Commit f403e4cf1179f10ec66f7f88e7bc0f04d7a005a0
1 parent
fc950aad
Exists in
master
and in
19 other branches
Fixed error with similar method and _all field
Showing
2 changed files
with
4 additions
and
1 deletions
Show diff stats
CHANGELOG.md
lib/searchkick/query.rb
... | ... | @@ -223,13 +223,15 @@ module Searchkick |
223 | 223 | if options[:similar] |
224 | 224 | payload = { |
225 | 225 | more_like_this: { |
226 | - fields: fields, | |
227 | 226 | like_text: term, |
228 | 227 | min_doc_freq: 1, |
229 | 228 | min_term_freq: 1, |
230 | 229 | analyzer: "searchkick_search2" |
231 | 230 | } |
232 | 231 | } |
232 | + if fields != ["_all"] | |
233 | + payload[:more_like_this][:fields] = fields | |
234 | + end | |
233 | 235 | elsif all |
234 | 236 | payload = { |
235 | 237 | match_all: {} | ... | ... |