本文整理汇总了Java中org.lemurproject.galago.core.index.Index类的典型用法代码示例。如果您正苦于以下问题:Java Index类的具体用法?Java Index怎么用?Java Index使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Index类属于org.lemurproject.galago.core.index包,在下文中一共展示了Index类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LocalRetrieval
import org.lemurproject.galago.core.index.Index; //导入依赖的package包/类
public LocalRetrieval(Index index, Parameters parameters) {
this.globalParameters = parameters;
setIndex(index);
long namesCacheSize = globalParameters.get("namesCacheSize", 0L);
if(namesCacheSize > 0) {
nameCache = Caffeine.newBuilder()
.maximumSize(namesCacheSize)
.build();
}
long nodeStatsCacheSize = globalParameters.get("nodeStatisticsCacheSize", 100_000L);
if(nodeStatsCacheSize > 0) {
nodeStatisticsCache = Caffeine.newBuilder()
.maximumSize(nodeStatsCacheSize)
.build();
}
}
示例2: setIndex
import org.lemurproject.galago.core.index.Index; //导入依赖的package包/类
protected void setIndex(Index indx) {
try {
this.index = indx;
features = new FeatureFactory(globalParameters);
defaultTraversals = features.getTraversals(this);
if(nodeStatisticsCache != null) nodeStatisticsCache.invalidateAll();
if(nameCache != null) nameCache.invalidateAll();
cache = null;
if (this.globalParameters.get("cache", false)) {
cache = new CachedRetrieval(this.globalParameters);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
示例3: names
import org.lemurproject.galago.core.index.Index; //导入依赖的package包/类
public static List<String> names(Retrieval ret) throws IOException {
ArrayList<String> out = new ArrayList<>();
assert(ret instanceof LocalRetrieval);
Index index = ((LocalRetrieval) ret).getIndex();
int numNames = (int) index.getIndexPart("names").getManifest().getLong("keyCount");
out.ensureCapacity(numNames);
for (String name : asIterable(index.getNamesIterator())) {
out.add(name);
}
return out;
}
示例4: getIndex
import org.lemurproject.galago.core.index.Index; //导入依赖的package包/类
public Index getIndex() {
return index;
}