当前位置: 首页>>代码示例>>Java>>正文


Java NamedXContentRegistry.Entry方法代码示例

本文整理汇总了Java中org.elasticsearch.common.xcontent.NamedXContentRegistry.Entry方法的典型用法代码示例。如果您正苦于以下问题:Java NamedXContentRegistry.Entry方法的具体用法?Java NamedXContentRegistry.Entry怎么用?Java NamedXContentRegistry.Entry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.common.xcontent.NamedXContentRegistry的用法示例。


在下文中一共展示了NamedXContentRegistry.Entry方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RestHighLevelClient

import org.elasticsearch.common.xcontent.NamedXContentRegistry; //导入方法依赖的package包/类
/**
 * Creates a {@link RestHighLevelClient} given the low level {@link RestClient} that it should use to perform requests and
 * a list of entries that allow to parse custom response sections added to Elasticsearch through plugins.
 */
protected RestHighLevelClient(RestClient restClient, List<NamedXContentRegistry.Entry> namedXContentEntries) {
    this.client = Objects.requireNonNull(restClient);
    this.registry = new NamedXContentRegistry(Stream.of(
            getNamedXContents().stream(),
            namedXContentEntries.stream()
    ).flatMap(Function.identity()).collect(toList()));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:RestHighLevelClient.java

示例2: getNamedXContentsExt

import org.elasticsearch.common.xcontent.NamedXContentRegistry; //导入方法依赖的package包/类
private static List<NamedXContentRegistry.Entry> getNamedXContentsExt() {
    List<NamedXContentRegistry.Entry> entries = new ArrayList<>();
    entries.add(new NamedXContentRegistry.Entry(BaseCustomResponseSection.class, new ParseField("custom1"),
            CustomResponseSection1::fromXContent));
    entries.add(new NamedXContentRegistry.Entry(BaseCustomResponseSection.class, new ParseField("custom2"),
            CustomResponseSection2::fromXContent));
    return entries;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:RestHighLevelClientExtTests.java

示例3: getNamedXWriteables

import org.elasticsearch.common.xcontent.NamedXContentRegistry; //导入方法依赖的package包/类
public static List<NamedXContentRegistry.Entry> getNamedXWriteables() {
    List<NamedXContentRegistry.Entry> entries = new ArrayList<>();
    // Metadata
    entries.add(new NamedXContentRegistry.Entry(MetaData.Custom.class, new ParseField(RepositoriesMetaData.TYPE),
        RepositoriesMetaData::fromXContent));
    entries.add(new NamedXContentRegistry.Entry(MetaData.Custom.class, new ParseField(IngestMetadata.TYPE),
        IngestMetadata::fromXContent));
    entries.add(new NamedXContentRegistry.Entry(MetaData.Custom.class, new ParseField(ScriptMetaData.TYPE),
        ScriptMetaData::fromXContent));
    entries.add(new NamedXContentRegistry.Entry(MetaData.Custom.class, new ParseField(IndexGraveyard.TYPE),
        IndexGraveyard::fromXContent));
    return entries;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:14,代码来源:ClusterModule.java

示例4: getSuggestersRegistry

import org.elasticsearch.common.xcontent.NamedXContentRegistry; //导入方法依赖的package包/类
static NamedXContentRegistry getSuggestersRegistry() {
    List<NamedXContentRegistry.Entry> namedXContents = new ArrayList<>();
    namedXContents.add(new NamedXContentRegistry.Entry(Suggest.Suggestion.class, new ParseField("term"),
            (parser, context) -> TermSuggestion.fromXContent(parser, (String)context)));
    namedXContents.add(new NamedXContentRegistry.Entry(Suggest.Suggestion.class, new ParseField("phrase"),
            (parser, context) -> PhraseSuggestion.fromXContent(parser, (String)context)));
    namedXContents.add(new NamedXContentRegistry.Entry(Suggest.Suggestion.class, new ParseField("completion"),
            (parser, context) -> CompletionSuggestion.fromXContent(parser, (String)context)));
    return new NamedXContentRegistry(namedXContents);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:SuggestTests.java

示例5: getNamedXContents

import org.elasticsearch.common.xcontent.NamedXContentRegistry; //导入方法依赖的package包/类
static List<NamedXContentRegistry.Entry> getNamedXContents() {
    List<NamedXContentRegistry.Entry> namedXContents = new ArrayList<>();
    //namedXContents.add(new NamedXContentRegistry.Entry(Aggregation.class, new ParseField("sterms"), StringTerms::fromXContent));
    return namedXContents;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:RestHighLevelClient.java

示例6: testNamedXContents

import org.elasticsearch.common.xcontent.NamedXContentRegistry; //导入方法依赖的package包/类
public void testNamedXContents() {
    List<NamedXContentRegistry.Entry> namedXContents = RestHighLevelClient.getNamedXContents();
    assertEquals(0, namedXContents.size());
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:RestHighLevelClientTests.java

示例7: getNamedXContents

import org.elasticsearch.common.xcontent.NamedXContentRegistry; //导入方法依赖的package包/类
public List<NamedXContentRegistry.Entry> getNamedXContents() {
    return namedXContents;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:4,代码来源:SearchModule.java

示例8: getNamedXContents

import org.elasticsearch.common.xcontent.NamedXContentRegistry; //导入方法依赖的package包/类
public static List<NamedXContentRegistry.Entry> getNamedXContents() {
    return Collections.unmodifiableList(namedXContents);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:4,代码来源:NetworkModule.java

示例9: getNamedXContent

import org.elasticsearch.common.xcontent.NamedXContentRegistry; //导入方法依赖的package包/类
@Override
public List<NamedXContentRegistry.Entry> getNamedXContent() {
    return namedXContents;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:DedicatedClusterSnapshotRestoreIT.java

示例10: getNamedXContent

import org.elasticsearch.common.xcontent.NamedXContentRegistry; //导入方法依赖的package包/类
/**
 * Returns parsers for named objects this plugin will parse from {@link XContentParser#namedObject(Class, String, Object)}.
 * @see NamedWriteableRegistry
 */
public List<NamedXContentRegistry.Entry> getNamedXContent() {
    return Collections.emptyList();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:Plugin.java


注:本文中的org.elasticsearch.common.xcontent.NamedXContentRegistry.Entry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。