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
.IOException
public Query rewrite(IndexReader reader) throws IOException
Query
rewrite
in class Query
IOException
public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException
Query
Only implemented by primitive queries, which re-write to themselves.
createWeight
in class Query
needsScores
- True if document scores (Scorer.score()
) or match
frequencies (Scorer.freq()
) are needed.IOException
public String toString(String field)
Query
field
assumed to be the
default field and omitted.public long ramBytesUsed()
Accountable
ramBytesUsed
in interface Accountable
public Collection<Accountable> getChildResources()
Accountable
getChildResources
in interface Accountable
Accountables
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.