当前位置: 首页>>代码示例>>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;未经允许,请勿转载。