found = parser.booleanValue(); } else { fields.put(currentFieldName, new DocumentField(currentFieldName, Collections.singletonList(parser.objectText())));
@Override public Object objectText() throws IOException { return parser.objectText(); }
@Override protected Template createSimpleScript(XContentParser parser) throws IOException { return new Template(String.valueOf(parser.objectText()), ScriptType.INLINE, MustacheScriptEngineService.NAME, contentType, null); }
} else if (token.isValue()) { if (MatchQueryBuilder.QUERY_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { value = parser.objectText(); } else if (MatchQueryBuilder.ANALYZER_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { analyzer = parser.text(); throwParsingExceptionOnMultipleFields(NAME, parser.getTokenLocation(), fieldName, parser.currentName()); fieldName = parser.currentName(); value = parser.objectText();
} else if (token.isValue()) { if (MatchQueryBuilder.QUERY_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { value = parser.objectText(); } else if (MatchQueryBuilder.ANALYZER_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { analyzer = parser.text(); throwParsingExceptionOnMultipleFields(NAME, parser.getTokenLocation(), fieldName, parser.currentName()); fieldName = parser.currentName(); value = parser.objectText();
} else if (token.isValue()) { if (QUERY_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { value = parser.objectText(); } else if (ANALYZER_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { analyzer = parser.text(); throwParsingExceptionOnMultipleFields(NAME, parser.getTokenLocation(), fieldName, parser.currentName()); fieldName = parser.currentName(); value = parser.objectText();
private void parseMissingAndAdd(final String aggregationName, final String currentFieldName, XContentParser parser, final Map<String, Object> missing) throws IOException { XContentParser.Token token = parser.currentToken(); if (token == null) { token = parser.nextToken(); } if (token == XContentParser.Token.FIELD_NAME) { final String fieldName = parser.currentName(); if (missing.containsKey(fieldName)) { throw new ParsingException(parser.getTokenLocation(), "Missing field [" + fieldName + "] already defined as [" + missing.get(fieldName) + "] in [" + aggregationName + "]."); } parser.nextToken(); missing.put(fieldName, parser.objectText()); } else { throw new ParsingException(parser.getTokenLocation(), "Unexpected token " + token + " [" + currentFieldName + "] in [" + aggregationName + "]"); } }
text = parser.objectText(); } else if (ANALYZER_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { analyzer = parser.text(); throwParsingExceptionOnMultipleFields(NAME, parser.getTokenLocation(), fieldName, parser.currentName()); fieldName = parser.currentName(); text = parser.objectText();
private void parseMissingAndAdd(final String aggregationName, final String currentFieldName, XContentParser parser, final Map<String, Object> missing) throws IOException { XContentParser.Token token = parser.currentToken(); if (token == null) { token = parser.nextToken(); } if (token == XContentParser.Token.FIELD_NAME) { final String fieldName = parser.currentName(); if (missing.containsKey(fieldName)) { throw new ParsingException(parser.getTokenLocation(), "Missing field [" + fieldName + "] already defined as [" + missing.get(fieldName) + "] in [" + aggregationName + "]."); } parser.nextToken(); missing.put(fieldName, parser.objectText()); } else { throw new ParsingException(parser.getTokenLocation(), "Unexpected token " + token + " [" + currentFieldName + "] in [" + aggregationName + "]"); } }
value = parser.objectText(); } else if (TYPE_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { type = MultiMatchQueryBuilder.Type.parse(parser.text(), parser.getDeprecationHandler());
found = parser.booleanValue(); } else { fields.put(currentFieldName, new DocumentField(currentFieldName, Collections.singletonList(parser.objectText())));
found = parser.booleanValue(); } else { fields.put(currentFieldName, new GetField(currentFieldName, Collections.singletonList(parser.objectText())));
found = parser.booleanValue(); } else { fields.put(currentFieldName, new DocumentField(currentFieldName, Collections.singletonList(parser.objectText())));
leftover.put(currentFieldName, parser.objectText());
public boolean token(String currentFieldName, XContentParser.Token token, XContentParser parser) throws IOException { if ("missing".equals(currentFieldName) && token.isValue()) { input.missing = parser.objectText(); return true;
} else if (token.isValue()) { if (MatchQueryBuilder.QUERY_FIELD.match(currentFieldName)) { value = parser.objectText(); } else if (MatchQueryBuilder.ANALYZER_FIELD.match(currentFieldName)) { analyzer = parser.text(); throwParsingExceptionOnMultipleFields(NAME, parser.getTokenLocation(), fieldName, parser.currentName()); fieldName = parser.currentName(); value = parser.objectText();
} else if (token.isValue()) { if (MatchQueryBuilder.QUERY_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { value = parser.objectText(); } else if (MatchQueryBuilder.ANALYZER_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { analyzer = parser.text(); throwParsingExceptionOnMultipleFields(NAME, parser.getTokenLocation(), fieldName, parser.currentName()); fieldName = parser.currentName(); value = parser.objectText();
} else if (token.isValue()) { if (MatchQueryBuilder.QUERY_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { value = parser.objectText(); } else if (MatchQueryBuilder.ANALYZER_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { analyzer = parser.text(); throwParsingExceptionOnMultipleFields(NAME, parser.getTokenLocation(), fieldName, parser.currentName()); fieldName = parser.currentName(); value = parser.objectText();
} else if (token.isValue()) { if (MatchQueryBuilder.QUERY_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { value = parser.objectText(); } else if (MatchQueryBuilder.ANALYZER_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { analyzer = parser.text(); throwParsingExceptionOnMultipleFields(NAME, parser.getTokenLocation(), fieldName, parser.currentName()); fieldName = parser.currentName(); value = parser.objectText();
} else if (token.isValue()) { if (MatchQueryBuilder.QUERY_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { value = parser.objectText(); } else if (MatchQueryBuilder.ANALYZER_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { analyzer = parser.text(); throwParsingExceptionOnMultipleFields(NAME, parser.getTokenLocation(), fieldName, parser.currentName()); fieldName = parser.currentName(); value = parser.objectText();