Mailing List Archive

Wildcard query problem with "?"
Hello,

I have been using RC2 until yesterday when I tried the latest nightly build.
Now it seems that I can no longer search for wildcard-queries with a
question mark.
For example in my index there are two documents, one containing the word
"meier" and another one containing the word "maier". With RC2 I could search
for "m?ier" and got two hits. With anything later (I tried RC3, RC4 and the
nightly builds from 1704 and 1804) I get 0 hits. When searching for "mei?r"
the same, 1 hit with RC2 and 0 hits with RC4.
The QueryParser from RC2 generated a BooleanQuery and the QueryParser from
RC4 generates a PhraseQuery. I have attached the source code of a little
test program and output from the debugger.
Could somebody explain this behaviour?

Thanks
Ralf Hettesheimer
Re: Wildcard query problem with "?" [ In reply to ]
Hm, I just went through all the diffs after RC2 (QueryParser.jj
revision 1.3) and I can't see where '?' was dropped.
However, one user reported this on February 27th:

We just tried adding the "?" character to QueryParser.jj under
<#_TERM_START_CHAR>. We noticed that the "*" was in that list, so we
figured
we'd just give it a try. It seems to have worked. Now when we search on
rou?d, we get hits on the word "round". We're going to try searching
for
some other variations to make sure that we've done the right thing.
We'd still be interested to know exactly why this worked (assuming it
continues to solve our problem). What is a TERM_START_CHAR and how is
it
used? Obviously it does something important. :-)


So I'll try your code and if wildcards really don't work I'll try this
person's suggestion and if it works I'll commit it.


Otis


--- Ralf Hettesheimer <hettesheimer@cms.tecmath.com> wrote:
> Hello,
>
> I have been using RC2 until yesterday when I tried the latest nightly
> build.
> Now it seems that I can no longer search for wildcard-queries with a
> question mark.
> For example in my index there are two documents, one containing the
> word
> "meier" and another one containing the word "maier". With RC2 I could
> search
> for "m?ier" and got two hits. With anything later (I tried RC3, RC4
> and the
> nightly builds from 1704 and 1804) I get 0 hits. When searching for
> "mei?r"
> the same, 1 hit with RC2 and 0 hits with RC4.
> The QueryParser from RC2 generated a BooleanQuery and the QueryParser
> from
> RC4 generates a PhraseQuery. I have attached the source code of a
> little
> test program and output from the debugger.
> Could somebody explain this behaviour?
>
> Thanks
> Ralf Hettesheimer
>
>
>

> ATTACHMENT part 2 application/octet-stream name=TestQueryParser.java


> ATTACHMENT part 3 image/gif name=debugrc2.gif


> ATTACHMENT part 4 image/gif name=debugrc4.gif
> --
> To unsubscribe, e-mail:
> <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:lucene-user-help@jakarta.apache.org>


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>