List of usage examples for org.apache.lucene.search QueryCache doCache
Weight doCache(Weight weight, QueryCachingPolicy policy);
weight that will cache matching docs per-segment accordingly to the given policy. From source file:com.lucene.MyIndexSearcher.java
License:Apache License
public Weight createWeight(Query query, boolean needsScores) throws IOException { final QueryCache queryCache = this.queryCache; Weight weight = query.createWeight(this, needsScores); if (!needsScores && queryCache != null) { weight = queryCache.doCache(weight, queryCachingPolicy); }/*from w w w. j av a 2 s .c o m*/ return weight; }