lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject lucene-solr:branch_6x: SOLR-9557: Every implicit requesthandler now has a default 'useParams' attribute
Date Mon, 26 Sep 2016 11:29:24 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x 0bece6fb0 -> ecdfe97d3


SOLR-9557: Every implicit requesthandler now has a default 'useParams' attribute


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

Branch: refs/heads/branch_6x
Commit: ecdfe97d34f6e808efc8e8efed6ce1306a4ee8e5
Parents: 0bece6f
Author: Noble Paul <noble@apache.org>
Authored: Mon Sep 26 16:59:15 2016 +0530
Committer: Noble Paul <noble@apache.org>
Committed: Mon Sep 26 16:59:15 2016 +0530

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  3 ++
 .../org/apache/solr/util/SolrPluginUtils.java   |  2 +
 solr/core/src/resources/ImplicitPlugins.json    | 43 +++++++++++++++-----
 .../conf/params.json                            | 11 +++++
 .../conf/solrconfig.xml                         | 12 ------
 .../org/apache/solr/common/util/StrUtils.java   |  3 ++
 6 files changed, 52 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ecdfe97d/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 8cffc63..0f746c5 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -67,6 +67,9 @@ New Features
 
 * SOLR-9558: DIH TemplateTransformerto to support multivalued fields (Ted Sullivan via noble)
 
+* SOLR-9557: Every implicit requesthandler now has a default 'useParams' attribute (noble)
+
+
 Bug Fixes
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ecdfe97d/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java b/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java
index ed38bc5..9b053c4 100644
--- a/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java
+++ b/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java
@@ -84,6 +84,7 @@ import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.ImmutableMap;
 
+import static java.util.Collections.singletonList;
 import static org.apache.solr.core.PluginInfo.APPENDS;
 import static org.apache.solr.core.PluginInfo.DEFAULTS;
 import static org.apache.solr.core.PluginInfo.INVARIANTS;
