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: Search with multiple wildcards
Date Wed, 10 Sep 2008 14:44:50 GMT
Is this what you're referring to?

Lucene supports single and multiple character wildcard searches within
single terms (not within phrase queries).
(from http://lucene.apache.org/java/docs/queryparsersyntax.html)

I'm pretty sure you can have multiple *terms* with wildcards. Luke is your
friend here, download a copy and try it <G>. Be sure on the search tab to
specify StandardAnalyzer or some such, rather than keywordanalyzer.

The phrase is trying to point out that a phrase query does NOT respect
wildcards. That is, submitting
"ab* bc* cd*" AS A PHRASE QUERY won't do what you expect. But I'm pretty
sure that

+field:ab* +field:bc* +field:cd*

will work just fine. The key here is "within single terms", which I think of
as
"within a single term query". You can add as many TermQuerys as you want.
See the query documentation for how to submit phrase queries.

Best
Erick

On Wed, Sep 10, 2008 at 10:11 AM, Sertic Mirko, Bedag <Mirko.Sertic@bedag.ch
> wrote:

> Hi
>
> Thank you for your quick response:-)
>
> Of course I need to use the * character :-) But I have read somewhere in
> the documentation that leading wildcards are not supported, and only one
> wildcard term per query. Is this limitation resolved in the current version?
>
> Regards
> Mirko
>
> -----Urspr√ľngliche Nachricht-----
> Von: Erick Erickson [mailto:erickerickson@gmail.com]
> Gesendet: Mittwoch, 10. September 2008 15:47
> An: java-user@lucene.apache.org
> Betreff: Re: Search with multiple wildcards
>
> Sure, but you'll have to set the leading wildcard option,
> which I've forgotten the exact call, but it's in the docs.
>
> And use * rather than % <G>.
>
> But wildcards are tricky, especially the TooManyClauses
> exception. You might want to peruse the archive for wildcard
> posts...
>
> Best
> Erick
>
> On Wed, Sep 10, 2008 at 9:06 AM, Sertic Mirko, Bedag
> <Mirko.Sertic@bedag.ch>wrote:
>
> > Hi@all
> >
> >
> >
> > Is it possible to do a search with multiple wildcards in one query, for
> > instance "%MANAGE%" AND "CORE%"? Is there a code example available?
> >
> >
> >
> > Thanks a lot
> >
> > Mirko
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> 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