12
12
import org .elasticsearch .common .io .stream .StreamInput ;
13
13
import org .elasticsearch .common .io .stream .StreamOutput ;
14
14
import org .elasticsearch .common .unit .Fuzziness ;
15
- import org .elasticsearch .common .xcontent .LoggingDeprecationHandler ;
16
15
import org .elasticsearch .common .xcontent .XContentHelper ;
17
16
import org .elasticsearch .index .mapper .CompletionFieldMapper ;
18
17
import org .elasticsearch .index .mapper .MappedFieldType ;
21
20
import org .elasticsearch .search .suggest .SuggestionSearchContext .SuggestionContext ;
22
21
import org .elasticsearch .search .suggest .completion .context .ContextMapping ;
23
22
import org .elasticsearch .search .suggest .completion .context .ContextMappings ;
24
- import org .elasticsearch .xcontent .NamedXContentRegistry ;
25
23
import org .elasticsearch .xcontent .ObjectParser ;
26
24
import org .elasticsearch .xcontent .ParseField ;
27
25
import org .elasticsearch .xcontent .ToXContent ;
28
26
import org .elasticsearch .xcontent .XContentBuilder ;
29
27
import org .elasticsearch .xcontent .XContentFactory ;
30
28
import org .elasticsearch .xcontent .XContentParser ;
29
+ import org .elasticsearch .xcontent .XContentParserConfiguration ;
31
30
import org .elasticsearch .xcontent .XContentType ;
32
31
33
32
import java .io .IOException ;
@@ -288,7 +287,7 @@ public SuggestionContext build(SearchExecutionContext context) throws IOExceptio
288
287
if (type .hasContextMappings () && contextBytes != null ) {
289
288
Map <String , List <ContextMapping .InternalQueryContext >> queryContexts = parseContextBytes (
290
289
contextBytes ,
291
- context .getXContentRegistry (),
290
+ context .getParserConfig (),
292
291
type .getContextMappings ()
293
292
);
294
293
suggestionContext .setQueryContexts (queryContexts );
@@ -301,17 +300,10 @@ public SuggestionContext build(SearchExecutionContext context) throws IOExceptio
301
300
302
301
static Map <String , List <ContextMapping .InternalQueryContext >> parseContextBytes (
303
302
BytesReference contextBytes ,
304
- NamedXContentRegistry xContentRegistry ,
303
+ XContentParserConfiguration parserConfig ,
305
304
ContextMappings contextMappings
306
305
) throws IOException {
307
- try (
308
- XContentParser contextParser = XContentHelper .createParser (
309
- xContentRegistry ,
310
- LoggingDeprecationHandler .INSTANCE ,
311
- contextBytes ,
312
- CONTEXT_BYTES_XCONTENT_TYPE
313
- )
314
- ) {
306
+ try (XContentParser contextParser = XContentHelper .createParser (parserConfig , contextBytes , CONTEXT_BYTES_XCONTENT_TYPE )) {
315
307
contextParser .nextToken ();
316
308
Map <String , List <ContextMapping .InternalQueryContext >> queryContexts = new HashMap <>(contextMappings .size ());
317
309
assert contextParser .currentToken () == XContentParser .Token .START_OBJECT ;
0 commit comments