lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomás Fernández Löbbe <tomasflo...@gmail.com>
Subject Re: Shouldn't ReversedWildcardFilterFactory resolve leadingWildcard?
Date Wed, 14 Sep 2011 13:44:49 GMT
"auto*" is not a leading wildcard query, a leading wildcard query would be
"*car". Wildcard queries in general will take more time than regular
queries, the more close the wildcard is to the first character, the more
expensive the query is.
With a regular field type, Solr will allow wildcards (not with dismax) like
"auto*", but not leading wildcard queries like "*car".

The ReverseWilcardFilter is there for allowing leading wildcards on
searches. It only needs to be added at index time (not at query time). When
using this field type, all the terms at index time will be reversed like you
showed on your example, adding an *impossible character* at the beginning of
the term to prevent it to match regular terms.

'autocar' will be indexed as 'autocar' and '#1;racotua' (see '#1;', that's
the impossible character).

When you search for 'auto*', Solr will resolve the query as always but if
you search for '*car', the query parser (not any analysis filter, that's why
you don't need to add the filter on query-time) will invert that term and
add the 'impossible character' at the beginning, like '#1;rac*'. That's why
'#1;racotuar' should match the query.

>From your configuration, if you remove the filter at query-time it should
work.

Regards,

Tomás

On Wed, Sep 14, 2011 at 6:26 AM, crisfromnova <crisfromnova@gmail.com>wrote:

> I found a partial solution.
> Using ReverseStringFilterFactory instead ReverseWildcardFilterFactory and
> searching after "rac*" will find "autocar" for example.
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Shouldn-t-ReversedWildcardFilterFactory-resolve-leadingWildcard-tp3335240p3335307.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

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