本文整理匯總了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);
}