mirror of https://github.com/apache/lucene.git
- Cosmetics and Javadocs.
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@149974 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9e4c0f3925
commit
d40c5493a6
|
@ -75,7 +75,11 @@ public class WildcardTermEnum extends FilteredTermEnum {
|
||||||
boolean fieldMatch = false;
|
boolean fieldMatch = false;
|
||||||
boolean endEnum = false;
|
boolean endEnum = false;
|
||||||
|
|
||||||
/** Creates new WildcardTermEnum */
|
/**
|
||||||
|
* Creates a new <code>WildcardTermEnum</code>. Passing in a
|
||||||
|
* {@link org.apache.lucene.index.Term} that does not contain a
|
||||||
|
* <code>WILDCARD_CHAR</code> will cause an exception to be thrown.
|
||||||
|
*/
|
||||||
public WildcardTermEnum(IndexReader reader, Term term) throws IOException {
|
public WildcardTermEnum(IndexReader reader, Term term) throws IOException {
|
||||||
super(reader, term);
|
super(reader, term);
|
||||||
searchTerm = term;
|
searchTerm = term;
|
||||||
|
@ -85,8 +89,12 @@ public class WildcardTermEnum extends FilteredTermEnum {
|
||||||
int sidx = text.indexOf(WILDCARD_STRING);
|
int sidx = text.indexOf(WILDCARD_STRING);
|
||||||
int cidx = text.indexOf(WILDCARD_CHAR);
|
int cidx = text.indexOf(WILDCARD_CHAR);
|
||||||
int idx = sidx;
|
int idx = sidx;
|
||||||
if (idx == -1) idx = cidx;
|
if (idx == -1) {
|
||||||
else if (cidx >= 0) idx = Math.min(idx, cidx);
|
idx = cidx;
|
||||||
|
}
|
||||||
|
else if (cidx >= 0) {
|
||||||
|
idx = Math.min(idx, cidx);
|
||||||
|
}
|
||||||
|
|
||||||
pre = searchTerm.text().substring(0,idx);
|
pre = searchTerm.text().substring(0,idx);
|
||||||
preLen = pre.length();
|
preLen = pre.length();
|
||||||
|
|
Loading…
Reference in New Issue