your are right its QueryParser throw the exception. I think I got the point. QueryParser doesn't allows asterisk at the begining but SerchIndexer (could) work.
For a example when I quering "\**TI" it returned me machings "J400-C-V-S10-T1" and "J400-C-V-S8-T1". -----Original Message----- From: Erik Hatcher [mailto:[EMAIL PROTECTED] Sent: Wednesday, 27 July 2005 10:35 AM To: java-user@lucene.apache.org Subject: Re: Analyzer or QueryParser problem? On Jul 26, 2005, at 7:29 PM, Indu Abeyaratna wrote: > I have a question related to this. > > when I search for wildcard "*11" IndexSearcher throws an exception > but when > I tries "\**11" it works. I'm guessing QueryParser actually throws an exception, not IndexSearcher, correct? Wildcards at the beginning of a term are not allowed by QueryParser. Using \**11 works because the first character is literally an asterisk, and thus is a legal expression. > I couldn't find any documentation related to this. What could be > the reason > for this? > > I am using QueryParser and StandardAnalyser > > And the query it generate looks like : "+orgId:9146 +isRegistered:1 > +docNo:**11" I see the issue though - by making it \** at the beginning, you've effectively bypassed the QueryParser protection of not allowing prefixed wildcard terms but achieved the same thing. Interesting hack! Erik --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]