From ae91d172ffb9a5f3b1ffb95b7694f0ac3196b5d4 Mon Sep 17 00:00:00 2001 From: Russ Cam Date: Thu, 12 Apr 2018 13:43:23 +1000 Subject: [PATCH 1/3] Consistent encoder names This commit updates encoder names to be consistent within documentation and align with snake casing convention. --- docs/plugins/analysis-phonetic.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/plugins/analysis-phonetic.asciidoc b/docs/plugins/analysis-phonetic.asciidoc index 34f4a933f9f76..07eb44792f6e4 100644 --- a/docs/plugins/analysis-phonetic.asciidoc +++ b/docs/plugins/analysis-phonetic.asciidoc @@ -17,9 +17,9 @@ The `phonetic` token filter takes the following settings: `encoder`:: Which phonetic encoder to use. Accepts `metaphone` (default), - `doublemetaphone`, `soundex`, `refinedsoundex`, `caverphone1`, + `double_metaphone`, `soundex`, `refined_soundex`, `caverphone1`, `caverphone2`, `cologne`, `nysiis`, `koelnerphonetik`, `haasephonetik`, - `beidermorse`, `daitch_mokotoff`. + `beider_morse`, `daitch_mokotoff`. `replace`:: From 904f7af974ffa8ce3c257a3e861faf4947aa7029 Mon Sep 17 00:00:00 2001 From: Russ Cam Date: Fri, 20 Jul 2018 12:13:24 +1000 Subject: [PATCH 2/3] Use consistent encoder names across docs and tests This commit updates tests and docs to use snake_case encoder names for consistency. Addresses comments on #29492 --- docs/plugins/analysis-phonetic.asciidoc | 2 +- .../index/analysis/AnalysisPhoneticFactoryTests.java | 4 ++-- .../org/elasticsearch/index/analysis/phonetic-1.yml | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/plugins/analysis-phonetic.asciidoc b/docs/plugins/analysis-phonetic.asciidoc index 07eb44792f6e4..a75c21fdac658 100644 --- a/docs/plugins/analysis-phonetic.asciidoc +++ b/docs/plugins/analysis-phonetic.asciidoc @@ -25,7 +25,7 @@ The `phonetic` token filter takes the following settings: Whether or not the original token should be replaced by the phonetic token. Accepts `true` (default) and `false`. Not supported by - `beidermorse` encoding. + `beider_morse` encoding. [source,js] -------------------------------------------------- diff --git a/plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/AnalysisPhoneticFactoryTests.java b/plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/AnalysisPhoneticFactoryTests.java index 8c551aee9190e..dc914008caef2 100644 --- a/plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/AnalysisPhoneticFactoryTests.java +++ b/plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/AnalysisPhoneticFactoryTests.java @@ -33,8 +33,8 @@ public AnalysisPhoneticFactoryTests() { @Override protected Map> getTokenFilters() { Map> filters = new HashMap<>(super.getTokenFilters()); - filters.put("beidermorse", PhoneticTokenFilterFactory.class); - filters.put("doublemetaphone", PhoneticTokenFilterFactory.class); + filters.put("beider_morse", PhoneticTokenFilterFactory.class); + filters.put("double_metaphone", PhoneticTokenFilterFactory.class); filters.put("phonetic", PhoneticTokenFilterFactory.class); return filters; } diff --git a/plugins/analysis-phonetic/src/test/resources/org/elasticsearch/index/analysis/phonetic-1.yml b/plugins/analysis-phonetic/src/test/resources/org/elasticsearch/index/analysis/phonetic-1.yml index 1909c7ee06390..14cdbbe2440ae 100644 --- a/plugins/analysis-phonetic/src/test/resources/org/elasticsearch/index/analysis/phonetic-1.yml +++ b/plugins/analysis-phonetic/src/test/resources/org/elasticsearch/index/analysis/phonetic-1.yml @@ -3,7 +3,7 @@ index: filter: doublemetaphonefilter: type: phonetic - encoder: doublemetaphone + encoder: double_metaphone metaphonefilter: type: phonetic encoder: metaphone @@ -12,16 +12,16 @@ index: encoder: soundex refinedsoundexfilter: type: phonetic - encoder: refinedsoundex + encoder: refined_soundex caverphonefilter: type: phonetic encoder: caverphone beidermorsefilter: type: phonetic - encoder: beidermorse + encoder: beider_morse beidermorsefilterfrench: type: phonetic - encoder: beidermorse + encoder: beider_morse languageset : [ "french" ] koelnerphonetikfilter: type: phonetic From e65632a5340b4b2e89d24108ae1860d1489e34d6 Mon Sep 17 00:00:00 2001 From: Russ Cam Date: Mon, 23 Jul 2018 09:24:37 +1000 Subject: [PATCH 3/3] Revert test filter names back This commit reverts the filter names used for testing back to what they were, as the name is used for class name lookup. --- .../index/analysis/AnalysisPhoneticFactoryTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/AnalysisPhoneticFactoryTests.java b/plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/AnalysisPhoneticFactoryTests.java index dc914008caef2..8c551aee9190e 100644 --- a/plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/AnalysisPhoneticFactoryTests.java +++ b/plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/AnalysisPhoneticFactoryTests.java @@ -33,8 +33,8 @@ public AnalysisPhoneticFactoryTests() { @Override protected Map> getTokenFilters() { Map> filters = new HashMap<>(super.getTokenFilters()); - filters.put("beider_morse", PhoneticTokenFilterFactory.class); - filters.put("double_metaphone", PhoneticTokenFilterFactory.class); + filters.put("beidermorse", PhoneticTokenFilterFactory.class); + filters.put("doublemetaphone", PhoneticTokenFilterFactory.class); filters.put("phonetic", PhoneticTokenFilterFactory.class); return filters; }