mirror of https://github.com/apache/lucene.git
fix to prevent that queries like 'ca??' match a term like 'cat'.
Terms with the correct length should be returned only. See Bug#LUCENE-306 git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@329859 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
741173ade6
commit
34e42624f6
|
@ -125,15 +125,20 @@ public class WildcardTermEnum extends FilteredTermEnum {
|
|||
{
|
||||
// Check the character at the current position
|
||||
char wildchar = pattern.charAt(wildcardSearchPos);
|
||||
|
||||
// If it's not a wildcard character, then there is more
|
||||
// pattern information after this/these wildcards.
|
||||
|
||||
if (wildchar != WILDCARD_CHAR && wildchar != WILDCARD_STRING)
|
||||
{
|
||||
justWildcardsLeft = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// to prevent "cat" matches "ca??"
|
||||
if (wildchar == WILDCARD_CHAR) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Look at the next character
|
||||
wildcardSearchPos++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue