java.lang.Object
org.elasticsearch.index.mapper.XContentDataHelper
Helper class for processing field data of any type, as provided by the
XContentParser.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddecodeAndWriteXContent(XContentParserConfiguration parserConfig, XContentBuilder b, XContentType type, org.apache.lucene.util.BytesRef r) static org.apache.lucene.util.BytesRefencodeXContentBuilder(XContentBuilder builder) Build aBytesRefwrapping a byte array containing an encoded form of the passed XContentBuilder contents.static XContentTypegetXContentType(org.apache.lucene.util.BytesRef r) Returns theXContentTypeto use for creating an XContentBuilder to decode the passed value.static booleanisDataPresent(org.apache.lucene.util.BytesRef encoded) static org.apache.lucene.util.BytesRefReturns a special encoded value that signals that this field should not be present in synthetic source.
-
Constructor Details
-
XContentDataHelper
public XContentDataHelper()
-
-
Method Details
-
encodeXContentBuilder
public static org.apache.lucene.util.BytesRef encodeXContentBuilder(XContentBuilder builder) throws IOException Build aBytesRefwrapping a byte array containing an encoded form of the passed XContentBuilder contents.- Throws:
IOException
-
voidValue
public static org.apache.lucene.util.BytesRef voidValue()Returns a special encoded value that signals that this field should not be present in synthetic source. An example is a field that has values copied to it using copy_to. While that field "looks" like a regular field it should not be present in synthetic _source same as it wouldn't be present in stored source.- Returns:
-
isDataPresent
public static boolean isDataPresent(org.apache.lucene.util.BytesRef encoded) -
getXContentType
Returns theXContentTypeto use for creating an XContentBuilder to decode the passed value. -
decodeAndWriteXContent
public static void decodeAndWriteXContent(XContentParserConfiguration parserConfig, XContentBuilder b, XContentType type, org.apache.lucene.util.BytesRef r) throws IOException - Throws:
IOException
-