QueryCache instead, such as LRUQueryCache.@Deprecated public class CachingWrapperQuery extends Query implements Accountable, Cloneable
Query's result and caches it when scores are not
needed. The purpose is to allow queries to simply care about matching and
scoring, and then wrap with this class to add caching.| Constructor and Description |
|---|
CachingWrapperQuery(Query query)
Deprecated.
Same as
CachingWrapperQuery(Query, QueryCachingPolicy)
but enforces the use of the
QueryCachingPolicy.CacheOnLargeSegments.DEFAULT policy. |
CachingWrapperQuery(Query query,
QueryCachingPolicy policy)
Deprecated.
Wraps another query's result and caches it according to the provided policy.
|
| Modifier and Type | Method and Description |
|---|---|
protected DocIdSet |
cacheImpl(DocIdSetIterator iterator,
LeafReader reader)
Deprecated.
Default cache implementation: uses
RoaringDocIdSet. |
Weight |
createWeight(IndexSearcher searcher,
boolean needsScores)
Deprecated.
Expert: Constructs an appropriate Weight implementation for this query.
|
boolean |
equals(Object o)
Deprecated.
|
Collection<Accountable> |
getChildResources()
Deprecated.
Returns nested resources of this class.
|
Query |
getQuery()
Deprecated.
Gets the contained query.
|
int |
hashCode()
Deprecated.
|
long |
ramBytesUsed()
Deprecated.
Return the memory usage of this object in bytes.
|
Query |
rewrite(IndexReader reader)
Deprecated.
Expert: called to re-write queries into primitive queries.
|
String |
toString(String field)
Deprecated.
Prints a query to a string, with
field assumed to be the
default field and omitted. |
public CachingWrapperQuery(Query query, QueryCachingPolicy policy)
query - Query to cache results ofpolicy - policy defining which filters should be cached on which segmentspublic CachingWrapperQuery(Query query)
CachingWrapperQuery(Query, QueryCachingPolicy)
but enforces the use of the
QueryCachingPolicy.CacheOnLargeSegments.DEFAULT policy.public Query getQuery()
protected DocIdSet cacheImpl(DocIdSetIterator iterator, LeafReader reader) throws IOException
RoaringDocIdSet.IOExceptionpublic Query rewrite(IndexReader reader) throws IOException
Queryrewrite in class QueryIOExceptionpublic Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException
QueryOnly implemented by primitive queries, which re-write to themselves.
createWeight in class QueryneedsScores - True if document scores (Scorer.score()) or match
frequencies (Scorer.freq()) are needed.IOExceptionpublic String toString(String field)
Queryfield assumed to be the
default field and omitted.public long ramBytesUsed()
AccountableramBytesUsed in interface Accountablepublic Collection<Accountable> getChildResources()
AccountablegetChildResources in interface AccountableAccountablesCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.