36
36
import org .elasticsearch .index .analysis .TokenFilterFactory ;
37
37
import org .elasticsearch .test .ESTestCase ;
38
38
39
+ import java .util .Collections ;
39
40
import java .util .HashMap ;
40
41
import java .util .Map ;
41
42
@@ -60,8 +61,8 @@ public void testParseTextFieldCheckAnalyzerAnalysisMode() {
60
61
analyzers .put ("my_analyzer" ,
61
62
new NamedAnalyzer ("my_named_analyzer" , AnalyzerScope .INDEX , createAnalyzerWithMode ("my_analyzer" , AnalysisMode .ALL )));
62
63
63
- IndexAnalyzers indexAnalyzers = new IndexAnalyzers (indexSettings ,
64
- new NamedAnalyzer ( "default" , AnalyzerScope . INDEX , null ), null , null , analyzers , null , null );
64
+ IndexAnalyzers indexAnalyzers = new IndexAnalyzers (indexSettings , new NamedAnalyzer ( "default" , AnalyzerScope . INDEX , null ), null ,
65
+ null , analyzers , Collections . emptyMap (), Collections . emptyMap () );
65
66
when (parserContext .getIndexAnalyzers ()).thenReturn (indexAnalyzers );
66
67
TypeParsers .parseTextField (builder , "name" , new HashMap <>(fieldNode ), parserContext );
67
68
@@ -71,7 +72,7 @@ public void testParseTextFieldCheckAnalyzerAnalysisMode() {
71
72
analyzers .put ("my_analyzer" , new NamedAnalyzer ("my_named_analyzer" , AnalyzerScope .INDEX ,
72
73
createAnalyzerWithMode ("my_analyzer" , mode )));
73
74
indexAnalyzers = new IndexAnalyzers (indexSettings , new NamedAnalyzer ("default" , AnalyzerScope .INDEX , null ), null , null , analyzers ,
74
- null , null );
75
+ Collections . emptyMap (), Collections . emptyMap () );
75
76
when (parserContext .getIndexAnalyzers ()).thenReturn (indexAnalyzers );
76
77
MapperException ex = expectThrows (MapperException .class ,
77
78
() -> TypeParsers .parseTextField (builder , "name" , new HashMap <>(fieldNode ), parserContext ));
@@ -98,7 +99,7 @@ public void testParseTextFieldCheckSearchAnalyzerAnalysisMode() {
98
99
analyzers .put ("standard" , new NamedAnalyzer ("standard" , AnalyzerScope .INDEX , new StandardAnalyzer ()));
99
100
100
101
IndexAnalyzers indexAnalyzers = new IndexAnalyzers (indexSettings , new NamedAnalyzer ("default" , AnalyzerScope .INDEX , null ), null ,
101
- null , analyzers , null , null );
102
+ null , analyzers , Collections . emptyMap (), Collections . emptyMap () );
102
103
when (parserContext .getIndexAnalyzers ()).thenReturn (indexAnalyzers );
103
104
TypeParsers .parseTextField (builder , "name" , new HashMap <>(fieldNode ), parserContext );
104
105
@@ -109,7 +110,7 @@ public void testParseTextFieldCheckSearchAnalyzerAnalysisMode() {
109
110
new NamedAnalyzer ("my_named_analyzer" , AnalyzerScope .INDEX , createAnalyzerWithMode ("my_analyzer" , mode )));
110
111
analyzers .put ("standard" , new NamedAnalyzer ("standard" , AnalyzerScope .INDEX , new StandardAnalyzer ()));
111
112
indexAnalyzers = new IndexAnalyzers (indexSettings , new NamedAnalyzer ("default" , AnalyzerScope .INDEX , null ), null , null ,
112
- analyzers , null , null );
113
+ analyzers , Collections . emptyMap (), Collections . emptyMap () );
113
114
when (parserContext .getIndexAnalyzers ()).thenReturn (indexAnalyzers );
114
115
MapperException ex = expectThrows (MapperException .class ,
115
116
() -> TypeParsers .parseTextField (builder , "name" , new HashMap <>(fieldNode ), parserContext ));
@@ -130,7 +131,7 @@ public void testParseTextFieldCheckAnalyzerWithSearchAnalyzerAnalysisMode() {
130
131
analyzers .put ("my_analyzer" ,
131
132
new NamedAnalyzer ("my_named_analyzer" , AnalyzerScope .INDEX , createAnalyzerWithMode ("my_analyzer" , mode )));
132
133
IndexAnalyzers indexAnalyzers = new IndexAnalyzers (indexSettings , new NamedAnalyzer ("default" , AnalyzerScope .INDEX , null ), null ,
133
- null , analyzers , null , null );
134
+ null , analyzers , Collections . emptyMap (), Collections . emptyMap () );
134
135
when (parserContext .getIndexAnalyzers ()).thenReturn (indexAnalyzers );
135
136
MapperException ex = expectThrows (MapperException .class ,
136
137
() -> TypeParsers .parseTextField (builder , "name" , new HashMap <>(fieldNode ), parserContext ));
@@ -146,7 +147,7 @@ public void testParseTextFieldCheckAnalyzerWithSearchAnalyzerAnalysisMode() {
146
147
analyzers .put ("standard" , new NamedAnalyzer ("standard" , AnalyzerScope .INDEX , new StandardAnalyzer ()));
147
148
148
149
indexAnalyzers = new IndexAnalyzers (indexSettings , new NamedAnalyzer ("default" , AnalyzerScope .INDEX , null ), null , null , analyzers ,
149
- null , null );
150
+ Collections . emptyMap (), Collections . emptyMap () );
150
151
when (parserContext .getIndexAnalyzers ()).thenReturn (indexAnalyzers );
151
152
TypeParsers .parseTextField (builder , "name" , new HashMap <>(fieldNode ), parserContext );
152
153
}
0 commit comments