當前位置: 首頁>>代碼示例>>Java>>正文


Java XContentType.readFrom方法代碼示例

本文整理匯總了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;
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:29,代碼來源:PercolateQueryBuilder.java

示例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);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:23,代碼來源:MoreLikeThisQueryBuilder.java

示例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);
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:19,代碼來源:PutStoredScriptRequest.java

示例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));
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:10,代碼來源:PipelineConfiguration.java

示例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);
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:13,代碼來源:SimulatePipelineRequest.java

示例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);
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:12,代碼來源:PutPipelineRequest.java

示例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();
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:44,代碼來源:TermVectorsRequest.java

示例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);
    }
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:7,代碼來源:Template.java


注:本文中的org.elasticsearch.common.xcontent.XContentType.readFrom方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。