@@ -374,7 +374,6 @@ def prepare
374374 field_misspellings = misspellings && ( !misspellings_fields || misspellings_fields . include? ( base_field ( field ) ) )
375375
376376 if field == "_all" || field . end_with? ( ".analyzed" )
377- shared_options [ :cutoff_frequency ] = 0.001 unless operator . to_s == "and" || field_misspellings == false || ( !below73? && !track_total_hits? ) || match_type == :match_phrase || !below80? || Searchkick . opensearch?
378377 qs << shared_options . merge ( analyzer : "searchkick_search" )
379378
380379 # searchkick_search and searchkick_search2 are the same for some languages
@@ -457,20 +456,14 @@ def prepare
457456
458457 models = Array ( options [ :models ] )
459458 if models . any? { |m | m != m . searchkick_klass }
460- # aliases are not supported with _index in ES below 7.5
461- # see https://github.com/elastic/elasticsearch/pull/46640
462- if below75?
463- Searchkick . warn ( "Passing child models to models option throws off hits and pagination - use type option instead" )
464- else
465- index_type_or =
466- models . map do |m |
467- v = { _index : m . searchkick_index . name }
468- v [ :type ] = m . searchkick_index . klass_document_type ( m , true ) if m != m . searchkick_klass
469- v
470- end
459+ index_type_or =
460+ models . map do |m |
461+ v = { _index : m . searchkick_index . name }
462+ v [ :type ] = m . searchkick_index . klass_document_type ( m , true ) if m != m . searchkick_klass
463+ v
464+ end
471465
472- where [ :or ] = Array ( where [ :or ] ) + [ index_type_or ]
473- end
466+ where [ :or ] = Array ( where [ :or ] ) + [ index_type_or ]
474467 end
475468
476469 # start everything as efficient filters
@@ -1113,11 +1106,7 @@ def where_filters(where)
11131106 regex = regex . gsub ( /(?<!\\ )%/ , ".*" ) . gsub ( /(?<!\\ )_/ , "." ) . gsub ( "\\ %" , "%" ) . gsub ( "\\ _" , "_" )
11141107
11151108 if op == :ilike
1116- if below710?
1117- raise ArgumentError , "ilike requires Elasticsearch 7.10+"
1118- else
1119- filters << { regexp : { field => { value : regex , flags : "NONE" , case_insensitive : true } } }
1120- end
1109+ filters << { regexp : { field => { value : regex , flags : "NONE" , case_insensitive : true } } }
11211110 else
11221111 filters << { regexp : { field => { value : regex , flags : "NONE" } } }
11231112 end
@@ -1201,14 +1190,7 @@ def term_filters(field, value)
12011190 source = "#{ source } .*"
12021191 end
12031192
1204- if below710?
1205- if value . casefold?
1206- raise ArgumentError , "Case-insensitive flag does not work with Elasticsearch < 7.10"
1207- end
1208- { regexp : { field => { value : source , flags : "NONE" } } }
1209- else
1210- { regexp : { field => { value : source , flags : "NONE" , case_insensitive : value . casefold? } } }
1211- end
1193+ { regexp : { field => { value : source , flags : "NONE" , case_insensitive : value . casefold? } } }
12121194 else
12131195 # TODO add this for other values
12141196 if value . as_json . is_a? ( Enumerable )
@@ -1300,22 +1282,6 @@ def body_options
13001282 options [ :body_options ] || { }
13011283 end
13021284
1303- def below73?
1304- Searchkick . server_below? ( "7.3.0" )
1305- end
1306-
1307- def below75?
1308- Searchkick . server_below? ( "7.5.0" )
1309- end
1310-
1311- def below710?
1312- Searchkick . server_below? ( "7.10.0" )
1313- end
1314-
1315- def below80?
1316- Searchkick . server_below? ( "8.0.0" )
1317- end
1318-
13191285 def below90?
13201286 Searchkick . server_below? ( "9.0.0" )
13211287 end
0 commit comments