本文整理汇总了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()));
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例6: testNamedXContents
import org.elasticsearch.common.xcontent.NamedXContentRegistry; //导入方法依赖的package包/类
public void testNamedXContents() {
List<NamedXContentRegistry.Entry> namedXContents = RestHighLevelClient.getNamedXContents();
assertEquals(0, namedXContents.size());
}
示例7: getNamedXContents
import org.elasticsearch.common.xcontent.NamedXContentRegistry; //导入方法依赖的package包/类
public List<NamedXContentRegistry.Entry> getNamedXContents() {
return namedXContents;
}
示例8: getNamedXContents
import org.elasticsearch.common.xcontent.NamedXContentRegistry; //导入方法依赖的package包/类
public static List<NamedXContentRegistry.Entry> getNamedXContents() {
return Collections.unmodifiableList(namedXContents);
}
示例9: getNamedXContent
import org.elasticsearch.common.xcontent.NamedXContentRegistry; //导入方法依赖的package包/类
@Override
public List<NamedXContentRegistry.Entry> getNamedXContent() {
return namedXContents;
}
示例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();
}