lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: InverseWildcardQuery
Date Fri, 30 Jul 2010 15:41:13 GMT
With all these requirements you slow down your queries immense. You should
think about indexing your terms different:

- if you need leading wildcards, think about indexing your terms in reverse!
Wildcards starting with * needs to iterate all terms, so it's very slow (and
because of this defaults to be disabled)
- wildcards and regexes should always be used sparingly, as it can happen
that the whole term dictionary needs to be checked. Maybe you should use
another analyzer, so you don't need wildcards.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Ian Lea [mailto:ian.lea@gmail.com]
> Sent: Friday, July 30, 2010 5:33 PM
> To: java-user@lucene.apache.org
> Subject: Re: InverseWildcardQuery
> 
> > I think you're suggesting, for example, "*:* AND -myfield:foo*".
> 
> Yes, I think that is equivalent.
> 
> > If my document contains "myfield:foobar" and "myfield:dog", the
> > document would be thrown out because of the first field. I want to
> > keep the document because the second field does not match.
> 
> OK, too hard for me ...
> 
> > Related, is there a way to use wildcards to match the beginning of the
> field?
> >
> > org.apache.lucene.queryParser.ParseException: Cannot parse '*:* AND
> > -myfield:*foo*': '*' or '?' not allowed as first character in
> > WildcardQuery
> 
> Yes.  QueryParser.setAllowLeadingWildcard().
> 
> 
> --
> Ian.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org



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