Module org.apache.lucene.sandbox
Package org.apache.lucene.sandbox.search
Class QueryProfilerIndexSearcher
- java.lang.Object
-
- org.apache.lucene.search.IndexSearcher
-
- org.apache.lucene.sandbox.search.QueryProfilerIndexSearcher
-
public class QueryProfilerIndexSearcher extends IndexSearcher
An extension ofIndexSearcher
that records profile information for all queries it executes.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.search.IndexSearcher
IndexSearcher.LeafSlice, IndexSearcher.TooManyClauses, IndexSearcher.TooManyNestedClauses
-
-
Field Summary
Fields Modifier and Type Field Description private QueryProfilerTree
profiler
-
Fields inherited from class org.apache.lucene.search.IndexSearcher
leafContexts, readerContext
-
-
Constructor Summary
Constructors Constructor Description QueryProfilerIndexSearcher(IndexReader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Weight
createWeight(Query query, ScoreMode scoreMode, float boost)
Creates aWeight
for the given query, potentially adding caching if possible and configured.java.util.List<QueryProfilerResult>
getProfileResult()
long
getRewriteTime()
Query
rewrite(Query original)
Expert: called to re-write queries into primitive queries.-
Methods inherited from class org.apache.lucene.search.IndexSearcher
collectionStatistics, count, doc, doc, doc, explain, explain, getDefaultQueryCache, getDefaultQueryCachingPolicy, getDefaultSimilarity, getExecutor, getIndexReader, getLeafContexts, getMaxClauseCount, getQueryCache, getQueryCachingPolicy, getSimilarity, getSlices, getTaskExecutor, getTimeout, getTopReaderContext, search, search, search, search, search, search, searchAfter, searchAfter, searchAfter, setDefaultQueryCache, setDefaultQueryCachingPolicy, setMaxClauseCount, setQueryCache, setQueryCachingPolicy, setSimilarity, setTimeout, slices, slices, storedFields, termStatistics, timedOut, toString
-
-
-
-
Field Detail
-
profiler
private final QueryProfilerTree profiler
-
-
Constructor Detail
-
QueryProfilerIndexSearcher
public QueryProfilerIndexSearcher(IndexReader reader)
-
-
Method Detail
-
rewrite
public Query rewrite(Query original) throws java.io.IOException
Description copied from class:IndexSearcher
Expert: called to re-write queries into primitive queries.- Overrides:
rewrite
in classIndexSearcher
- Throws:
java.io.IOException
-
createWeight
public Weight createWeight(Query query, ScoreMode scoreMode, float boost) throws java.io.IOException
Description copied from class:IndexSearcher
Creates aWeight
for the given query, potentially adding caching if possible and configured.- Overrides:
createWeight
in classIndexSearcher
- Throws:
java.io.IOException
-
getRewriteTime
public long getRewriteTime()
- Returns:
- total time taken to rewrite all queries in this profile
-
getProfileResult
public java.util.List<QueryProfilerResult> getProfileResult()
- Returns:
- a hierarchical representation of the profiled tree
-
-