org.apache.lucene.search.regex
Class JavaUtilRegexCapabilities
- org.apache.lucene.search.regex.RegexCapabilities
public class JavaUtilRegexCapabilities
implements org.apache.lucene.search.regex.RegexCapabilities
An implementation tying Java's built-in java.util.regex to RegexQuery.
Note that because this implementation currently only returns null from
prefix()
that queries using this implementation will enumerate and
attempt to
match(String)
each term for the specified field in the index.
void | compile(String pattern) - Called by the constructor of
RegexTermEnum allowing
implementations to cache a compiled version of the regular
expression pattern.
|
boolean | equals(Object o)
|
int | hashCode()
|
boolean | match(String string)
|
String | prefix() - A wise prefix implementation can reduce the term enumeration (and thus performance)
of RegexQuery dramatically!
|
compile
public void compile(String pattern)
Called by the constructor of
RegexTermEnum
allowing
implementations to cache a compiled version of the regular
expression pattern.
- compile in interface org.apache.lucene.search.regex.RegexCapabilities
pattern
- regular expression pattern
equals
public boolean equals(Object o)
hashCode
public int hashCode()
match
public boolean match(String string)
- match in interface org.apache.lucene.search.regex.RegexCapabilities
- true if string matches the pattern last passed to
compile
.
prefix
public String prefix()
A wise prefix implementation can reduce the term enumeration (and thus performance)
of RegexQuery dramatically!
- prefix in interface org.apache.lucene.search.regex.RegexCapabilities
- static non-regex prefix of the pattern last passed to
compile
. May return null.
Copyright © 2000-2006 Apache Software Foundation. All Rights Reserved.