I think a doubled-ended wildcard essentially defeats the whole point of the reverse wildcard filter, which is to improve performance by avoiding a leading wildcard. So, if your data is such that a leading wildcard is okay, just use normal wildcards to begin with.

-- Jack Krupansky

-----Original Message----- From: maurizio1976
Sent: Friday, June 29, 2012 8:21 AM
To: solr-user@lucene.apache.org
Subject: Wildcard searches with leading and ending wildcard

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: http://lucene.472066.n3.nabble.com/Wildcard-searches-with-leading-and-ending-wildcard-tp3992086.html Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to