lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert J. Lebowitz" <lebow...@finaltouch.com>
Subject Flaws in WildcardQuery design....
Date Fri, 19 Oct 2001 17:46:05 GMT
I've been experimenting with the new WildcardQuery class and since there
isn't really any documentation on its use, I've been sort of poking at it to
see how it is used.

>From what I've seen so far, you must construct the query by passing it a
Term object.  However, the String that is passed as the constructor for the
Term must end with an asterix.

Flaw 1:  if you fail to add an asterix, it throws a
StringIndexOutOfBoundsException because (presumably) an asterix can't be
found in the Term.  Wouldn't it be more useful to throw a custom Exception
that tells the user that the asterix is missing??? Just a suggestion...

Flaw 2: In the tests that I ran, I was searching for a series of
alphanumeric sequences, BD, BD-200, BD-300, etc.  (you get the idea).  When
I provided the Term "BD*", I would get all the corresponding matches except
for "BD".  Wouldn't you normally expect "BD" to be returned, along with the
other matches???

Question 1:  Has the QueryParser been updated such that it can handle
wildcard terms using the new WildcardQuery?  I.E., can it return some kind
of BooleanQuery that incorporates some terms utilizing Wildcard searches
(and others that don't)?

Rob


Mime
View raw message