本文整理汇总了Java中org.apache.lucene.facet.FacetsConfig.DimConfig方法的典型用法代码示例。如果您正苦于以下问题:Java FacetsConfig.DimConfig方法的具体用法?Java FacetsConfig.DimConfig怎么用?Java FacetsConfig.DimConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.lucene.facet.FacetsConfig
的用法示例。
在下文中一共展示了FacetsConfig.DimConfig方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAllDims
import org.apache.lucene.facet.FacetsConfig; //导入方法依赖的package包/类
@Override
public List<FacetResult> getAllDims(int topN) throws IOException {
int ord = children[TaxonomyReader.ROOT_ORDINAL];
List<FacetResult> results = new ArrayList<>();
while (ord != TaxonomyReader.INVALID_ORDINAL) {
String dim = taxoReader.getPath(ord).components[0];
FacetsConfig.DimConfig dimConfig = config.getDimConfig(dim);
if (dimConfig.indexFieldName.equals(indexFieldName)) {
FacetResult result = getTopChildren(topN, dim);
if (result != null) {
results.add(result);
}
}
ord = siblings[ord];
}
// Sort by highest value, tie break by dim:
Collections.sort(results, BY_VALUE_THEN_DIM);
return results;
}
示例2: getAllDims
import org.apache.lucene.facet.FacetsConfig; //导入方法依赖的package包/类
@Override
public List<FacetResult> getAllDims(int topN) throws IOException {
int ord = children[TaxonomyReader.ROOT_ORDINAL];
List<FacetResult> results = new ArrayList<FacetResult>();
while (ord != TaxonomyReader.INVALID_ORDINAL) {
String dim = taxoReader.getPath(ord).components[0];
FacetsConfig.DimConfig dimConfig = config.getDimConfig(dim);
if (dimConfig.indexFieldName.equals(indexFieldName)) {
FacetResult result = getTopChildren(topN, dim);
if (result != null) {
results.add(result);
}
}
ord = siblings[ord];
}
// Sort by highest value, tie break by dim:
Collections.sort(results, BY_VALUE_THEN_DIM);
return results;
}
示例3: verifyDim
import org.apache.lucene.facet.FacetsConfig; //导入方法依赖的package包/类
/** Throws {@code IllegalArgumentException} if the
* dimension is not recognized. Otherwise, returns the
* {@link DimConfig} for this dimension. */
protected FacetsConfig.DimConfig verifyDim(String dim) {
FacetsConfig.DimConfig dimConfig = config.getDimConfig(dim);
if (!dimConfig.indexFieldName.equals(indexFieldName)) {
throw new IllegalArgumentException("dimension \"" + dim + "\" was not indexed into field \"" + indexFieldName);
}
return dimConfig;
}
示例4: verifyDim
import org.apache.lucene.facet.FacetsConfig; //导入方法依赖的package包/类
protected FacetsConfig.DimConfig verifyDim(String dim) {
return this.config.getDimConfig(dim);
}