@@ -92,16 +92,6 @@ public void testNoriAnalyzerUserDict() throws Exception {
92
92
}
93
93
}
94
94
95
- public void testNoriAnalyzerUserDictWithDuplicates () throws Exception {
96
- Settings settings = Settings .builder ()
97
- .put ("index.analysis.analyzer.my_analyzer.type" , "nori" )
98
- .putList ("index.analysis.analyzer.my_analyzer.user_dictionary_rules" , "세종" , "C샤프" , "세종" , "세종 세 종" )
99
- .build ();
100
- IllegalArgumentException exc = expectThrows (IllegalArgumentException .class , () -> createTestAnalysis (settings ));
101
- assertThat (exc .getMessage (), containsString ("Found duplicate term: [세종]" ));
102
-
103
- }
104
-
105
95
public void testNoriAnalyzerUserDictPath () throws Exception {
106
96
Settings settings = Settings .builder ()
107
97
.put ("index.analysis.analyzer.my_analyzer.type" , "nori" )
@@ -118,6 +108,17 @@ public void testNoriAnalyzerUserDictPath() throws Exception {
118
108
}
119
109
}
120
110
111
+ public void testNoriAnalyzerInvalidUserDictOption () throws Exception {
112
+ Settings settings = Settings .builder ()
113
+ .put ("index.analysis.analyzer.my_analyzer.type" , "nori" )
114
+ .put ("index.analysis.analyzer.my_analyzer.user_dictionary" , "user_dict.txt" )
115
+ .putList ("index.analysis.analyzer.my_analyzer.user_dictionary_rules" , "c++" , "C샤프" , "세종" , "세종시 세종 시" )
116
+ .build ();
117
+ IllegalArgumentException exc = expectThrows (IllegalArgumentException .class , () -> createTestAnalysis (settings ));
118
+ assertThat (exc .getMessage (), containsString ("It is not allowed to use [user_dictionary] in conjunction " +
119
+ "with [user_dictionary_rules]" ));
120
+ }
121
+
121
122
public void testNoriTokenizer () throws Exception {
122
123
Settings settings = Settings .builder ()
123
124
.put ("index.analysis.tokenizer.my_tokenizer.type" , "nori_tokenizer" )
0 commit comments