Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class PrefixQuery

    A Query that matches documents containing terms with a specified prefix. A PrefixQuery is built by QueryParser for input like app*.

    This query uses the CONSTANT_SCORE_AUTO_REWRITE_DEFAULT rewrite method.

    Inheritance
    System.Object
    Query
    MultiTermQuery
    PrefixQuery
    Inherited Members
    MultiTermQuery.m_field
    MultiTermQuery.m_rewriteMethod
    MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE
    MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE
    MultiTermQuery.CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE
    MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT
    MultiTermQuery.Field
    MultiTermQuery.GetTermsEnum(Terms)
    MultiTermQuery.Rewrite(IndexReader)
    MultiTermQuery.MultiTermRewriteMethod
    Query.Boost
    Query.ToString()
    Query.CreateWeight(IndexSearcher)
    Query.ExtractTerms(ISet<Term>)
    Query.Clone()
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Lucene.Net.Search
    Assembly: Lucene.Net.dll
    Syntax
    public class PrefixQuery : MultiTermQuery

    Constructors

    | Improve this Doc View Source

    PrefixQuery(Term)

    Constructs a query for terms starting with prefix.

    Declaration
    public PrefixQuery(Term prefix)
    Parameters
    Type Name Description
    Term prefix

    Properties

    | Improve this Doc View Source

    Prefix

    Returns the prefix of this query.

    Declaration
    public virtual Term Prefix { get; }
    Property Value
    Type Description
    Term

    Methods

    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    MultiTermQuery.Equals(Object)
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    MultiTermQuery.GetHashCode()
    | Improve this Doc View Source

    GetTermsEnum(Terms, AttributeSource)

    Declaration
    protected override TermsEnum GetTermsEnum(Terms terms, AttributeSource atts)
    Parameters
    Type Name Description
    Terms terms
    AttributeSource atts
    Returns
    Type Description
    TermsEnum
    Overrides
    MultiTermQuery.GetTermsEnum(Terms, AttributeSource)
    | Improve this Doc View Source

    ToString(String)

    Prints a user-readable version of this query.

    Declaration
    public override string ToString(string field)
    Parameters
    Type Name Description
    System.String field
    Returns
    Type Description
    System.String
    Overrides
    Query.ToString(String)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2021 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.