本文整理汇总了Java中org.apache.lucene.facet.search.Heap类的典型用法代码示例。如果您正苦于以下问题:Java Heap类的具体用法?Java Heap怎么用?Java Heap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Heap类属于org.apache.lucene.facet.search包,在下文中一共展示了Heap类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSuitableHeap
import org.apache.lucene.facet.search.Heap; //导入依赖的package包/类
/**
* Create a suitable heap according to facet request being served.
* @return heap for maintaining results for specified request.
* @throws IllegalArgumentException is provided facet request is not supported
*/
public static Heap<FacetResultNode> createSuitableHeap(FacetRequest facetRequest) {
int nresults = facetRequest.numResults;
boolean accending = (facetRequest.getSortOrder() == SortOrder.ASCENDING);
if (nresults == Integer.MAX_VALUE) {
return new AllValueHeap(accending);
}
if (accending) {
return new MaxValueHeap(nresults);
} else {
return new MinValueHeap(nresults);
}
}