For example, I\'ve keyword for search is: \'Basket Ball\'. What is the query that can get all field that contain the \'Basket Ball\',.? I\'ve tried to using *:Basket Ball, b
You need to use a query parser which is able to dispatch tokens to several fields, such as (e)dismax. For exemple if you have two fields field1
and field2
: http://solr/select?q={!dismax}Basket Ball&qf=field1^1 field2^1
See http://wiki.apache.org/solr/DisMaxQParserPlugin#qf_.28Query_Fields.29 for more information on dismax configuration.
The default search field (since 3.6) is now defined in solrconfig.xml
e.g. In the solrconfig.xml that ships with Solr configsets directory you will see something like
<initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell">
<lst name="defaults">
<str name="df">allText</str>
</lst>
</initParams>
You can change allText
to yourDefaultSearchFieldName
schema.xml defines the default search field -
<defaultSearchField>text</defaultSearchField>
You can copy all the fields to this default search field.
<copyField source="field1" dest="text"/>
<copyField source="field2" dest="text"/>
<copyField source="field3" dest="text"/>
And query q=basket ball
should work.