The presence of a wildcard in a query term short circuits some portions of the analysis process. Some token filters like lower case can still be performed on the query terms, but others, like stemming, cannot. So, either simplify the analysis (be more selective of what token filters you use), or you will have to modify your query terms so that you manually simulate the token transformations that your text analysis is performing.

Take one of your indexed terms that you think should match and send it through the Solr Admin UI analysis page for the query field and see what the source token gets analyzed into - that's what your wildcard prefix must match. Sometimes (usually!) you will be surprised.

-- Jack Krupansky

-----Original Message----- From: Wayne W
Sent: Wednesday, October 1, 2014 7:16 AM
To: solr-user@lucene.apache.org
Subject: Wildcard search makes no sense!!

Hi,

I don't understand this at all. We are indexing some contact names. When we
do a standard query:

query 1: capi*
result: Capital Health

query 2: capit*
result: Capital Health

query 3: capita*
result: <no results>

query 4: capital*
result: <no results>

I understand (as we are using solar 3.5) that the wildcard search does not
actually return the query without the wildcard so I understand at least why
query 4 is not working ( I need to use: capital* OR capital ). What I don't
understand is why query 3 is not working.

Also if we place in the text field the following 3 contacts:

j...@capitalhealth.com
f...@capitalhealth.com
Capital Heath

When searching for:

query A: capita*
result: j...@capitalhealth.com, f...@capitalhealth.com

query B: capit*
result: j...@capitalhealth.com, f...@capitalhealth.com, Capital Heath


What is going on and how can I solve this?
many thanks as I'm really stuck on this

Reply via email to