I think you actually can search over all fields, but not in the df parameter. We have a big list of fields we want to search over. So, we just put a dummy one in the df param field, and then we use the fl parameter. With the edismax parser, this works. It looks something like this:
<requestHandler name="/w3search_en" class="solr.SearchHandler"> <lst name="defaults"> <str name="defType">edismax</str> <float name="tie">1.0</float> <str name="echoParams">explicit</str> <int name="rows">30</int> <str name="df">content_en</str> <str name="fl"> update_date, display_url, url, id, uid, scopes, source_id, json_payload, language, snippet, [elevated], title:title_en, description:description_en, score </str> </lst> </requestHandler> -- Audrey Lorberfeld Data Scientist, w3 Search IBM audrey.lorberf...@ibm.com On 10/22/19, 1:01 PM, "Shawn Heisey" <apa...@elyograg.org> wrote: On 10/22/2019 10:26 AM, rhys J wrote: > How do I make Solr search on all fields in a document? Solr does not have a way to ask for all fields on a search. If you use the edismax query parser, you can specify multiple fields with the qf parameter, but there is nothing you can put in that parameter as a shortcut for "all fields." Using qf with multiple fields is the cleanest way to do this. > I read the documentation about the df field, and added the following to my > solrconfig.xml: > > <lst name="defaults"> > <str name="echoParams">explicit</str> > <int name="rows">10</int> > <str name="df">_text_</str> > </lst> The df parameter just means "default field". It can only search one field. > in my managed-schema file i have the following: > > <field name="_text_" type="text_general" multiValued="true" indexed="true" > stored="true"/> > > I have deleted the documents, and re-indexed the csv file. > > When I do a search in the api for: _text_:amy - which should return 2 > documents, I get nothing. Just having a field named _text_ doesn't make anything happen, unless your indexing specifically adds documents with that field defined. There is nothing special about _text_. Other field names that start and end with an underscore, like _version_ or _root_, are special ... but _text_ is not. Probably what you are looking for here is to set up one or more copyField definitions in your schema, which are configured to copy one or more of your other fields to _text_ so it can be searched as a catchall field. I find it useful to name that field "catchall" rather than something like _text_ which seems like a special field name, but isn't. Thanks, Shawn