Hello,
I have to diagree, the bug is not fixed yet.
The problem here is that the bug is not in the WildcardQuery-class which the
Unit-Test checks but in the QueryParser. I have attached my version of
TestWildcard that additionally to the existing tests uses the QueryParser
and fails for any actual Lucene version.
I have looked into the QueryParser code and the problem appears to be the
differentiation between a TERM and a WILDTERM. If a term contains a question
mark it is not treated as a WILDTERM but as a TERM because the question mark
is a letter that can be part of a TERM. I have changed the definition of
TERM in my own QueryParser which I have attached too. With this version the
Unit-test works perfectly.
Another question concerning the QueryParser. I made another change to the
QueryParser (QueryParser2.jj) that allows to search for terms starting with
a wildcard. Is there any reason why Lucene does not support this by default?
Greetings
Ralf Hettesheimer
--
_______________________________________________________________________
Ralf Hettesheimer, Dipl.-Technoinform. t e c m a t h A G
Software Engineer Content Management Systems Division
phone +49 (0)631 303-5295 Europaallee 10, 67657 Kaiserslautern, Germany
fax +49 (0)631 303-5210 http://www.tecmath.com
_______________________________________________________________________
I have to diagree, the bug is not fixed yet.
The problem here is that the bug is not in the WildcardQuery-class which the
Unit-Test checks but in the QueryParser. I have attached my version of
TestWildcard that additionally to the existing tests uses the QueryParser
and fails for any actual Lucene version.
I have looked into the QueryParser code and the problem appears to be the
differentiation between a TERM and a WILDTERM. If a term contains a question
mark it is not treated as a WILDTERM but as a TERM because the question mark
is a letter that can be part of a TERM. I have changed the definition of
TERM in my own QueryParser which I have attached too. With this version the
Unit-test works perfectly.
Another question concerning the QueryParser. I made another change to the
QueryParser (QueryParser2.jj) that allows to search for terms starting with
a wildcard. Is there any reason why Lucene does not support this by default?
Greetings
Ralf Hettesheimer
--
_______________________________________________________________________
Ralf Hettesheimer, Dipl.-Technoinform. t e c m a t h A G
Software Engineer Content Management Systems Division
phone +49 (0)631 303-5295 Europaallee 10, 67657 Kaiserslautern, Germany
fax +49 (0)631 303-5210 http://www.tecmath.com
_______________________________________________________________________