public static HighlightField readHighlightField(StreamInput in) throws IOException { HighlightField field = new HighlightField(); field.readFrom(in); return field; }
public static HighlightField fromXContent(XContentParser parser) throws IOException { ensureExpectedToken(XContentParser.Token.FIELD_NAME, parser.currentToken(), parser::getTokenLocation); String fieldName = parser.currentName(); Text[] fragments = null; XContentParser.Token token = parser.nextToken(); if (token == XContentParser.Token.START_ARRAY) { List<Text> values = new ArrayList<>(); while (parser.nextToken() != XContentParser.Token.END_ARRAY) { values.add(new Text(parser.text())); } fragments = values.toArray(new Text[values.size()]); } else if (token == XContentParser.Token.VALUE_NULL) { fragments = null; } else { throw new ParsingException(parser.getTokenLocation(), "unexpected token type [" + token + "]"); } return new HighlightField(fieldName, fragments); }
return new HighlightField(highlighterContext.fieldName, Text.convertFromStringArray(fragments)); return new HighlightField(highlighterContext.fieldName, new Text[] { new Text(fieldContents.substring(0, end)) });
new HighlightField(fieldName, highlightField.fragments()));
return new HighlightField(highlighterContext.fieldName, Text.convertFromStringArray(fragments));
public static HighlightField readHighlightField(StreamInput in) throws IOException { HighlightField field = new HighlightField(); field.readFrom(in); return field; }
public static HighlightField readHighlightField(StreamInput in) throws IOException { HighlightField field = new HighlightField(); field.readFrom(in); return field; }
public static HighlightField readHighlightField(StreamInput in) throws IOException { HighlightField field = new HighlightField(); field.readFrom(in); return field; }
return new HighlightField(highlighterContext.fieldName, Text.convertFromStringArray(fragments)); field.fieldOptions().postTags(), encoder); if (fragments != null && fragments.length > 0) { return new HighlightField(highlighterContext.fieldName, Text.convertFromStringArray(fragments));
public static HighlightField fromXContent(XContentParser parser) throws IOException { ensureExpectedToken(XContentParser.Token.FIELD_NAME, parser.currentToken(), parser::getTokenLocation); String fieldName = parser.currentName(); Text[] fragments = null; XContentParser.Token token = parser.nextToken(); if (token == XContentParser.Token.START_ARRAY) { List<Text> values = new ArrayList<>(); while (parser.nextToken() != XContentParser.Token.END_ARRAY) { values.add(new Text(parser.text())); } fragments = values.toArray(new Text[values.size()]); } else if (token == XContentParser.Token.VALUE_NULL) { fragments = null; } else { throw new ParsingException(parser.getTokenLocation(), "unexpected token type [" + token + "]"); } return new HighlightField(fieldName, fragments); }
public static HighlightField fromXContent(XContentParser parser) throws IOException { ensureExpectedToken(XContentParser.Token.FIELD_NAME, parser.currentToken(), parser::getTokenLocation); String fieldName = parser.currentName(); Text[] fragments = null; XContentParser.Token token = parser.nextToken(); if (token == XContentParser.Token.START_ARRAY) { List<Text> values = new ArrayList<>(); while (parser.nextToken() != XContentParser.Token.END_ARRAY) { values.add(new Text(parser.text())); } fragments = values.toArray(new Text[values.size()]); } else if (token == XContentParser.Token.VALUE_NULL) { fragments = null; } else { throw new ParsingException(parser.getTokenLocation(), "unexpected token type [" + token + "]"); } return new HighlightField(fieldName, fragments); }
public static HighlightField fromXContent(XContentParser parser) throws IOException { ensureExpectedToken(XContentParser.Token.FIELD_NAME, parser.currentToken(), parser::getTokenLocation); String fieldName = parser.currentName(); Text[] fragments = null; XContentParser.Token token = parser.nextToken(); if (token == XContentParser.Token.START_ARRAY) { List<Text> values = new ArrayList<>(); while (parser.nextToken() != XContentParser.Token.END_ARRAY) { values.add(new Text(parser.text())); } fragments = values.toArray(new Text[values.size()]); } else if (token == XContentParser.Token.VALUE_NULL) { fragments = null; } else { throw new ParsingException(parser.getTokenLocation(), "unexpected token type [" + token + "]"); } return new HighlightField(fieldName, fragments); }
hlFieldName = percolateQuery.getName() + "_" + entry.getKey(); hit.getHighlightFields().put(hlFieldName, new HighlightField(hlFieldName, entry.getValue().fragments())); } else { hlFieldName = percolateQuery.getName() + "_" + slot + "_" + entry.getKey(); hit.getHighlightFields().put(hlFieldName, new HighlightField(hlFieldName, entry.getValue().fragments()));
hlFieldName = percolateQuery.getName() + "_" + entry.getKey(); hit.getHighlightFields().put(hlFieldName, new HighlightField(hlFieldName, entry.getValue().fragments())); } else { hlFieldName = percolateQuery.getName() + "_" + slot + "_" + entry.getKey(); hit.getHighlightFields().put(hlFieldName, new HighlightField(hlFieldName, entry.getValue().fragments()));
return new HighlightField(highlighterContext.fieldName, Text.convertFromStringArray(fragments));
new HighlightField(fieldName, highlightField.fragments()));
new HighlightField(fieldName, highlightField.fragments()));
return new HighlightField(highlighterContext.fieldName, Text.convertFromStringArray(fragments));
return new HighlightField(highlighterContext.fieldName, Text.convertFromStringArray(fragments));
return new HighlightField(highlighterContext.fieldName, Text.convertFromStringArray(fragments));