本文整理了Java中org.apache.lucene.search.QueryCachingPolicy.shouldCache
方法的一些代码示例,展示了QueryCachingPolicy.shouldCache
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryCachingPolicy.shouldCache
方法的具体详情如下:
包路径:org.apache.lucene.search.QueryCachingPolicy
类名称:QueryCachingPolicy
方法名:shouldCache
[英]Whether the given Query is worth caching. This method will be called by the QueryCache to know whether to cache. It will first attempt to load a DocIdSet from the cache. If it is not cached yet and this method returns true then a cache entry will be generated. Otherwise an uncached scorer will be returned.
[中]给定的查询是否值得缓存。QueryCache将调用此方法以了解是否要缓存。它将首先尝试从缓存加载DocIdSet。如果它还没有被缓存,并且这个方法返回true,那么将生成一个缓存条目。否则将返回一个未缓存的得分手。
代码示例来源:origin: org.apache.lucene/lucene-core
if (policy.shouldCache(in.getQuery())) {
docIdSet = cache(context);
putIfAbsent(in.getQuery(), context, docIdSet, cacheHelper);
代码示例来源:origin: org.apache.lucene/lucene-core
if (policy.shouldCache(in.getQuery())) {
docIdSet = cache(context);
putIfAbsent(in.getQuery(), context, docIdSet, cacheHelper);
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
@Override
public boolean shouldCache(Query query) throws IOException {
if (query.getClass() == TermQuery.class) {
return false;
}
return in.shouldCache(query);
}
代码示例来源:origin: harbby/presto-connectors
@Override
public boolean shouldCache(Query query, LeafReaderContext ctx) throws IOException {
if (query.getClass() == TermQuery.class) {
return false;
}
return in.shouldCache(query, ctx);
}
代码示例来源:origin: org.infinispan/infinispan-embedded-query
private boolean shouldCache(LeafReaderContext context) throws IOException {
return cacheEntryHasReasonableWorstCaseSize(ReaderUtil.getTopLevelContext(context).reader().maxDoc())
&& policy.shouldCache(in.getQuery(), context);
}
代码示例来源:origin: harbby/presto-connectors
private boolean shouldCache(LeafReaderContext context) throws IOException {
return cacheEntryHasReasonableWorstCaseSize(ReaderUtil.getTopLevelContext(context).reader().maxDoc())
&& policy.shouldCache(in.getQuery(), context);
}
代码示例来源:origin: harbby/presto-connectors
if (docIdSet != null) {
hitCount++;
} else if (policy.shouldCache(query, context)) {
missCount++;
final Scorer scorer = weight.scorer(context);
代码示例来源:origin: org.infinispan/infinispan-embedded-query
if (docIdSet != null) {
hitCount++;
} else if (policy.shouldCache(query, context)) {
missCount++;
final Scorer scorer = weight.scorer(context);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene
if (policy.shouldCache(in.getQuery())) {
docIdSet = cache(context);
putIfAbsent(in.getQuery(), context, docIdSet, cacheHelper);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene
if (policy.shouldCache(in.getQuery())) {
docIdSet = cache(context);
putIfAbsent(in.getQuery(), context, docIdSet, cacheHelper);
内容来源于网络,如有侵权,请联系作者删除!