You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by sp...@gmx.eu on 2008/02/22 19:24:21 UTC
Suffix search
Hi,
using WildcardQuery directly it is possible to search for suffixes like
"*foo".
The QueryParser throws an exception that this is not allowed in a
WildcardQuery.
Hm, now I'm confused ;)
How can I configure the QueryParser to allow a wildcard as first character?
Thank you
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
RE: Suffix search
Posted by sp...@gmx.eu.
> That will let you do it, be warned however there is most definitely a
> significant performance degradation associated with doing this.
Yes of course. Like in a relational database with a leading wildcard.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Suffix search
Posted by Matthew Hall <mh...@informatics.jax.org>.
What you need is to set the allow leading wildcard flag.
qp.setAllowLeadingWildcard(true);
(where qp is a query parser instance)
That will let you do it, be warned however there is most definitely a
significant performance degradation associated with doing this.
Matt
spring@gmx.eu wrote:
> Hi,
>
> using WildcardQuery directly it is possible to search for suffixes like
> "*foo".
>
> The QueryParser throws an exception that this is not allowed in a
> WildcardQuery.
>
> Hm, now I'm confused ;)
>
> How can I configure the QueryParser to allow a wildcard as first character?
>
> Thank you
>
>
> ---------------------------------------------------------------------
> 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