@@ -605,31 +605,31 @@ public static TopHitsAggregationBuilder parse(String aggregationName, QueryParse
605
605
if (token == XContentParser .Token .FIELD_NAME ) {
606
606
currentFieldName = parser .currentName ();
607
607
} else if (token .isValue ()) {
608
- if (context . getParseFieldMatcher () .match (currentFieldName , SearchSourceBuilder . FROM_FIELD )) {
608
+ if (SearchSourceBuilder . FROM_FIELD .match (currentFieldName )) {
609
609
factory .from (parser .intValue ());
610
- } else if (context . getParseFieldMatcher () .match (currentFieldName , SearchSourceBuilder . SIZE_FIELD )) {
610
+ } else if (SearchSourceBuilder . SIZE_FIELD .match (currentFieldName )) {
611
611
factory .size (parser .intValue ());
612
- } else if (context . getParseFieldMatcher () .match (currentFieldName , SearchSourceBuilder . VERSION_FIELD )) {
612
+ } else if (SearchSourceBuilder . VERSION_FIELD .match (currentFieldName )) {
613
613
factory .version (parser .booleanValue ());
614
- } else if (context . getParseFieldMatcher () .match (currentFieldName , SearchSourceBuilder . EXPLAIN_FIELD )) {
614
+ } else if (SearchSourceBuilder . EXPLAIN_FIELD .match (currentFieldName )) {
615
615
factory .explain (parser .booleanValue ());
616
- } else if (context . getParseFieldMatcher () .match (currentFieldName , SearchSourceBuilder . TRACK_SCORES_FIELD )) {
616
+ } else if (SearchSourceBuilder . TRACK_SCORES_FIELD .match (currentFieldName )) {
617
617
factory .trackScores (parser .booleanValue ());
618
- } else if (context . getParseFieldMatcher () .match (currentFieldName , SearchSourceBuilder . _SOURCE_FIELD )) {
618
+ } else if (SearchSourceBuilder . _SOURCE_FIELD .match (currentFieldName )) {
619
619
factory .fetchSource (FetchSourceContext .parse (context .parser ()));
620
- } else if (context . getParseFieldMatcher () .match (currentFieldName , SearchSourceBuilder . STORED_FIELDS_FIELD )) {
620
+ } else if (SearchSourceBuilder . STORED_FIELDS_FIELD .match (currentFieldName )) {
621
621
factory .storedFieldsContext =
622
622
StoredFieldsContext .fromXContent (SearchSourceBuilder .STORED_FIELDS_FIELD .getPreferredName (), context );
623
- } else if (context . getParseFieldMatcher () .match (currentFieldName , SearchSourceBuilder . SORT_FIELD )) {
623
+ } else if (SearchSourceBuilder . SORT_FIELD .match (currentFieldName )) {
624
624
factory .sort (parser .text ());
625
625
} else {
626
626
throw new ParsingException (parser .getTokenLocation (), "Unknown key for a " + token + " in [" + currentFieldName + "]." ,
627
627
parser .getTokenLocation ());
628
628
}
629
629
} else if (token == XContentParser .Token .START_OBJECT ) {
630
- if (context . getParseFieldMatcher () .match (currentFieldName , SearchSourceBuilder . _SOURCE_FIELD )) {
630
+ if (SearchSourceBuilder . _SOURCE_FIELD .match (currentFieldName )) {
631
631
factory .fetchSource (FetchSourceContext .parse (context .parser ()));
632
- } else if (context . getParseFieldMatcher () .match (currentFieldName , SearchSourceBuilder . SCRIPT_FIELDS_FIELD )) {
632
+ } else if (SearchSourceBuilder . SCRIPT_FIELDS_FIELD .match (currentFieldName )) {
633
633
List <ScriptField > scriptFields = new ArrayList <>();
634
634
while ((token = parser .nextToken ()) != XContentParser .Token .END_OBJECT ) {
635
635
String scriptFieldName = parser .currentName ();
@@ -641,7 +641,7 @@ public static TopHitsAggregationBuilder parse(String aggregationName, QueryParse
641
641
if (token == XContentParser .Token .FIELD_NAME ) {
642
642
currentFieldName = parser .currentName ();
643
643
} else if (token .isValue ()) {
644
- if (context . getParseFieldMatcher () .match (currentFieldName , SearchSourceBuilder . SCRIPT_FIELD )) {
644
+ if (SearchSourceBuilder . SCRIPT_FIELD .match (currentFieldName )) {
645
645
script = Script .parse (parser , context .getParseFieldMatcher (), context .getDefaultScriptLanguage ());
646
646
} else if (context .getParseFieldMatcher ().match (currentFieldName ,
647
647
SearchSourceBuilder .IGNORE_FAILURE_FIELD )) {
@@ -652,7 +652,7 @@ public static TopHitsAggregationBuilder parse(String aggregationName, QueryParse
652
652
parser .getTokenLocation ());
653
653
}
654
654
} else if (token == XContentParser .Token .START_OBJECT ) {
655
- if (context . getParseFieldMatcher () .match (currentFieldName , SearchSourceBuilder . SCRIPT_FIELD )) {
655
+ if (SearchSourceBuilder . SCRIPT_FIELD .match (currentFieldName )) {
656
656
script = Script .parse (parser , context .getParseFieldMatcher (), context .getDefaultScriptLanguage ());
657
657
} else {
658
658
throw new ParsingException (parser .getTokenLocation (),
@@ -671,9 +671,9 @@ public static TopHitsAggregationBuilder parse(String aggregationName, QueryParse
671
671
}
672
672
}
673
673
factory .scriptFields (scriptFields );
674
- } else if (context . getParseFieldMatcher () .match (currentFieldName , SearchSourceBuilder . HIGHLIGHT_FIELD )) {
674
+ } else if (SearchSourceBuilder . HIGHLIGHT_FIELD .match (currentFieldName )) {
675
675
factory .highlighter (HighlightBuilder .fromXContent (context ));
676
- } else if (context . getParseFieldMatcher () .match (currentFieldName , SearchSourceBuilder . SORT_FIELD )) {
676
+ } else if (SearchSourceBuilder . SORT_FIELD .match (currentFieldName )) {
677
677
List <SortBuilder <?>> sorts = SortBuilder .fromXContent (context );
678
678
factory .sorts (sorts );
679
679
} else {
@@ -682,10 +682,10 @@ public static TopHitsAggregationBuilder parse(String aggregationName, QueryParse
682
682
}
683
683
} else if (token == XContentParser .Token .START_ARRAY ) {
684
684
685
- if (context . getParseFieldMatcher () .match (currentFieldName , SearchSourceBuilder . STORED_FIELDS_FIELD )) {
685
+ if (SearchSourceBuilder . STORED_FIELDS_FIELD .match (currentFieldName )) {
686
686
factory .storedFieldsContext =
687
687
StoredFieldsContext .fromXContent (SearchSourceBuilder .STORED_FIELDS_FIELD .getPreferredName (), context );
688
- } else if (context . getParseFieldMatcher () .match (currentFieldName , SearchSourceBuilder . DOCVALUE_FIELDS_FIELD )) {
688
+ } else if (SearchSourceBuilder . DOCVALUE_FIELDS_FIELD .match (currentFieldName )) {
689
689
List <String > fieldDataFields = new ArrayList <>();
690
690
while ((token = parser .nextToken ()) != XContentParser .Token .END_ARRAY ) {
691
691
if (token == XContentParser .Token .VALUE_STRING ) {
@@ -696,10 +696,10 @@ public static TopHitsAggregationBuilder parse(String aggregationName, QueryParse
696
696
}
697
697
}
698
698
factory .fieldDataFields (fieldDataFields );
699
- } else if (context . getParseFieldMatcher () .match (currentFieldName , SearchSourceBuilder . SORT_FIELD )) {
699
+ } else if (SearchSourceBuilder . SORT_FIELD .match (currentFieldName )) {
700
700
List <SortBuilder <?>> sorts = SortBuilder .fromXContent (context );
701
701
factory .sorts (sorts );
702
- } else if (context . getParseFieldMatcher () .match (currentFieldName , SearchSourceBuilder . _SOURCE_FIELD )) {
702
+ } else if (SearchSourceBuilder . _SOURCE_FIELD .match (currentFieldName )) {
703
703
factory .fetchSource (FetchSourceContext .parse (context .parser ()));
704
704
} else {
705
705
throw new ParsingException (parser .getTokenLocation (), "Unknown key for a " + token + " in [" + currentFieldName + "]." ,
0 commit comments