C# Class Lucene.Net.Search.QueryUtils

Utility class for sanity-checking queries.
Show file Open project: apache/lucenenet Class Usage Examples

Public Methods

Method Description
Check ( Query q ) : void

Check the types of things query objects should be able to do.

Check ( Random random, Query q1, IndexSearcher s, Similarity similarity ) : void

Various query sanity checks on a searcher, some checks are only done for instanceof IndexSearcher.

Check ( Random random, Query q1, IndexSearcher s, bool wrap, Similarity similarity ) : void
CheckEqual ( Query q1, Query q2 ) : void
CheckExplanations ( Query q, IndexSearcher s ) : void

deep check that explanations of a query 'score' correctly

CheckFirstSkipTo ( Query q, IndexSearcher s, Similarity similarity ) : void

check that first skip on just created scorers always goes to the right doc

CheckHashEquals ( Query q ) : void

check very basic hashCode and equals

CheckSkipTo ( Query q, IndexSearcher s, Similarity similarity ) : void

alternate scorer skipTo(),skipTo(),next(),next(),skipTo(),skipTo(), etc and ensure a hitcollector receives same docs and scores

CheckUnequal ( Query q1, Query q2 ) : void
PurgeFieldCache ( IndexReader r ) : void
WrapUnderlyingReader ( Random random, IndexSearcher s, int edge, Similarity similarity ) : IndexSearcher

Given an IndexSearcher, returns a new IndexSearcher whose IndexReader is a MultiReader containing the Reader of the original IndexSearcher, as well as several "empty" IndexReaders -- some of which will have deleted documents in them. this new IndexSearcher should behave exactly the same as the original IndexSearcher.

Private Methods

Method Description
MakeEmptyIndex ( Random random, int numDocs ) : IndexReader
QueryUtils ( ) : System

Method Details

Check() public static method

Check the types of things query objects should be able to do.
public static Check ( Query q ) : void
q Query
return void

Check() public static method

Various query sanity checks on a searcher, some checks are only done for instanceof IndexSearcher.
public static Check ( Random random, Query q1, IndexSearcher s, Similarity similarity ) : void
random System.Random
q1 Query
s IndexSearcher
similarity Similarity /// LUCENENET specific /// Removes dependency on ///
return void

Check() public static method

public static Check ( Random random, Query q1, IndexSearcher s, bool wrap, Similarity similarity ) : void
random System.Random
q1 Query
s IndexSearcher
wrap bool
similarity Similarity /// LUCENENET specific /// Removes dependency on ///
return void

CheckEqual() public static method

public static CheckEqual ( Query q1, Query q2 ) : void
q1 Query
q2 Query
return void

CheckExplanations() public static method

deep check that explanations of a query 'score' correctly
public static CheckExplanations ( Query q, IndexSearcher s ) : void
q Query
s IndexSearcher
return void

CheckFirstSkipTo() public static method

check that first skip on just created scorers always goes to the right doc
public static CheckFirstSkipTo ( Query q, IndexSearcher s, Similarity similarity ) : void
q Query
s IndexSearcher
similarity Similarity /// LUCENENET specific /// Removes dependency on ///
return void

CheckHashEquals() public static method

check very basic hashCode and equals
public static CheckHashEquals ( Query q ) : void
q Query
return void

CheckSkipTo() public static method

alternate scorer skipTo(),skipTo(),next(),next(),skipTo(),skipTo(), etc and ensure a hitcollector receives same docs and scores
public static CheckSkipTo ( Query q, IndexSearcher s, Similarity similarity ) : void
q Query
s IndexSearcher
similarity Similarity /// LUCENENET specific /// Removes dependency on ///
return void

CheckUnequal() public static method

public static CheckUnequal ( Query q1, Query q2 ) : void
q1 Query
q2 Query
return void

PurgeFieldCache() public static method

public static PurgeFieldCache ( IndexReader r ) : void
r IndexReader
return void

WrapUnderlyingReader() public static method

Given an IndexSearcher, returns a new IndexSearcher whose IndexReader is a MultiReader containing the Reader of the original IndexSearcher, as well as several "empty" IndexReaders -- some of which will have deleted documents in them. this new IndexSearcher should behave exactly the same as the original IndexSearcher.
public static WrapUnderlyingReader ( Random random, IndexSearcher s, int edge, Similarity similarity ) : IndexSearcher
random System.Random
s IndexSearcher the searcher to wrap
edge int if negative, s will be the first sub; if 0, s will be in the middle, if positive s will be the last sub
similarity Similarity /// LUCENENET specific /// Removes dependency on ///
return IndexSearcher