lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Erickson" <erickerick...@gmail.com>
Subject Re: I need 'cat???' to match 'cat' again!
Date Wed, 06 Jun 2007 14:25:59 GMT
Well, having your application depend upon incorrect behavior
is...er...fraught.

It looks like what you really want is custom behavior for multiple
question marks, perhaps only with multiple question marks
at the end of your query?

If this is the case, I'd think about substituting splat (*) in this
case at query time. So you simply transform
cat??? to cat*....

If that doesn't satisfy your requirements, perhaps you could
post a more detailed explanation of what you're trying to
accomplish.

Best
Erick

On 6/6/07, Tim Smith <forusewith@yahoo.com> wrote:
>
> Hi!
>
> How can I restore the behavior of the old
> WildcardQuery under 2.1?
> I badly need 'cat???' to match 'cat' again just like
> in the older versions.
>
> I could modify my istance of lucene by removing those
> "new" lines, but I don't want to maintain a custom
> lucene package.
>
> Please help!
>
> Tim
>
>
>
>
> Source: LUCENE-306
> >
> ********************************************************************
> > --- WildcardTermEnum.org      2004-05-11
> 11:42:10.000000000 -0400
> > +++ WildcardTermEnum.java     2004-11-08
> 14:35:14.823610500 -0500
> > @@ -132,6 +132,10 @@
> >              }
> >              else
> >              {
> > +           //to prevent "cat" matches "ca??"
> > +           if(wildchar == WILDCARD_CHAR){
> > +             return false;
> > +           }
> >                // Look at the next character
> >                wildcardSearchPos++;
> >              }
> >
> **********************************************************************
>
>
>
>
>
> ____________________________________________________________________________________
> Sucker-punch spam with award-winning protection.
> Try the free Yahoo! Mail Beta.
> http://advision.webevents.yahoo.com/mailbeta/features_spam.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message