本文整理匯總了Java中org.elasticsearch.common.xcontent.XContentType.readFrom方法的典型用法代碼示例。如果您正苦於以下問題:Java XContentType.readFrom方法的具體用法?Java XContentType.readFrom怎麽用?Java XContentType.readFrom使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.elasticsearch.common.xcontent.XContentType
的用法示例。
在下文中一共展示了XContentType.readFrom方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: PercolateQueryBuilder
import org.elasticsearch.common.xcontent.XContentType; //導入方法依賴的package包/類
/**
* Read from a stream.
*/
PercolateQueryBuilder(StreamInput in) throws IOException {
super(in);
field = in.readString();
documentType = in.readString();
indexedDocumentIndex = in.readOptionalString();
indexedDocumentType = in.readOptionalString();
indexedDocumentId = in.readOptionalString();
indexedDocumentRouting = in.readOptionalString();
indexedDocumentPreference = in.readOptionalString();
if (in.readBoolean()) {
indexedDocumentVersion = in.readVLong();
} else {
indexedDocumentVersion = null;
}
document = in.readOptionalBytesReference();
if (document != null) {
if (in.getVersion().onOrAfter(Version.V_5_3_0_UNRELEASED)) {
documentXContentType = XContentType.readFrom(in);
} else {
documentXContentType = XContentFactory.xContentType(document);
}
} else {
documentXContentType = null;
}
}
示例2: Item
import org.elasticsearch.common.xcontent.XContentType; //導入方法依賴的package包/類
/**
* Read from a stream.
*/
Item(StreamInput in) throws IOException {
index = in.readOptionalString();
type = in.readOptionalString();
if (in.readBoolean()) {
doc = (BytesReference) in.readGenericValue();
if (in.getVersion().onOrAfter(Version.V_5_3_0_UNRELEASED)) {
xContentType = XContentType.readFrom(in);
} else {
xContentType = XContentFactory.xContentType(doc);
}
} else {
id = in.readString();
}
fields = in.readOptionalStringArray();
perFieldAnalyzer = (Map<String, String>) in.readGenericValue();
routing = in.readOptionalString();
version = in.readLong();
versionType = VersionType.readFromStream(in);
}
示例3: readFrom
import org.elasticsearch.common.xcontent.XContentType; //導入方法依賴的package包/類
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
lang = in.readString();
if (lang.isEmpty()) {
lang = null;
}
id = in.readOptionalString();
content = in.readBytesReference();
if (in.getVersion().onOrAfter(Version.V_5_3_0_UNRELEASED)) {
xContentType = XContentType.readFrom(in);
} else {
xContentType = XContentFactory.xContentType(content);
}
}
示例4: readFrom
import org.elasticsearch.common.xcontent.XContentType; //導入方法依賴的package包/類
public static PipelineConfiguration readFrom(StreamInput in) throws IOException {
if (in.getVersion().onOrAfter(Version.V_5_3_0_UNRELEASED)) {
return new PipelineConfiguration(in.readString(), in.readBytesReference(), XContentType.readFrom(in));
} else {
final String id = in.readString();
final BytesReference config = in.readBytesReference();
return new PipelineConfiguration(id, config, XContentFactory.xContentType(config));
}
}
示例5: readFrom
import org.elasticsearch.common.xcontent.XContentType; //導入方法依賴的package包/類
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
id = in.readOptionalString();
verbose = in.readBoolean();
source = in.readBytesReference();
if (in.getVersion().onOrAfter(Version.V_5_3_0_UNRELEASED)) {
xContentType = XContentType.readFrom(in);
} else {
xContentType = XContentFactory.xContentType(source);
}
}
示例6: readFrom
import org.elasticsearch.common.xcontent.XContentType; //導入方法依賴的package包/類
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
id = in.readString();
source = in.readBytesReference();
if (in.getVersion().onOrAfter(Version.V_5_3_0_UNRELEASED)) {
xContentType = XContentType.readFrom(in);
} else {
xContentType = XContentFactory.xContentType(source);
}
}
示例7: readFrom
import org.elasticsearch.common.xcontent.XContentType; //導入方法依賴的package包/類
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
type = in.readString();
id = in.readString();
if (in.readBoolean()) {
doc = in.readBytesReference();
if (in.getVersion().onOrAfter(Version.V_5_3_0_UNRELEASED)) {
xContentType = XContentType.readFrom(in);
} else {
xContentType = XContentFactory.xContentType(doc);
}
}
routing = in.readOptionalString();
parent = in.readOptionalString();
preference = in.readOptionalString();
long flags = in.readVLong();
flagsEnum.clear();
for (Flag flag : Flag.values()) {
if ((flags & (1 << flag.ordinal())) != 0) {
flagsEnum.add(flag);
}
}
int numSelectedFields = in.readVInt();
if (numSelectedFields > 0) {
selectedFields = new HashSet<>();
for (int i = 0; i < numSelectedFields; i++) {
selectedFields.add(in.readString());
}
}
if (in.readBoolean()) {
perFieldAnalyzer = readPerFieldAnalyzer(in.readMap());
}
if (in.readBoolean()) {
filterSettings = new FilterSettings();
filterSettings.readFrom(in);
}
realtime = in.readBoolean();
versionType = VersionType.fromValue(in.readByte());
version = in.readLong();
}
示例8: doReadFrom
import org.elasticsearch.common.xcontent.XContentType; //導入方法依賴的package包/類
@Override
protected void doReadFrom(StreamInput in) throws IOException {
if (in.readBoolean()) {
this.contentType = XContentType.readFrom(in);
}
}