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,7 +8,7 @@ module Searchkick | ||
8 | 8 | ||
9 | def index_options | 9 | def index_options |
10 | custom_mapping = options[:mappings] || {} | 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 | # add type | 12 | # add type |
13 | custom_mapping = {index_type => custom_mapping} | 13 | custom_mapping = {index_type => custom_mapping} |
14 | end | 14 | end |
@@ -172,7 +172,7 @@ module Searchkick | @@ -172,7 +172,7 @@ module Searchkick | ||
172 | settings[:similarity] = {default: {type: options[:similarity]}} | 172 | settings[:similarity] = {default: {type: options[:similarity]}} |
173 | end | 173 | end |
174 | 174 | ||
175 | - unless below62 | 175 | + unless below62? |
176 | settings[:index] = { | 176 | settings[:index] = { |
177 | max_ngram_diff: 49, | 177 | max_ngram_diff: 49, |
178 | max_shingle_diff: 4 | 178 | max_shingle_diff: 4 |
@@ -411,7 +411,7 @@ module Searchkick | @@ -411,7 +411,7 @@ module Searchkick | ||
411 | ] | 411 | ] |
412 | } | 412 | } |
413 | 413 | ||
414 | - if below70 | 414 | + if below70? |
415 | mappings = {index_type => mappings} | 415 | mappings = {index_type => mappings} |
416 | end | 416 | end |
417 | 417 | ||
@@ -453,7 +453,7 @@ module Searchkick | @@ -453,7 +453,7 @@ module Searchkick | ||
453 | type: "synonym_graph", | 453 | type: "synonym_graph", |
454 | synonyms_path: search_synonyms | 454 | synonyms_path: search_synonyms |
455 | } | 455 | } |
456 | - synonym_graph[:updateable] = true unless below73 | 456 | + synonym_graph[:updateable] = true unless below73? |
457 | else | 457 | else |
458 | synonym_graph = { | 458 | synonym_graph = { |
459 | type: "synonym_graph", | 459 | type: "synonym_graph", |
@@ -507,15 +507,15 @@ module Searchkick | @@ -507,15 +507,15 @@ module Searchkick | ||
507 | :searchkick_index | 507 | :searchkick_index |
508 | end | 508 | end |
509 | 509 | ||
510 | - def below62 | 510 | + def below62? |
511 | Searchkick.server_below?("6.2.0") | 511 | Searchkick.server_below?("6.2.0") |
512 | end | 512 | end |
513 | 513 | ||
514 | - def below70 | 514 | + def below70? |
515 | Searchkick.server_below?("7.0.0") | 515 | Searchkick.server_below?("7.0.0") |
516 | end | 516 | end |
517 | 517 | ||
518 | - def below73 | 518 | + def below73? |
519 | Searchkick.server_below?("7.3.0") | 519 | Searchkick.server_below?("7.3.0") |
520 | end | 520 | end |
521 | end | 521 | end |