本文整理汇总了Java中org.elasticsearch.search.aggregations.bucket.terms.Terms.Order方法的典型用法代码示例。如果您正苦于以下问题:Java Terms.Order方法的具体用法?Java Terms.Order怎么用?Java Terms.Order使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.elasticsearch.search.aggregations.bucket.terms.Terms
的用法示例。
在下文中一共展示了Terms.Order方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: randomOrder
import org.elasticsearch.search.aggregations.bucket.terms.Terms; //导入方法依赖的package包/类
private List<Terms.Order> randomOrder() {
List<Terms.Order> orders = new ArrayList<>();
switch (randomInt(4)) {
case 0:
orders.add(Terms.Order.term(randomBoolean()));
break;
case 1:
orders.add(Terms.Order.count(randomBoolean()));
break;
case 2:
orders.add(Terms.Order.aggregation(randomAsciiOfLengthBetween(3, 20), randomBoolean()));
break;
case 3:
orders.add(Terms.Order.aggregation(randomAsciiOfLengthBetween(3, 20), randomAsciiOfLengthBetween(3, 20), randomBoolean()));
break;
case 4:
int numOrders = randomIntBetween(1, 3);
for (int i = 0; i < numOrders; i++) {
orders.addAll(randomOrder());
}
break;
default:
fail();
}
return orders;
}
示例2: testMinDocCountOnTerms
import org.elasticsearch.search.aggregations.bucket.terms.Terms; //导入方法依赖的package包/类
private void testMinDocCountOnTerms(String field, Script script, Terms.Order order) throws Exception {
testMinDocCountOnTerms(field, script, order, null, true);
}