Chris Hostetter wrote:
i'm not very familiar with this issue, but are you using
setAllowLeadingWildcard(true) ? ... if not it definitely won't work.

That's not the issue. (I've modified QP to allow "minWildcardPrefix" rather than just on/off), but the original QP shows the problem with setAllowLeadingWildcard(true). The compiled JavaCC code will always create a PrefixQuery if the last character is *, regardless of any other wildcard characters before it. Therefore the query is based on the Term:

Term(field, "*abc")

The decision is made in the JavaCC compiled code and I'm not familiar enough with JavaCC high level stuff to know how to make it choose based on an existing condition.

Regards
Antony

: Date: Thu, 22 Feb 2007 15:36:43 +1100
: From: Antony Bowesman <[EMAIL PROTECTED]>
: Reply-To: java-user@lucene.apache.org
: To: java-user@lucene.apache.org
: Subject: QueryParser bug?
:
: Using QueryParser to parse *tex* seems to create a PrefixQuery rather than
: WildcardQuery due to the trailing *, rather than Wildcard because of the other
: leading *.
:
: As a result, this does not match, for example "context".  I've swapped the 
order
: of WILDTERM and PREFIXTERM in queryparsr.jj but that just prevents PrefixQuery
: from ever being generated.
:
: Is this a known problem and is there any way around it?
: Antony



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to