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()
    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 © 2020 Licensed to the Apache Software Foundation (ASF)