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.
Inherited Members
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 SourcePrefixQuery(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 SourcePrefix
Returns the prefix of this query.
Declaration
public virtual Term Prefix { get; }
Property Value
Type | Description |
---|---|
Term |
Methods
| Improve this Doc View SourceEquals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceGetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
| Improve this Doc View SourceGetTermsEnum(Terms, AttributeSource)
Declaration
protected override TermsEnum GetTermsEnum(Terms terms, AttributeSource atts)
Parameters
Type | Name | Description |
---|---|---|
Terms | terms | |
AttributeSource | atts |
Returns
Type | Description |
---|---|
TermsEnum |
Overrides
| Improve this Doc View SourceToString(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 |