Here's your answer I think.... http://wiki.apache.org/lucene-java/LuceneFAQ#head-133cf44dd3dff3680c96c1316a663e881eeac35a
In a nutshell, wildcard queries are not passed through an analyzer, although they are lower-cased by default. So you're indexing foobar but searching on _foobar (after rewrite).... But since searching on "_FooBar" *is* passed through the analyzer, it works. query.toString is your friend <G>...... at least I think.... Best Erick On Mon, Jun 16, 2008 at 7:48 AM, Felix Schwarz <[EMAIL PROTECTED]> wrote: > Hi, > > I have a small problem regarding QueryParser and WildcardQueries. > > Basically, I'm indexing documents like this: > doc.add(new Field("title", "_FooBar", Field.Store.YES, > Field.Index.TOKENIZED)); > > Afterwards I expected that this query would return the document above: > QueryParser parser = new QueryParser("title", getAnalyzer()); > Query q = parser.parse("_Foo*"); > > But instead no hit is returned (yes, I'm using StandardAnalyzer for > indexing+searching). > If I search for "_FooBar", it works. > > Obviously, I did not understand thorougly what Lucene does with my query. > > Can anyone shed some light on this? > > Thank you very much > fs > > PS: Maybe it's just a stupid coding error. The complete test case is > available, too: > http://www.felix-schwarz.name/files/misc/2008/UnderscoreSearching.java > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >