lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiaozheng Ma" <Xiaozheng...@redwood.com>
Subject [PATCH] wildcard "?" bug: "cat" matches "ca??"
Date Mon, 08 Nov 2004 20:18:20 GMT
Dear all,
 
I am not a lucene dev subscriber and hope you can see this email. It is
an intention to patch a bug that is related to multiple(continuous)
trailing wildcards "?". For example "cat" will match "ca??" .
 
The problem is at the file
org.apache.lucene.search.WildcardTermEnum.java (referring to current src
download from apache), line 135. three line is added:
                  //to prevent "cat" matches "ca??"
                  if(wildchar == WILDCARD_CHAR){
                        return false;
                  }           
 
To provide some context:
...
            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++;
            }
          }
...
 
A patch file is attached. 
 
Thanks!
 
---
Xiaozheng Ma

Mime
View raw message