Besides the obvious need to clean up the getDefaultSearchFieldName references, I would also suggest that the "df" param have a hard-wired default of "text" since that is the obvious default.

-- Jack Krupansky

-----Original Message----- From: Bernd Fehling
Sent: Friday, June 08, 2012 10:15 AM
To: solr-user@lucene.apache.org
Subject: defaultSearchField and param df are messed up in 3.6.x

Unfortunately I must see that defaultSearchField and param df are
pretty much messed up in solr 3.6.x
Yes, I have seen issue SOLR-2724 and SOLR-3292.

So if defaultSearchField has been removed (deprecated) from schema.xml then why are the still calls to "org.apache.solr.schema.IndexSchema.getDefaultSearchFieldName()"?

All these calls get no result, because there is no defaultSearchField.
This also breaks edismax (ExtendedDismaxQParserPlugin) and several other.
As example in method parse() it tries
...
   queryFields = U.parseFieldBoosts(solrParams.getParams(DMP.QF));
   if (0 == queryFields.size()) {
     queryFields.put(req.getSchema().getDefaultSearchFieldName(), 1.0f);
   }
...

Guess what, yes no result and an empty search :-(
A grep for "getDefaultSearchFieldName" pointed out that there are several
places where this method is still in use for sorl 3.6.x.

A workaround is to enable defaultSearchField in schema.xml again.

Or to fix all places in the code, e.g. for ExtendedDismaxQParserPlugin method parse()
must then read
...
   queryFields = U.parseFieldBoosts(solrParams.getParams(DMP.QF));
   if (0 == queryFields.size()) {
     queryFields.put(solrParams.getParams("df"));
   }
...

or something similar.

I would also recommend to enable defaultOperator in schema.xml again. Just in case
they forgot to fix places where they try to access defaultOperator.


Regards
Bernd

Reply via email to