Chris Hostetter wrote:
: For example, using the latest build (Aug 18) and the example documents, a
search for
: Enterprise matches the SOLR1000 document, but a search for Enter* does not.
try searching for: enter*
Ah-ha!
...this is a somewhat long standing anoyance with Lucene, that exists
because there's really no good way to deal with it -- when using
Wildcards, the Lucene QueryParser does not analyze the input -- if you ask
for a wildCard search on Enter*, a PrefixQuery is constructed with that
exact prefix, case an all. But in this case, the default search field is
"text" which uses the LowerCaseFilter -- so you'll never get a match on a
prefix with an upersapce character.
In general, Wildcard queries are "hard" and only make sense on fields that
have very simplistic Index time analyzers (like WhitespaceAnalyzer)
-- even then you might want to use the LowercaseFilter and override the
QueryParser's getPrfixQuery and getWildCardQuery methods to do things like
lowercase the input string for certain fields so you don't get anoying
situations like enter* not matching Enterprise.
Thanks, I think I understand now. Given that I'm doing some processing of the user input
before passing the query onto Solr, I can convert the query to lowercase before passing it
on.
-Andrew