Really, really, get in the habit of looking at your query with
&debugQuery=on appended, it'll save you a world of pain <G>..

customer_name:John Do*
doesn't do what you think. It parses into
customer_name:John OR default_search_field:Do*

you want something like customer_name:(+John +Do*) or
+customer_name:John +customer_name:Do*

You want to look particularly at the parsedquery part of the return, the
scoring stuff is useful for understanding scoring...

And, watch out for your default operator. In the absence of you setting it
in your schema.xml file, it is OR, and a result (with &debugQuery=on) of
customer_name:John customer_name:Do* translates as though it is a
SHOULD clause...

Best
Erick

On Thu, Sep 22, 2011 at 7:08 PM, jaystang <jamie.dul...@gmail.com> wrote:
> Hey guys,
> Very new to solr.  I'm using the data import handler to pull customer data
> out of my database and index it.  All works great so far.  Now I'm trying to
> query against a specific field and I seem to be struggling with doing a
> wildcard search. See below.
>
> I have several indexed documents with a "customer_name" field containing
> "John Doe".  I have a UI that contains a listing of this indexed data as
> well has a keyword filter field (filter as you type).  So I would like when
> the user starts typing "J", "John Doe will return, and "Jo", "John Doe" will
> return, "Joh"... etc, etc...
>
> I've tried the following:
>
> Search: customer_name:Joh*
> Returns: The correct "John Doe" Record"
>
> Search: customer_name:John Do*
> Returns: No results (nothing returns w/ 2 works since I don't have the
> string in quotes.)
>
> Search: customer_name:"Joh*"
> Returns: No results
>
> Search: customer_name:"John Do*"
> Returns: No results
>
> Search: customer_NAME:"John Doe*"
> Returns: The correct "John Doe" Record"
>
> I feel like I'm close, only issue is when there are multiple words.
>
> Any advice would be appreciated.
>
> Thanks!
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Solr-wildcard-searching-tp3360681p3360681.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply via email to