Commit e323c3c66ff5c95a00351d892a6838a428c70bd1
1 parent
04a9309b
Exists in
master
and in
17 other branches
Added standard filter back in ES 5
Showing
1 changed file
with
9 additions
and
0 deletions
Show diff stats
lib/searchkick/index_options.rb
... | ... | @@ -144,6 +144,15 @@ module Searchkick |
144 | 144 | } |
145 | 145 | } |
146 | 146 | |
147 | + if below60 | |
148 | + # ES docs say standard token filter does nothing in ES 5 | |
149 | + # (and therefore isn't needed at at), but tests say otherwise | |
150 | + # https://www.elastic.co/guide/en/elasticsearch/reference/5.0/analysis-standard-tokenfilter.html | |
151 | + [default_analyzer, :searchkick_search, :searchkick_search2].each do |analyzer| | |
152 | + settings[:analysis][:analyzer][analyzer][:filter].unshift("standard") | |
153 | + end | |
154 | + end | |
155 | + | |
147 | 156 | case language |
148 | 157 | when "chinese" |
149 | 158 | settings[:analysis][:analyzer].merge!( | ... | ... |