本文整理了Java中org.elasticsearch.search.aggregations.AggregationBuilders.scriptedMetric()
方法的一些代码示例,展示了AggregationBuilders.scriptedMetric()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AggregationBuilders.scriptedMetric()
方法的具体详情如下:
包路径:org.elasticsearch.search.aggregations.AggregationBuilders
类名称:AggregationBuilders
方法名:scriptedMetric
[英]Create a new ScriptedMetric aggregation with the given name.
[中]使用给定名称创建新的ScriptedMetric聚合。
代码示例来源:origin: NLPchina/elasticsearch-sql
private AbstractAggregationBuilder scriptedMetric(MethodField field) throws SqlParseException {
String aggName = gettAggNameFromParamsOrAlias(field);
ScriptedMetricAggregationBuilder scriptedMetricBuilder = AggregationBuilders.scriptedMetric(aggName);
Map<String, Object> scriptedMetricParams = field.getParamsAsMap();
if (!scriptedMetricParams.containsKey("map_script") && !scriptedMetricParams.containsKey("map_script_id") && !scriptedMetricParams.containsKey("map_script_file")) {
代码示例来源:origin: org.nlpcn/elasticsearch-sql
private AbstractAggregationBuilder scriptedMetric(MethodField field) throws SqlParseException {
String aggName = gettAggNameFromParamsOrAlias(field);
ScriptedMetricAggregationBuilder scriptedMetricBuilder = AggregationBuilders.scriptedMetric(aggName);
Map<String, Object> scriptedMetricParams = field.getParamsAsMap();
if (!scriptedMetricParams.containsKey("map_script") && !scriptedMetricParams.containsKey("map_script_id") && !scriptedMetricParams.containsKey("map_script_file")) {
代码示例来源:origin: imotov/elasticsearch-native-script-example
.setQuery(matchAllQuery())
.setSize(0)
.addAggregation(scriptedMetric("profit")
.initScript(new Script(ScriptType.INLINE, "native", "stockaggs_init", Collections.emptyMap()))
.mapScript(new Script(ScriptType.INLINE, "native", "stockaggs_map", Collections.emptyMap()))
内容来源于网络,如有侵权,请联系作者删除!