lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Bowesman <...@teamware.com>
Subject Re: QueryParser bug?
Date Fri, 23 Feb 2007 01:15:47 GMT
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 <adb@teamware.com>
> : 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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message