org.apache.lucene.search
Class AssertingIndexSearcher

java.lang.Object
  extended by org.apache.lucene.search.IndexSearcher
      extended by org.apache.lucene.search.AssertingIndexSearcher

public class AssertingIndexSearcher
extends IndexSearcher

Helper class that adds some extra checks to ensure correct usage of IndexSearcher and Weight. TODO: Extend this by more checks, that's just a start.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.search.IndexSearcher
IndexSearcher.LeafSlice
 
Field Summary
 
Fields inherited from class org.apache.lucene.search.IndexSearcher
leafContexts, leafSlices, readerContext
 
Constructor Summary
AssertingIndexSearcher(Random random, IndexReader r)
           
AssertingIndexSearcher(Random random, IndexReaderContext context)
           
AssertingIndexSearcher(Random random, IndexReaderContext context, ExecutorService ex)
           
AssertingIndexSearcher(Random random, IndexReader r, ExecutorService ex)
           
 
Method Summary
 Weight createNormalizedWeight(Query query)
          Ensures, that the returned Weight is not normalized again, which may produce wrong scores.
protected  Query wrapFilter(Query query, Filter filter)
           
 
Methods inherited from class org.apache.lucene.search.IndexSearcher
collectionStatistics, doc, doc, doc, document, explain, explain, getDefaultSimilarity, getIndexReader, getSimilarity, getTopReaderContext, rewrite, search, search, search, search, search, search, search, search, search, search, search, search, search, searchAfter, searchAfter, searchAfter, searchAfter, searchAfter, setSimilarity, slices, termStatistics, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AssertingIndexSearcher

public AssertingIndexSearcher(Random random,
                              IndexReader r)

AssertingIndexSearcher

public AssertingIndexSearcher(Random random,
                              IndexReaderContext context)

AssertingIndexSearcher

public AssertingIndexSearcher(Random random,
                              IndexReader r,
                              ExecutorService ex)

AssertingIndexSearcher

public AssertingIndexSearcher(Random random,
                              IndexReaderContext context,
                              ExecutorService ex)
Method Detail

createNormalizedWeight

public Weight createNormalizedWeight(Query query)
                              throws IOException
Ensures, that the returned Weight is not normalized again, which may produce wrong scores.

Overrides:
createNormalizedWeight in class IndexSearcher
Throws:
IOException

wrapFilter

protected Query wrapFilter(Query query,
                           Filter filter)
Overrides:
wrapFilter in class IndexSearcher


Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.