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 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)
List<QueryProfilerResult>
getProfileResult()
long
getRewriteTime()
Query
rewrite(Query original)
-
Methods inherited from class org.apache.lucene.search.IndexSearcher
collectionStatistics, count, doc, doc, doc, explain, explain, getDefaultQueryCache, getDefaultQueryCachingPolicy, getDefaultSimilarity, getExecutor, getIndexReader, getMaxClauseCount, getQueryCache, getQueryCachingPolicy, getSimilarity, getSlices, getTopReaderContext, search, search, search, search, search, search, searchAfter, searchAfter, searchAfter, setDefaultQueryCache, setDefaultQueryCachingPolicy, setMaxClauseCount, setQueryCache, setQueryCachingPolicy, setSimilarity, slices, slices, termStatistics, toString
-
-
-
-
Constructor Detail
-
QueryProfilerIndexSearcher
public QueryProfilerIndexSearcher(IndexReader reader)
-
-
Method Detail
-
rewrite
public Query rewrite(Query original) throws IOException
- Overrides:
rewrite
in classIndexSearcher
- Throws:
IOException
-
createWeight
public Weight createWeight(Query query, ScoreMode scoreMode, float boost) throws IOException
- Overrides:
createWeight
in classIndexSearcher
- Throws:
IOException
-
getRewriteTime
public long getRewriteTime()
- Returns:
- total time taken to rewrite all queries in this profile
-
getProfileResult
public List<QueryProfilerResult> getProfileResult()
- Returns:
- a hierarchical representation of the profiled tree
-
-