From e323c3c66ff5c95a00351d892a6838a428c70bd1 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sat, 17 Nov 2018 12:08:20 -0800 Subject: [PATCH] Added standard filter back in ES 5 --- lib/searchkick/index_options.rb | 9 +++++++++ 1 file changed, 9 insertions(+), 0 deletions(-) diff --git a/lib/searchkick/index_options.rb b/lib/searchkick/index_options.rb index 25bcc42..a6e165f 100644 --- a/lib/searchkick/index_options.rb +++ b/lib/searchkick/index_options.rb @@ -144,6 +144,15 @@ module Searchkick } } + if below60 + # ES docs say standard token filter does nothing in ES 5 + # (and therefore isn't needed at at), but tests say otherwise + # https://www.elastic.co/guide/en/elasticsearch/reference/5.0/analysis-standard-tokenfilter.html + [default_analyzer, :searchkick_search, :searchkick_search2].each do |analyzer| + settings[:analysis][:analyzer][analyzer][:filter].unshift("standard") + end + end + case language when "chinese" settings[:analysis][:analyzer].merge!( -- libgit2 0.21.0