You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by dojolava <do...@googlemail.com> on 2008/01/21 23:18:32 UTC

Wildcards

Hello,

I just started to use solr and I experience strange behaviour when it comes
to wildcards.

When I use the StandardRequestHandler queries like "eur?p?an" or "eur*an"
work fine.
But "garden?r" or "admini*tion" do not bring any results (without wildcards
there are some of course).

All affected fields are of type text, with the standard schema.xml from the
example.

Does anybody know how to fix this?

Re: Wildcards

Posted by dojolava <do...@googlemail.com>.
Thanks a lot!

I checked it, when I search for "g?rden" it works, only "g?rdener" does
not...

I will try the copyField solution.

On Jan 21, 2008 11:23 PM, Yonik Seeley <yo...@apache.org> wrote:

> On Jan 21, 2008 5:18 PM, dojolava <do...@googlemail.com> wrote:
> > I just started to use solr and I experience strange behaviour when it
> comes
> > to wildcards.
> >
> > When I use the StandardRequestHandler queries like "eur?p?an" or
> "eur*an"
> > work fine.
> > But "garden?r" or "admini*tion" do not bring any results (without
> wildcards
> > there are some of course).
>
> It's probably stemming.  Something like "gardener" is probably stemmed
> to "garden", so
> a wildcard query that expects something longer than "garden" won't
> find anything.
>
> If you really need more accurate wildcard queries, do a copyField of
> this field into another that does not have stemming (perhaps just
> whitespace tokenizer and lowercase filter, and maybe stop filter).
> Then use this alternate field for wildcard queries.
>
> -Yonik
>

Re: Wildcards

Posted by Yonik Seeley <yo...@apache.org>.
On Jan 21, 2008 5:18 PM, dojolava <do...@googlemail.com> wrote:
> I just started to use solr and I experience strange behaviour when it comes
> to wildcards.
>
> When I use the StandardRequestHandler queries like "eur?p?an" or "eur*an"
> work fine.
> But "garden?r" or "admini*tion" do not bring any results (without wildcards
> there are some of course).

It's probably stemming.  Something like "gardener" is probably stemmed
to "garden", so
a wildcard query that expects something longer than "garden" won't
find anything.

If you really need more accurate wildcard queries, do a copyField of
this field into another that does not have stemming (perhaps just
whitespace tokenizer and lowercase filter, and maybe stop filter).
Then use this alternate field for wildcard queries.

-Yonik