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