SOLR-4646: eDismax lowercaseOperators now defaults to "false" for luceneMatchVersion >= 7.0.0

This commit is contained in:
Jan Høydahl 2017-06-20 13:39:36 +02:00
parent 39dfb7808a
commit 8648b005e2
5 changed files with 21 additions and 4 deletions

View File

@ -102,6 +102,9 @@ Upgrading from Solr 6.x
curl http://host:8983/solr/mycollection/config -d '{"set-user-property": {"update.autoCreateFields":"false"}}'
Please see SOLR-10574 for details.
* The default for eDismax parameter 'lowercaseOperators' now depends on the luceneMatchVersion setting in solrconfig.
It remains 'true' for luceneMatchVersion < 7.0.0 and changes to 'false' from 7.0.0. See also SOLR-4646
New Features
----------------------
* SOLR-9857, SOLR-9858: Collect aggregated metrics from nodes and shard leaders in overseer. (ab)
@ -293,6 +296,8 @@ Other Changes
* SOLR-9623: Disable remote streaming in example configs by default. Adjust Upload Limit defaults (janhoy, yonik)
* SOLR-4646: eDismax lowercaseOperators now defaults to "false" for luceneMatchVersion >= 7.0.0 (janhoy, David Smiley)
================== 6.7.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

View File

@ -46,6 +46,7 @@ import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.MultiPhraseQuery;
import org.apache.lucene.search.PhraseQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.util.Version;
import org.apache.solr.analysis.TokenizerChain;
import org.apache.solr.common.params.DisMaxParams;
import org.apache.solr.common.params.SolrParams;
@ -1703,8 +1704,10 @@ public class ExtendedDismaxQParser extends QParser {
mmAutoRelax = solrParams.getBool(DMP.MM_AUTORELAX, false);
altQ = solrParams.get( DisMaxParams.ALTQ );
lowercaseOperators = solrParams.getBool(DMP.LOWERCASE_OPS, true);
// lowercaseOperators defaults to true for luceneMatchVersion < 7.0 and to false for >= 7.0
lowercaseOperators = solrParams.getBool(DMP.LOWERCASE_OPS,
!req.getCore().getSolrConfig().luceneMatchVersion.onOrAfter(Version.LUCENE_7_0_0));
/* * * Boosting Query * * */
boostParams = solrParams.getParams(DisMaxParams.BQ);

View File

@ -189,6 +189,14 @@ public class TestExtendedDismaxParser extends SolrTestCaseJ4 {
"defType", "edismax")
, "*[count(//doc)=0]");
assertQ("The default for lowercaseOperators should not allow lower case and",
req("q", "Zapp and Brannigan",
"qf", "name",
"q.op", "AND",
"sow", sow,
"defType", "edismax")
, "*[count(//doc)=0]");
assertQ("Lower case operator, allow lower case operators",
req("q", "Zapp and Brannigan",
"qf", "name",
@ -284,7 +292,7 @@ public class TestExtendedDismaxParser extends SolrTestCaseJ4 {
"q","Order AND op"), oner
);
assertQ(req("defType", "edismax", "qf", "name title subject text",
"q","Order and op"), oner
"q","Order and op"), twor
);
assertQ(req("defType", "edismax", "qf", "name title subject text",
"q","+Order op"), oner

View File

@ -59,6 +59,7 @@ A multivalued list of strings parsed as queries with scores multiplied by the sc
=== The lowercaseOperators Parameter
A Boolean parameter indicating if lowercase "and" and "or" should be treated the same as operators "AND" and "OR".
Defaults to `false`.
[[TheExtendedDisMaxQueryParser-ThepsParameter]]
=== The ps Parameter

View File

@ -23,7 +23,7 @@ solrAdminApp.controller('QueryController',
$scope.query = {wt: 'json', q:'*:*', indent:'on'};
$scope.filters = [{fq:""}];
$scope.dismax = {defType: "dismax"};
$scope.edismax = {defType: "edismax", stopwords: true, lowercaseOperators: true};
$scope.edismax = {defType: "edismax", stopwords: true, lowercaseOperators: false};
$scope.hl = {hl:"on"};
$scope.facet = {facet: "on"};
$scope.spatial = {};