QueryUtils

object QueryUtils

Utility class for sanity-checking queries.

Functions

Link copied to clipboard
fun check(q: Query)

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

fun check(random: Random, q1: Query, s: IndexSearcher, wrap: Boolean = true)

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

Link copied to clipboard
fun checkBulkScorerSkipTo(r: Random, query: Query, searcher: IndexSearcher)

Check that the scorer and bulk scorer advance consistently.

Link copied to clipboard
fun checkCount(query: Query, searcher: IndexSearcher)

Check that counting hits through DocIdStream.count yield the same result as counting naively.

Link copied to clipboard
fun checkEqual(q1: Query, q2: Query)
Link copied to clipboard

deep check that explanations of a query 'score' correctly

Link copied to clipboard

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

Link copied to clipboard

check very basic hashCode and equals

Link copied to clipboard

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

Link copied to clipboard
fun checkUnequal(q1: Query, q2: Query)
Link copied to clipboard

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.