Class QueryUtils
Utility class for sanity-checking queries.
Inheritance
Namespace: Lucene.Net.Search
Assembly: Lucene.Net.TestFramework.dll
Syntax
public static class QueryUtils : object
Methods
| Improve this Doc View SourceCheck(Query)
Check the types of things query objects should be able to do.
Declaration
public static void Check(Query q)
Parameters
Type | Name | Description |
---|---|---|
Query | q |
Check(Random, Query, IndexSearcher)
Various query sanity checks on a searcher, some checks are only done for
instance of
Declaration
public static void Check(Random random, Query q1, IndexSearcher s)
Parameters
Type | Name | Description |
---|---|---|
Random | random | A random instance (usually Random). |
Query | q1 | A |
IndexSearcher | s | An |
See Also
Check(Random, Query, IndexSearcher, Boolean)
Declaration
public static void Check(Random random, Query q1, IndexSearcher s, bool wrap)
Parameters
Type | Name | Description |
---|---|---|
Random | random | |
Query | q1 | |
IndexSearcher | s | |
System.Boolean | wrap |
CheckEqual(Query, Query)
Declaration
public static void CheckEqual(Query q1, Query q2)
Parameters
Type | Name | Description |
---|---|---|
Query | q1 | |
Query | q2 |
CheckExplanations(Query, IndexSearcher)
Deep check that explanations of a query 'score' correctly.
Declaration
public static void CheckExplanations(Query q, IndexSearcher s)
Parameters
Type | Name | Description |
---|---|---|
Query | q | |
IndexSearcher | s |
CheckFirstSkipTo(Query, IndexSearcher)
Check that first skip on just created scorers always goes to the right doc.
Declaration
public static void CheckFirstSkipTo(Query q, IndexSearcher s)
Parameters
Type | Name | Description |
---|---|---|
Query | q | |
IndexSearcher | s |
CheckHashEquals(Query)
Check very basic
Declaration
public static void CheckHashEquals(Query q)
Parameters
Type | Name | Description |
---|---|---|
Query | q |
CheckSkipTo(Query, IndexSearcher)
Alternate scorer skipTo(),skipTo(),next(),next(),skipTo(),skipTo(), etc and ensure a hitcollector receives same docs and scores.
Declaration
public static void CheckSkipTo(Query q, IndexSearcher s)
Parameters
Type | Name | Description |
---|---|---|
Query | q | |
IndexSearcher | s |
CheckUnequal(Query, Query)
Declaration
public static void CheckUnequal(Query q1, Query q2)
Parameters
Type | Name | Description |
---|---|---|
Query | q1 | |
Query | q2 |
PurgeFieldCache(IndexReader)
Declaration
public static void PurgeFieldCache(IndexReader r)
Parameters
Type | Name | Description |
---|---|---|
IndexReader | r |
WrapUnderlyingReader(Random, IndexSearcher, Int32)
Given an
Declaration
public static IndexSearcher WrapUnderlyingReader(Random random, IndexSearcher s, int edge)
Parameters
Type | Name | Description |
---|---|---|
Random | random | |
IndexSearcher | s | The searcher to wrap. |
System.Int32 | edge | If negative, s will be the first sub; if 0, s will be in the middle, if positive s will be the last sub. |
Returns
Type | Description |
---|---|
IndexSearcher |