Commit eec777fa8522ded283aab9af4dc3245d6065084b
1 parent
90f3630d
Exists in
master
and in
8 other branches
Use consistent method names
Showing
1 changed file
with
7 additions
and
7 deletions
Show diff stats
lib/searchkick/index_options.rb
... | ... | @@ -8,7 +8,7 @@ module Searchkick |
8 | 8 | |
9 | 9 | def index_options |
10 | 10 | custom_mapping = options[:mappings] || {} |
11 | - if below70 && custom_mapping.keys.map(&:to_sym).include?(:properties) | |
11 | + if below70? && custom_mapping.keys.map(&:to_sym).include?(:properties) | |
12 | 12 | # add type |
13 | 13 | custom_mapping = {index_type => custom_mapping} |
14 | 14 | end |
... | ... | @@ -172,7 +172,7 @@ module Searchkick |
172 | 172 | settings[:similarity] = {default: {type: options[:similarity]}} |
173 | 173 | end |
174 | 174 | |
175 | - unless below62 | |
175 | + unless below62? | |
176 | 176 | settings[:index] = { |
177 | 177 | max_ngram_diff: 49, |
178 | 178 | max_shingle_diff: 4 |
... | ... | @@ -411,7 +411,7 @@ module Searchkick |
411 | 411 | ] |
412 | 412 | } |
413 | 413 | |
414 | - if below70 | |
414 | + if below70? | |
415 | 415 | mappings = {index_type => mappings} |
416 | 416 | end |
417 | 417 | |
... | ... | @@ -453,7 +453,7 @@ module Searchkick |
453 | 453 | type: "synonym_graph", |
454 | 454 | synonyms_path: search_synonyms |
455 | 455 | } |
456 | - synonym_graph[:updateable] = true unless below73 | |
456 | + synonym_graph[:updateable] = true unless below73? | |
457 | 457 | else |
458 | 458 | synonym_graph = { |
459 | 459 | type: "synonym_graph", |
... | ... | @@ -507,15 +507,15 @@ module Searchkick |
507 | 507 | :searchkick_index |
508 | 508 | end |
509 | 509 | |
510 | - def below62 | |
510 | + def below62? | |
511 | 511 | Searchkick.server_below?("6.2.0") |
512 | 512 | end |
513 | 513 | |
514 | - def below70 | |
514 | + def below70? | |
515 | 515 | Searchkick.server_below?("7.0.0") |
516 | 516 | end |
517 | 517 | |
518 | - def below73 | |
518 | + def below73? | |
519 | 519 | Searchkick.server_below?("7.3.0") |
520 | 520 | end |
521 | 521 | end | ... | ... |