You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2017/05/15 13:59:34 UTC

lucene-solr:master: SOLR-10584: RefGuide updates, removal of some more dead code and a failing test

Repository: lucene-solr
Updated Branches:
  refs/heads/master a1078143e -> 295602ce7


SOLR-10584: RefGuide updates, removal of some more dead code and a failing test


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/295602ce
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/295602ce
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/295602ce

Branch: refs/heads/master
Commit: 295602ce7b925ef5e35a6cb361f581923ee45aab
Parents: a107814
Author: Jan Høydahl <ja...@apache.org>
Authored: Mon May 15 15:59:11 2017 +0200
Committer: Jan Høydahl <ja...@apache.org>
Committed: Mon May 15 15:59:29 2017 +0200

----------------------------------------------------------------------
 .../src/other-schema-elements.adoc              |  8 +--
 solr/solr-ref-guide/src/schema-api.adoc         | 58 --------------------
 .../src/the-dismax-query-parser.adoc            |  2 +-
 .../solrj/request/schema/SchemaRequest.java     | 19 -------
 .../response/schema/SchemaRepresentation.java   | 10 ----
 .../solrj/response/schema/SchemaResponse.java   | 28 ----------
 .../solr/client/solrj/request/SchemaTest.java   | 10 ----
 7 files changed, 5 insertions(+), 130 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/295602ce/solr/solr-ref-guide/src/other-schema-elements.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/other-schema-elements.adoc b/solr/solr-ref-guide/src/other-schema-elements.adoc
index 42254eb..e36c093 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 `<defaultSearchField/>` (which is superseded by the <<the-standard-query-parser.adoc#the-standard-query-parser,`df parameter`>>) and `<solrQueryParser defaultOperator="OR"/>` (which is superseded by the <<the-standard-query-parser.adoc#the-standard-query-parser,`q.op` parameter>>.
+Although it has been deprecated for quite some time, Solr still has support for Schema based configuration of a `<defaultSearchField/>` (which is superseded by the <<the-standard-query-parser.adoc#the-standard-query-parser,`df parameter`>>).
 
-If you have these options specified in your Schema, you are strongly encouraged to replace them with request parameters (or <<request-parameters-api.adoc#request-parameters-api,request parameter defaults>>) 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 <<request-parameters-api.adoc#request-parameters-api,request parameter defaults>>) as support for it will be removed from future Solr release.
 
 [[OtherSchemaElements-Similarity]]
 == Similarity

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/295602ce/solr/solr-ref-guide/src/schema-api.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/schema-api.adoc b/solr/solr-ref-guide/src/schema-api.adoc
index f1ea86b..e414be0 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`: <<SchemaAPI-ShowtheSchemaVersion,retrieve>> the schema version
 * `/schema/uniquekey`: <<SchemaAPI-ListUniqueKey,retrieve>> the defined uniqueKey
 * `/schema/similarity`: <<SchemaAPI-ShowGlobalSimilarity,retrieve>> the global similarity definition
-* `/schema/solrqueryparser/defaultoperator`: <<SchemaAPI-GettheDefaultQueryOperator,retrieve>> 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
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/295602ce/solr/solr-ref-guide/src/the-dismax-query-parser.adoc
----------------------------------------------------------------------
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 585e222..4396bb1 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
 |<<TheDisMaxQueryParser-TheqParameter,q>> |Defines the raw input strings for the query.
 |<<TheDisMaxQueryParser-Theq.altParameter,q.alt>> |Calls the standard query parser and defines query input strings, when the q parameter is not used.
 |<<TheDisMaxQueryParser-Theqf_QueryFields_Parameter,qf>> |Query Fields: specifies the fields in the index on which to perform the query. If absent, defaults to `df`.
-|<<TheDisMaxQueryParser-Themm_MinimumShouldMatch_Parameter,mm>> |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 "`).
+|<<TheDisMaxQueryParser-Themm_MinimumShouldMatch_Parameter,mm>> |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 "`).
 |<<TheDisMaxQueryParser-Thepf_PhraseFields_Parameter,pf>> |Phrase Fields: boosts the score of documents in cases where all of the terms in the q parameter appear in close proximity.
 |<<TheDisMaxQueryParser-Theps_PhraseSlop_Parameter,ps>> |Phrase Slop: specifies the number of positions two terms can be apart in order to match the specified phrase.
 |<<TheDisMaxQueryParser-Theqs_QueryPhraseSlop_Parameter,qs>> |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.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/295602ce/solr/solrj/src/java/org/apache/solr/client/solrj/request/schema/SchemaRequest.java
----------------------------------------------------------------------
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 1c92b40..5663f51 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
@@ -355,25 +355,6 @@ public class SchemaRequest extends AbstractSchemaRequest<SchemaResponse> {
   }
 
   /**
-   * Retrieves the default operator if it is defined in the schema.
-   */
-  public static class DefaultQueryOperator extends AbstractSchemaRequest<SchemaResponse.DefaultQueryOperatorResponse> {
-    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.
    * Note that the request will be translated to json, so please use concrete values (e.g. : true, 1)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/295602ce/solr/solrj/src/java/org/apache/solr/client/solrj/response/schema/SchemaRepresentation.java
----------------------------------------------------------------------
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 9817098..68441bc 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<String, Object> similarity;
 
   private List<Map<String, Object>> 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<String, Object> getSimilarity() {
     return similarity;
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/295602ce/solr/solrj/src/java/org/apache/solr/client/solrj/response/schema/SchemaResponse.java
----------------------------------------------------------------------
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 088cd60..e45d023 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));
@@ -171,14 +170,6 @@ public class SchemaResponse extends SolrResponseBase {
   }
 
   @SuppressWarnings("unchecked")
-  private static String getDefaultOperator(Map schemaNamedList) {
-    String defaultOperator = null;
-    NamedList<Object> solrQueryParserProperties = (NamedList<Object>) schemaNamedList.get("solrQueryParser");
-    if (solrQueryParserProperties != null) defaultOperator = (String) solrQueryParserProperties.get("defaultOperator");
-    return defaultOperator;
-  }
-
-  @SuppressWarnings("unchecked")
   private static List<Map<String, Object>> getFields(Map schemaNamedList) {
     List<Map<String, Object>> fieldsAttributes = new LinkedList<>();
     List<NamedList<Object>> fieldsResponse = (List<NamedList<Object>>) schemaNamedList.get("fields");
@@ -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<Object> response) {
-      super.setResponse(response);
-
-      defaultOperator = (String) response.get("defaultOperator");
-    }
-
-    public String getDefaultOperator() {
-      return defaultOperator;
-    }
-  }
-
   public static class CopyFieldsResponse extends SolrResponseBase {
     List<Map<String, Object>> copyFields;
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/295602ce/solr/solrj/src/test/org/apache/solr/client/solrj/request/SchemaTest.java
----------------------------------------------------------------------
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 3bbcff1..aded373 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
@@ -243,16 +243,6 @@ public class SchemaTest extends RestTestBase {
   }
 
   @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();
     SchemaResponse.FieldsResponse initialFieldsResponse = fieldsSchemaRequest.process(getSolrClient());