schema.xml snippet:
<field name="id" type="string" indexed="true" stored="true" required="true" />
<field name="notes" type="text_general" indexed="true" stored="true"/>
<field name="missionFocus" type="text_general" indexed="true" stored="true"/>
<field name="name" type="text_general" indexed="true" stored="true"/>
<field name="first_name" type="text_general" indexed="true" stored="true"/>
<field name="last_name" type="text_general" indexed="true" stored="true"/>
<field name="about_me" type="text_general" indexed="true" stored="true"/>
<field name="message" type="text_general" indexed="true" stored="true"/>
<field name="title" type="text_general" indexed="true" stored="true"/>
<field name="table_type" type="string" indexed="true" stored="true"/>
<field name="text" type="text_general" indexed="true" stored="false"
multiValued="true"/>
Now I want to search in all fields (except "id" and "table_type") for e.g. "hello". How I can do this? Do I really have to write following?
/solr/select/?q=notes:hello missionFocus:hello name:hello first_name:hello ..
I heard something about DisMaxRequestHandler but how I have to query with this handler? Do I need to change something in solrconfig.xml for that?
The best solution is to build a field, that collects the data of all fields like this
<field
name="collector"
type="text_general"
indexed="true"
stored="false"
multiValued="true"
/>
The only thing you have to do now is, copy the contents of all fields into that field:
<copyField source="notes" dest="collector"/>
<copyField source="missionFocus" dest="collector"/>
<copyField source="name" dest="collector"/>
....
Be aware that the copyField
block has to be defined BELOW this:
<fields>
....
</fields>
Now you can search only on the field collector
and you will find any text in any of your fields.