diff --git a/solr/solr-ref-guide/src/other-schema-elements.adoc b/solr/solr-ref-guide/src/other-schema-elements.adoc index 42254ebeb07..e36c093fe39 100644 --- a/solr/solr-ref-guide/src/other-schema-elements.adoc +++ b/solr/solr-ref-guide/src/other-schema-elements.adoc @@ -21,12 +21,12 @@ Schema defaults and `copyFields` cannot be used to populate the `uniqueKey` fiel Further, the operation will fail if the `uniqueKey` field is used, but is multivalued (or inherits the multivalue-ness from the `fieldtype`). However, `uniqueKey` will continue to work, as long as the field is properly used. -[[OtherSchemaElements-DefaultSearchField_QueryOperator]] -== Default Search Field & Query Operator +[[OtherSchemaElements-DefaultSearchField]] +== Default Search Field -Although they have been deprecated for quite some time, Solr still has support for Schema based configuration of a `` (which is superseded by the <>) and `` (which is superseded by the <>. +Although it has been deprecated for quite some time, Solr still has support for Schema based configuration of a `` (which is superseded by the <>). -If you have these options specified in your Schema, you are strongly encouraged to replace them with request parameters (or <>) as support for them may be removed from future Solr release. +If you have this option specified in your Schema, you are strongly encouraged to replace it with request parameters (or <>) as support for it will be removed from future Solr release. [[OtherSchemaElements-Similarity]] == Similarity diff --git a/solr/solr-ref-guide/src/schema-api.adoc b/solr/solr-ref-guide/src/schema-api.adoc index f1ea86b061b..e414be09bab 100644 --- a/solr/solr-ref-guide/src/schema-api.adoc +++ b/solr/solr-ref-guide/src/schema-api.adoc @@ -47,7 +47,6 @@ bin/solr -e cloud -noprompt * `/schema/version`: <> the schema version * `/schema/uniquekey`: <> the defined uniqueKey * `/schema/similarity`: <> the global similarity definition -* `/schema/solrqueryparser/defaultoperator`: <> the default operator [[SchemaAPI-ModifytheSchema]] == Modify the Schema @@ -1165,63 +1164,6 @@ curl http://localhost:8983/solr/gettingstarted/schema/similarity?wt=json ---- -[[SchemaAPI-GettheDefaultQueryOperator]] -=== Get the Default Query Operator - -`GET /_collection_/schema/solrqueryparser/defaultoperator` - -[[SchemaAPI-INPUT.9]] -==== INPUT - -*Path Parameters* - -// TODO: Change column width to %autowidth.spread when https://github.com/asciidoctor/asciidoctor-pdf/issues/599 is fixed - -[cols="30,70",options="header"] -|=== -|Key |Description -|collection |The collection (or core) name. -|=== - -*Query Parameters* - -The query parameters can be added to the API request after a '?'. - -// TODO: Change column width to %autowidth.spread when https://github.com/asciidoctor/asciidoctor-pdf/issues/599 is fixed - -[cols="15,10,10,10,55",options="header"] -|=== -|Key |Type |Required |Default |Description -|wt |string |No |json |Defines the format of the response. The options are *json* or *xml*. If not specified, JSON will be returned by default. -|=== - -[[SchemaAPI-OUTPUT.9]] -==== OUTPUT - -*Output Content* - -The output will include simply the default operator if none is defined by the user. - -[[SchemaAPI-EXAMPLES.9]] -==== EXAMPLES - -Get the default operator. - -[source,bash] ----- -curl http://localhost:8983/solr/gettingstarted/schema/solrqueryparser/defaultoperator?wt=json ----- - -[source,json] ----- -{ - "responseHeader":{ - "status":0, - "QTime":2}, - "defaultOperator":"OR"} ----- - - [[SchemaAPI-ManageResourceData]] == Manage Resource Data diff --git a/solr/solr-ref-guide/src/the-dismax-query-parser.adoc b/solr/solr-ref-guide/src/the-dismax-query-parser.adoc index 585e222f907..4396bb17e0d 100644 --- a/solr/solr-ref-guide/src/the-dismax-query-parser.adoc +++ b/solr/solr-ref-guide/src/the-dismax-query-parser.adoc @@ -30,7 +30,7 @@ In addition to the common request parameter, highlighting parameters, and simple |<> |Defines the raw input strings for the query. |<> |Calls the standard query parser and defines query input strings, when the q parameter is not used. |<> |Query Fields: specifies the fields in the index on which to perform the query. If absent, defaults to `df`. -|<> |Minimum "Should" Match: specifies a minimum number of clauses that must match in a query. If no 'mm' parameter is specified in the query, or as a default in `solrconfig.xml`, the effective value of the `q.op` parameter (either in the query, as a default in `solrconfig.xml`, or from the `defaultOperator` option in the Schema) is used to influence the behavior. If `q.op` is effectively AND'ed, then mm=100%; if `q.op` is OR'ed, then mm=1. Users who want to force the legacy behavior should set a default value for the 'mm' parameter in their `solrconfig.xml` file. Users should add this as a configured default for their request handlers. This parameter tolerates miscellaneous white spaces in expressions (e.g., `" 3 < -25% 10 < -3\n", " \n-25%\n ", " \n3\n "`). +|<> |Minimum "Should" Match: specifies a minimum number of clauses that must match in a query. If no 'mm' parameter is specified in the query, or as a default in `solrconfig.xml`, the effective value of the `q.op` parameter (either in the query or as a default in `solrconfig.xml`) is used to influence the behavior. If `q.op` is effectively AND'ed, then mm=100%; if `q.op` is OR'ed, then mm=1. Users who want to force the legacy behavior should set a default value for the 'mm' parameter in their `solrconfig.xml` file. Users should add this as a configured default for their request handlers. This parameter tolerates miscellaneous white spaces in expressions (e.g., `" 3 < -25% 10 < -3\n", " \n-25%\n ", " \n3\n "`). |<> |Phrase Fields: boosts the score of documents in cases where all of the terms in the q parameter appear in close proximity. |<> |Phrase Slop: specifies the number of positions two terms can be apart in order to match the specified phrase. |<> |Query Phrase Slop: specifies the number of positions two terms can be apart in order to match the specified phrase. Used specifically with the `qf` parameter. diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/schema/SchemaRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/schema/SchemaRequest.java index 1c92b407175..5663f510b1b 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/schema/SchemaRequest.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/schema/SchemaRequest.java @@ -354,25 +354,6 @@ public class SchemaRequest extends AbstractSchemaRequest { } } - /** - * Retrieves the default operator if it is defined in the schema. - */ - public static class DefaultQueryOperator extends AbstractSchemaRequest { - public DefaultQueryOperator() { - this(null); - } - - public DefaultQueryOperator(SolrParams q) { - super(METHOD.GET, "/schema/solrqueryparser/defaultoperator", q); - } - - @Override - protected SchemaResponse.DefaultQueryOperatorResponse createResponse(SolrClient client) { - return new SchemaResponse.DefaultQueryOperatorResponse(); - } - } - - /** * Adds a new field definition to the schema. * If the field already exists, the method {@link #process(SolrClient, String)} will fail. diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/response/schema/SchemaRepresentation.java b/solr/solrj/src/java/org/apache/solr/client/solrj/response/schema/SchemaRepresentation.java index 98170982a70..68441bc1156 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/response/schema/SchemaRepresentation.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/response/schema/SchemaRepresentation.java @@ -31,8 +31,6 @@ public class SchemaRepresentation { private String defaultSearchField; - private String defaultOperator; - private Map similarity; private List> fields; @@ -76,14 +74,6 @@ public class SchemaRepresentation { this.defaultSearchField = defaultSearchField; } - public String getDefaultOperator() { - return defaultOperator; - } - - public void setDefaultOperator(String defaultOperator) { - this.defaultOperator = defaultOperator; - } - public Map getSimilarity() { return similarity; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/response/schema/SchemaResponse.java b/solr/solrj/src/java/org/apache/solr/client/solrj/response/schema/SchemaResponse.java index 088cd603a4a..e45d02390cd 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/response/schema/SchemaResponse.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/response/schema/SchemaResponse.java @@ -138,7 +138,6 @@ public class SchemaResponse extends SolrResponseBase { schemaRepresentation.setVersion(getSchemaVersion(schemaObj)); schemaRepresentation.setUniqueKey(getSchemaUniqueKey(schemaObj)); schemaRepresentation.setDefaultSearchField(getDefaultSearchField(schemaObj)); - schemaRepresentation.setDefaultOperator(getDefaultOperator(schemaObj)); schemaRepresentation.setSimilarity(getSimilarity(schemaObj)); schemaRepresentation.setFields(getFields(schemaObj)); schemaRepresentation.setDynamicFields(getDynamicFields(schemaObj)); @@ -170,14 +169,6 @@ public class SchemaResponse extends SolrResponseBase { return similarity; } - @SuppressWarnings("unchecked") - private static String getDefaultOperator(Map schemaNamedList) { - String defaultOperator = null; - NamedList solrQueryParserProperties = (NamedList) schemaNamedList.get("solrQueryParser"); - if (solrQueryParserProperties != null) defaultOperator = (String) solrQueryParserProperties.get("defaultOperator"); - return defaultOperator; - } - @SuppressWarnings("unchecked") private static List> getFields(Map schemaNamedList) { List> fieldsAttributes = new LinkedList<>(); @@ -416,25 +407,6 @@ public class SchemaResponse extends SolrResponseBase { } - public static class DefaultQueryOperatorResponse extends SolrResponseBase { - private String defaultOperator; - - /** - * {@inheritDoc} - */ - @Override - @SuppressWarnings("unchecked") - public void setResponse(NamedList response) { - super.setResponse(response); - - defaultOperator = (String) response.get("defaultOperator"); - } - - public String getDefaultOperator() { - return defaultOperator; - } - } - public static class CopyFieldsResponse extends SolrResponseBase { List> copyFields; diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/request/SchemaTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/request/SchemaTest.java index 3bbcff1c8d3..aded373c409 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/request/SchemaTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/request/SchemaTest.java @@ -242,16 +242,6 @@ public class SchemaTest extends RestTestBase { globalSimilarityResponse.getSimilarity().get("class")); } - @Test - public void testGetDefaultQueryOperatorAccuracy() throws Exception { - SchemaRequest.DefaultQueryOperator defaultQueryOperatorRequest = - new SchemaRequest.DefaultQueryOperator(); - SchemaResponse.DefaultQueryOperatorResponse defaultQueryOperatorResponse = - defaultQueryOperatorRequest.process(getSolrClient()); - assertValidSchemaResponse(defaultQueryOperatorResponse); - assertEquals("OR", defaultQueryOperatorResponse.getDefaultOperator()); - } - @Test public void testAddFieldAccuracy() throws Exception { SchemaRequest.Fields fieldsSchemaRequest = new SchemaRequest.Fields();