org.apache.lucene.sandbox.queries.regex
Class RegexQuery
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.search.MultiTermQuery
org.apache.lucene.sandbox.queries.regex.RegexQuery
- All Implemented Interfaces:
- Cloneable, RegexQueryCapable
public class RegexQuery
- extends MultiTermQuery
- implements RegexQueryCapable
Implements the regular expression term search query.
The expressions supported depend on the regular expression implementation
used by way of the RegexCapabilities
interface.
NOTE: You may wish to consider using the regex query support
in RegexpQuery
instead, as it has better performance.
- See Also:
RegexTermsEnum
Constructor Summary |
RegexQuery(Term term)
Constructs a query for terms matching term . |
RegexQuery
public RegexQuery(Term term)
- Constructs a query for terms matching
term
.
getTerm
public Term getTerm()
setRegexImplementation
public void setRegexImplementation(RegexCapabilities impl)
- Description copied from interface:
RegexQueryCapable
- Defines which
RegexCapabilities
implementation is used by this instance.
- Specified by:
setRegexImplementation
in interface RegexQueryCapable
- See Also:
RegexQueryCapable.getRegexImplementation()
getRegexImplementation
public RegexCapabilities getRegexImplementation()
- Description copied from interface:
RegexQueryCapable
- Returns the implementation used by this instance.
- Specified by:
getRegexImplementation
in interface RegexQueryCapable
- See Also:
RegexQueryCapable.setRegexImplementation(RegexCapabilities)
getTermsEnum
protected FilteredTermsEnum getTermsEnum(Terms terms,
AttributeSource atts)
throws IOException
- Specified by:
getTermsEnum
in class MultiTermQuery
- Throws:
IOException
toString
public String toString(String field)
- Specified by:
toString
in class Query
hashCode
public int hashCode()
- Overrides:
hashCode
in class MultiTermQuery
equals
public boolean equals(Object obj)
- Overrides:
equals
in class MultiTermQuery
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.