@@ -184,6 +185,7 @@ public class SolrPluginUtils {
     if (paramSets == null) return defaults;
     for (String name : StrUtils.splitSmart(paramSets, ',')) {
       RequestParams.VersionedParams params = requestParams.getParams(name, type);
+      if (params == null) return defaults;
       if (type.equals(DEFAULTS)) {
         defaults = SolrParams.wrapDefaults(params, defaults);
       } else if (type.equals(INVARIANTS)) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ecdfe97d/solr/core/src/resources/ImplicitPlugins.json
----------------------------------------------------------------------
diff --git a/solr/core/src/resources/ImplicitPlugins.json b/solr/core/src/resources/ImplicitPlugins.json
index 58f6b79..e74cc2a 100644
--- a/solr/core/src/resources/ImplicitPlugins.json
+++ b/solr/core/src/resources/ImplicitPlugins.json
@@ -1,21 +1,25 @@
 {
   "requestHandler": {
     "/update": {
+      "useParams":"_UPDATE",
       "class": "solr.UpdateRequestHandler"
     },
     "/update/json": {
+      "useParams":"_UPDATE_JSON",
       "class": "solr.UpdateRequestHandler",
       "invariants": {
         "update.contentType": "application/json"
       }
     },
     "/update/csv": {
+      "useParams":"_UPDATE_CSV",
       "class": "solr.UpdateRequestHandler",
       "invariants": {
         "update.contentType": "application/csv"
       }
     },
     "/update/json/docs": {
+      "useParams":"_UPDATE_JSON_DOCS",
       "class": "solr.UpdateRequestHandler",
       "invariants": {
         "update.contentType": "application/json",
@@ -23,16 +27,21 @@
       }
     },
     "/config": {
+      "useParams":"_CONFIG",
       "class": "solr.SolrConfigHandler"
     },
     "/schema": {
-      "class": "solr.SchemaHandler"
+      "class": "solr.SchemaHandler",
+      "useParams":"_SCHEMA"
+
     },
     "/replication": {
-      "class": "solr.ReplicationHandler"
+      "class": "solr.ReplicationHandler",
+      "useParams":"_REPLICATION"
     },
     "/get": {
       "class": "solr.RealTimeGetHandler",
+      "useParams":"_GET",
       "defaults": {
         "omitHeader": true,
         "wt": "json",
@@ -41,40 +50,50 @@
     },
     "/admin/ping": {
       "class": "solr.PingRequestHandler",
+      "useParams":"_ADMIN_PING",
       "invariants": {
         "echoParams": "all",
         "q": "{!lucene}*:*"
       }
     },
     "/admin/segments": {
-      "class": "solr.SegmentsInfoRequestHandler"
+      "class": "solr.SegmentsInfoRequestHandler",
+      "useParams":"_ADMIN_SEGMENTS"
     },
     "/admin/luke": {
-      "class": "solr.LukeRequestHandler"
+      "class": "solr.LukeRequestHandler",
+      "useParams":"_ADMIN_LUKE"
     },
     "/admin/system": {
-      "class": "solr.SystemInfoHandler"
+      "class": "solr.SystemInfoHandler",
+      "useParams":"_ADMIN_SYSTEM"
     },
     "/admin/mbeans": {
-      "class": "solr.SolrInfoMBeanHandler"
+      "class": "solr.SolrInfoMBeanHandler",
+      "useParams":"_ADMIN_MBEANS"
     },
     "/admin/plugins": {
       "class": "solr.PluginInfoHandler"
     },
     "/admin/threads": {
-      "class": "solr.ThreadDumpHandler"
+      "class": "solr.ThreadDumpHandler",
+      "useParams":"_ADMIN_THREADS"
     },
     "/admin/properties": {
-      "class": "solr.PropertiesRequestHandler"
+      "class": "solr.PropertiesRequestHandler",
+      "useParams":"_ADMIN_PROPERTIES"
     },
     "/admin/logging": {
-      "class": "solr.LoggingHandler"
+      "class": "solr.LoggingHandler",
+      "useParams":"_ADMIN_LOGGING"
     },
     "/admin/file": {
-      "class": "solr.ShowFileRequestHandler"
+      "class": "solr.ShowFileRequestHandler",
+      "useParams":"_ADMIN_FILE"
     },
     "/export": {
       "class": "solr.SearchHandler",
+      "useParams":"_EXPORT",
       "components": [
         "query"
       ],
@@ -86,6 +105,7 @@
     },
     "/graph": {
       "class": "solr.GraphHandler",
+      "useParams":"_ADMIN_GRAPH",
       "invariants": {
         "wt": "graphml",
         "distrib": false
@@ -93,6 +113,7 @@
     },
     "/stream": {
       "class": "solr.StreamHandler",
+      "useParams":"_STREAM",
       "invariants": {
         "wt": "json",
         "distrib": false
@@ -100,6 +121,7 @@
     },
     "/sql": {
       "class": "solr.SQLHandler",
+      "useParams":"_SQL",
       "invariants": {
         "wt": "json",
         "distrib": false
@@ -107,6 +129,7 @@
     },
     "/terms": {
       "class": "solr.SearchHandler",
+      "useParams":"_TERMS",
       "components": [
         "terms"
       ]

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ecdfe97d/solr/server/solr/configsets/sample_techproducts_configs/conf/params.json
----------------------------------------------------------------------
diff --git a/solr/server/solr/configsets/sample_techproducts_configs/conf/params.json b/solr/server/solr/configsets/sample_techproducts_configs/conf/params.json
new file mode 100644
index 0000000..ac72676
--- /dev/null
+++ b/solr/server/solr/configsets/sample_techproducts_configs/conf/params.json
@@ -0,0 +1,11 @@
+{
+  "params": {
+    "_UPDATE_JSON_DOCS": {
+      "srcField": "_src_",
+      "mapUniqueKeyOnly": true,
+      "": {
+        "v": 0
+      }
+    }
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ecdfe97d/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
----------------------------------------------------------------------
diff --git a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
index c5e9592..17c508f 100644
--- a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
+++ b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
@@ -952,18 +952,6 @@
     </lst>
   </initParams>
 
-  <initParams path="/update/json/docs">
-    <lst name="defaults">
-      <!--this ensures that the entire json doc will be stored verbatim into one field-->
-      <str name="srcField">_src_</str>
-      <!--This means a the uniqueKeyField will be extracted from the fields and
-       all fields go into the 'df' field. In this config df is already configured to be 'text'
-        -->
-      <str name="mapUniqueKeyOnly">true</str>
-    </lst>
-
-  </initParams>
-
   <!-- The following are implicitly added
   <requestHandler name="/update/json" class="solr.UpdateRequestHandler">
         <lst name="defaults">

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ecdfe97d/solr/solrj/src/java/org/apache/solr/common/util/StrUtils.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/util/StrUtils.java b/solr/solrj/src/java/org/apache/solr/common/util/StrUtils.java
index 995e142..d414177 100644
--- a/solr/solrj/src/java/org/apache/solr/common/util/StrUtils.java
+++ b/solr/solrj/src/java/org/apache/solr/common/util/StrUtils.java
@@ -26,6 +26,8 @@ import java.util.Locale;
 
 import org.apache.solr.common.SolrException;
 
+import static java.util.Collections.singletonList;
+
 /**
  *
  */
@@ -39,6 +41,7 @@ public class StrUtils {
    * outside strings.
    */
   public static List<String> splitSmart(String s, char separator) {
+    if(s.indexOf(separator) == -1) return singletonList(s);
     ArrayList<String> lst = new ArrayList<>(4);
     int pos=0, start=0, end=s.length();
     char inString=0;


Mime
View raw message