lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Hall <mh...@informatics.jax.org>
Subject Re: Possible Bug when Querying?
Date Fri, 16 May 2008 18:38:00 GMT
Very very interesting.

I went ahead and turned on the AllowLeadingWildcard toggle and 
everything works just as expected now, which is odd in a way.

I'm still not certain why a search for '\*ache*' would be considered to 
have a  leading wildcard.  I'm searching for the literal * character 
here which I would have assumed would be a completely fine thing to do 
in a search, but somehow its triggering the leading wildcard checking 
logic. 

Well, anyhow thanks much for the suggestion, things are working properly 
now.

Matt

Karl Wettin wrote:
>
> 15 maj 2008 kl. 18.33 skrev Matthew Hall:
>>
>> 12:23:05,602 INFO  [STDOUT] 
>> org.apache.lucene.queryParser.ParseException: Cannot parse '\*ache*': 
>> '*' not allowed as first character in PrefixQuery
>> 12:23:05,602 INFO  [STDOUT] Failure in QS_MarkerSearch.searchMarkerNomen
>> 12:23:05,602 ERROR [STDERR] java.lang.NullPointerException
>> 12:23:05,602 ERROR [STDERR]     at 
>> org.jax.mgi.search.model.QS_MarkerSearch.searchInexactMatches(Unknown 
>> Source)
>>
>>
>> Which looks to me alot like something akin to the 
>> AllowLeadingWildcard stuff that comes along with wildcardqueries.
>>
>> But, the odd thing is the leading character in my search string ISN'T 
>> *, its the escaped star character, which I would have thought would 
>> work with no problems at all.
>>
>> Have I stumbled across a bug here?
>
>
> Did you setAllowLeadingWildcard(true)?
>
>   /**
>    * Set to <code>true</code> to allow leading wildcard characters.
>    * <p>
>    * When set, <code>*</code> or <code>?</code> are allowed as
>    * the first character of a PrefixQuery and WildcardQuery.
>    * Note that this can produce very slow
>    * queries on big indexes.
>    * <p>
>    * Default: false.
>    */
>   public void setAllowLeadingWildcard(boolean allowLeadingWildcard) {
>
>
>
>      karl
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

-- 
Matthew Hall
Software Engineer
Mouse Genome Informatics
mhall@informatics.jax.org
(207) 288-6012



---------------------------------------------------------------------
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