lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <>
Subject Re: Wildcard searches with leading and ending wildcard
Date Sun, 01 Jul 2012 00:55:38 GMT
for searching sub-strings, ngrams are generally preferred. To expand
on Jack's point.

The whole purpose behind reversed wildcards is that without them, searching for
*abcd requires that _every_ term in your field be enumerated, which can be very
expensive. Adding in reversed wildcards causes this to turn into a
trailing wildcard,
and enumerating bcda* is much easier/less costly.


On Fri, Jun 29, 2012 at 9:21 AM, maurizio1976
<> wrote:
> Hi all,
> I've been searching for an answer to this everywhere but I can never find an
> answer that is perfect for my case, so I'll ask this myself.
> I'm on Solr 3.6.
> I'm using I use the *ReversedWildcardFilterFactory* in a field containing a
> telephone number.
> So only one word to be indexed, no phrases no strange tokens.
> To be more exact: <filter class="solr.ReversedWildcardFilterFactory"
> withOriginal="true"
>            maxPosAsterisk="3" maxPosQuestion="2"
> maxFractionAsterisk="0.33"/>
> I can check with Luke that two words are being indexed, one the reverse of
> the other. Perfect.
> I can run a query like this:*/ Num:*1234/* that will match docs starting
> with 1234
> and I can run a query like this:* /Num:1234*/* that will match docs ending
> with 1234
> but this is the question that everybody seems to be asking.
> Can I run in any way a query that will match records that "contains" the
> value 1234?
> If I write this: Num:*1234* this will match docs containing 1234 but also
> docs containing 4321 which is wrong. this means this query: /Num*4321*/ and
> this query: /Num:*1234*/ return exactly the same result.
> Is this the wrong approach? has anybody tried the N-gram solution to this
> problem?
> thanks very much
> Maurizio
> --
> View this message in context:
> Sent from the Solr - User mailing list archive at

View raw message