df is default field - you can only give one. To search over multiple
fields, you switch to eDisMax query parser and fl parameter.

Then, the question will be what type definition your fields have. When you
search text field, you are using its definition because of copyField. Your
original fields may be strings.

Remember to reload core and reminded when you change definitions.

Regards,
   Alex


On 16 Mar 2017 9:15 AM, "Mark Johnson" <mjohn...@emersonecologics.com>
wrote:

> Forgive me if I'm missing something obvious -- I'm new to Solr, but I can't
> seem to find an explanation for the behavior I'm seeing.
>
> If I have a document that looks like this:
> {
>     field1: "aaa bbb",
>     field2: "ccc ddd",
>     field3: "eee fff"
> }
>
> And I do a search where "q" is "aaa ccc", I get the document in the
> results. This is because (please correct me if I'm wrong) the default "df"
> is set to the "_text_" field, which contains the text values from all
> fields.
>
> However, if I do a search where "df" is "field1" and "field2" and "q" is
> "aaa ccc" (words from field1 and field2) I get no results.
>
> In a simpler example, if I do a search where "df" is "field1" and "q" is
> "aaa" (a word from field1) I still get no results.
>
> If I do a search where "df" is "field1" and "q" is "aaa bbb" (the full
> value of field1) then I get the document in the results.
>
> So I'm concluding that when using "df" to specify which fields to search
> then only an exact match on the full field value will return a document.
>
> Is that a correct conclusion? Is there another way to specify which fields
> to search without requiring an exact match? The results I'd like to achieve
> are:
>
> Would Match:
> q=aaa
> q=aaa bbb
> q=aaa ccc
> q=aaa fff
>
> Would Not Match:
> q=eee
> q=fff
> q=eee fff
>
> --
> *This message is intended only for the use of the individual or entity to
> which it is addressed and may contain information that is privileged,
> confidential and exempt from disclosure under applicable law. If you have
> received this message in error, you are hereby notified that any use,
> dissemination, distribution or copying of this message is prohibited. If
> you have received this communication in error, please notify the sender
> immediately and destroy the transmitted information.*
>

Reply via email to