Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class QueryUtils

    Utility class for sanity-checking queries.

    Inheritance
    System.Object
    QueryUtils
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Lucene.Net.Search
    Assembly: Lucene.Net.TestFramework.dll
    Syntax
    public static class QueryUtils

    Methods

    | Improve this Doc View Source

    Check(Query)

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

    Declaration
    public static void Check(Query q)
    Parameters
    Type Name Description
    Lucene.Net.Search.Query q
    | Improve this Doc View Source

    Check(Random, Query, IndexSearcher)

    Various query sanity checks on a searcher, some checks are only done for instance of Lucene.Net.Search.IndexSearcher.

    Declaration
    public static void Check(Random random, Query q1, IndexSearcher s)
    Parameters
    Type Name Description
    System.Random random

    A random instance (usually Random).

    Lucene.Net.Search.Query q1

    A Lucene.Net.Search.Query.

    Lucene.Net.Search.IndexSearcher s

    An Lucene.Net.Search.IndexSearcher.

    See Also
    Check(Query)
    CheckFirstSkipTo(Query, IndexSearcher)
    CheckSkipTo(Query, IndexSearcher)
    CheckExplanations(Query, IndexSearcher)
    CheckEqual(Query, Query)
    | Improve this Doc View Source

    Check(Random, Query, IndexSearcher, Boolean)

    Declaration
    public static void Check(Random random, Query q1, IndexSearcher s, bool wrap)
    Parameters
    Type Name Description
    System.Random random
    Lucene.Net.Search.Query q1
    Lucene.Net.Search.IndexSearcher s
    System.Boolean wrap
    | Improve this Doc View Source

    CheckEqual(Query, Query)

    Declaration
    public static void CheckEqual(Query q1, Query q2)
    Parameters
    Type Name Description
    Lucene.Net.Search.Query q1
    Lucene.Net.Search.Query q2
    | Improve this Doc View Source

    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
    Lucene.Net.Search.Query q
    Lucene.Net.Search.IndexSearcher s
    | Improve this Doc View Source

    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
    Lucene.Net.Search.Query q
    Lucene.Net.Search.IndexSearcher s
    | Improve this Doc View Source

    CheckHashEquals(Query)

    Check very basic System.Object.GetHashCode() and System.Object.Equals(System.Object).

    Declaration
    public static void CheckHashEquals(Query q)
    Parameters
    Type Name Description
    Lucene.Net.Search.Query q
    | Improve this Doc View Source

    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
    Lucene.Net.Search.Query q
    Lucene.Net.Search.IndexSearcher s
    | Improve this Doc View Source

    CheckUnequal(Query, Query)

    Declaration
    public static void CheckUnequal(Query q1, Query q2)
    Parameters
    Type Name Description
    Lucene.Net.Search.Query q1
    Lucene.Net.Search.Query q2
    | Improve this Doc View Source

    PurgeFieldCache(IndexReader)

    Declaration
    public static void PurgeFieldCache(IndexReader r)
    Parameters
    Type Name Description
    Lucene.Net.Index.IndexReader r
    | Improve this Doc View Source

    WrapUnderlyingReader(Random, IndexSearcher, Int32)

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

    Declaration
    public static IndexSearcher WrapUnderlyingReader(Random random, IndexSearcher s, int edge)
    Parameters
    Type Name Description
    System.Random random
    Lucene.Net.Search.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
    Lucene.Net.Search.IndexSearcher
    • Improve this Doc
    • View Source
    Back to top Copyright © 2022 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.