You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2017/06/14 02:02:37 UTC

[01/35] lucene-solr:jira/SOLR-10834: SOLR-10761: Switch trie numeric/date fields to points in data-driven-enabled example and test schemas

Repository: lucene-solr
Updated Branches:
  refs/heads/jira/SOLR-10834 15983ceec -> fcf981324


SOLR-10761: Switch trie numeric/date fields to points in data-driven-enabled example and test schemas


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

Branch: refs/heads/jira/SOLR-10834
Commit: 566fcfce1337d09553a85d17bb4f552b14768646
Parents: f434e34
Author: Steve Rowe <sa...@apache.org>
Authored: Fri Jun 9 19:43:01 2017 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Fri Jun 9 19:43:01 2017 -0400

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  3 ++
 .../AddSchemaFieldsUpdateProcessorFactory.java  | 12 +++----
 ...chema-add-schema-fields-update-processor.xml | 22 +++++++++++++
 .../solr/collection1/conf/schema-rest.xml       | 33 +++++++++++++++++++-
 ...dd-schema-fields-update-processor-chains.xml | 30 +++++++++---------
 .../collection1/conf/solrconfig-schemaless.xml  |  6 ++--
 .../schema/TestFieldCollectionResource.java     | 10 +++---
 ...dSchemaFieldsUpdateProcessorFactoryTest.java | 16 +++++-----
 solr/example/files/conf/managed-schema          | 20 ++++++++++++
 solr/example/files/conf/solrconfig.xml          |  6 ++--
 .../basic_configs/conf/solrconfig.xml           |  6 ++--
 .../conf/solrconfig.xml                         |  6 ++--
 solr/solr-ref-guide/src/schemaless-mode.adoc    |  6 ++--
 13 files changed, 126 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/566fcfce/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index e5eb0c1..d99a075 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -389,6 +389,9 @@ Other Changes
 
 * SOLR-10501: Test sortMissing{First,Last} with points fields.  (Steve Rowe)
 
+* SOLR-10761: Switch trie numeric/date fields to points in data-driven-enabled example and test schemas.
+  (Steve Rowe)
+
 ==================  6.6.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/566fcfce/solr/core/src/java/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactory.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactory.java
index 4758972..c4a122d 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactory.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactory.java
@@ -92,31 +92,31 @@ import static org.apache.solr.core.ConfigSetProperties.IMMUTABLE_CONFIGSET_ARG;
  *   &lt;str name="defaultFieldType"&gt;text_general&lt;/str&gt;
  *   &lt;lst name="typeMapping"&gt;
  *     &lt;str name="valueClass"&gt;Boolean&lt;/str&gt;
- *     &lt;str name="fieldType"&gt;boolean&lt;/str&gt;
+ *     &lt;str name="fieldType"&gt;booleans&lt;/str&gt;
  *   &lt;/lst&gt;
  *   &lt;lst name="typeMapping"&gt;
  *     &lt;str name="valueClass"&gt;Integer&lt;/str&gt;
- *     &lt;str name="fieldType"&gt;tint&lt;/str&gt;
+ *     &lt;str name="fieldType"&gt;pints&lt;/str&gt;
  *   &lt;/lst&gt;
  *   &lt;lst name="typeMapping"&gt;
  *     &lt;str name="valueClass"&gt;Float&lt;/str&gt;
- *     &lt;str name="fieldType"&gt;tfloat&lt;/str&gt;
+ *     &lt;str name="fieldType"&gt;pfloats&lt;/str&gt;
  *   &lt;/lst&gt;
  *   &lt;lst name="typeMapping"&gt;
  *     &lt;str name="valueClass"&gt;Date&lt;/str&gt;
- *     &lt;str name="fieldType"&gt;tdate&lt;/str&gt;
+ *     &lt;str name="fieldType"&gt;pdates&lt;/str&gt;
  *   &lt;/lst&gt;
  *   &lt;lst name="typeMapping"&gt;
  *     &lt;str name="valueClass"&gt;Long&lt;/str&gt;
  *     &lt;str name="valueClass"&gt;Integer&lt;/str&gt;
- *     &lt;str name="fieldType"&gt;tlong&lt;/str&gt;
+ *     &lt;str name="fieldType"&gt;plongs&lt;/str&gt;
  *   &lt;/lst&gt;
  *   &lt;lst name="typeMapping"&gt;
  *     &lt;arr name="valueClass"&gt;
  *       &lt;str&gt;Double&lt;/str&gt;
  *       &lt;str&gt;Float&lt;/str&gt;
  *     &lt;/arr&gt;
- *     &lt;str name="fieldType"&gt;tdouble&lt;/str&gt;
+ *     &lt;str name="fieldType"&gt;pdoubles&lt;/str&gt;
  *   &lt;/lst&gt;
  * &lt;/processor&gt;</pre>
  */

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/566fcfce/solr/core/src/test-files/solr/collection1/conf/schema-add-schema-fields-update-processor.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-add-schema-fields-update-processor.xml b/solr/core/src/test-files/solr/collection1/conf/schema-add-schema-fields-update-processor.xml
index 7f24944..aa8d860 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-add-schema-fields-update-processor.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-add-schema-fields-update-processor.xml
@@ -33,6 +33,17 @@
     </analyzer>
   </fieldType>
 
+  <fieldType name="pint" class="solr.IntPointField" docValues="true"/>
+  <fieldType name="pfloat" class="solr.FloatPointField" docValues="true"/>
+  <fieldType name="plong" class="solr.LongPointField" docValues="true"/>
+  <fieldType name="pdouble" class="solr.DoublePointField" docValues="true"/>
+  <fieldType name="pints" class="solr.IntPointField" docValues="true" multiValued="true"/>
+  <fieldType name="pfloats" class="solr.FloatPointField" docValues="true" multiValued="true"/>
+  <fieldType name="plongs" class="solr.LongPointField" docValues="true" multiValued="true"/>
+  <fieldType name="pdoubles" class="solr.DoublePointField" docValues="true" multiValued="true"/>
+  <fieldType name="pdate" class="solr.DatePointField" docValues="true"/>
+  <fieldType name="pdates" class="solr.DatePointField" docValues="true" multiValued="true"/>
+
   <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="true"/>
   <field name="_version_" type="long" indexed="true" stored="true"/>
   <field name="_root_" type="string" indexed="true" stored="true" multiValued="false"/>
@@ -44,6 +55,17 @@
   <dynamicField name="*_td" type="tdouble" indexed="true" stored="true"/>
   <dynamicField name="*_tdt" type="tdate" indexed="true" stored="true"/>
 
+  <dynamicField name="*_pi" type="pint"    indexed="true"  stored="true"/>
+  <dynamicField name="*_pis" type="pints"    indexed="true"  stored="true"/>
+  <dynamicField name="*_pl" type="plong"   indexed="true"  stored="true"/>
+  <dynamicField name="*_pls" type="plongs"   indexed="true"  stored="true"/>
+  <dynamicField name="*_pf" type="pfloat"  indexed="true"  stored="true"/>
+  <dynamicField name="*_pfs" type="pfloats"  indexed="true"  stored="true"/>
+  <dynamicField name="*_pd" type="pdouble" indexed="true"  stored="true"/>
+  <dynamicField name="*_pds" type="pdoubles" indexed="true"  stored="true"/>
+  <dynamicField name="*_pdt" type="pdate"  indexed="true"  stored="true"/>
+  <dynamicField name="*_pdts" type="pdates"  indexed="true"  stored="true"/>
+
   <uniqueKey>id</uniqueKey>
 
 </schema>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/566fcfce/solr/core/src/test-files/solr/collection1/conf/schema-rest.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-rest.xml b/solr/core/src/test-files/solr/collection1/conf/schema-rest.xml
index 58b05eb..89c2623 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-rest.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-rest.xml
@@ -90,6 +90,7 @@
   <fieldType name="highlittext" class="solr.TextField"/>
 
   <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
+  <fieldType name="booleans" class="solr.BoolField" sortMissingLast="true" multiValued="true"/>
   <fieldType name="string" class="solr.StrField" sortMissingLast="true"/>
 
   <!-- format for date is 1995-12-31T23:59:59.999Z and only the fractional
@@ -540,7 +541,25 @@
       <filter class="solr.ManagedSynonymGraphFilterFactory" managed="germangraph"/>
     </analyzer>
   </fieldType>
-  
+
+  <!--
+    Numeric field types that index values using KD-trees. *Point fields are faster and more efficient than Trie* fields both, at
+    search time and at index time, but some features are still not supported.
+    Point fields don't support FieldCache, so they must have docValues="true" if needed for sorting, faceting, functions, etc.
+  -->
+  <fieldType name="pint" class="solr.IntPointField" docValues="true"/>
+  <fieldType name="pints" class="solr.IntPointField" docValues="true" multiValued="true"/>
+  <fieldType name="pfloat" class="solr.FloatPointField" docValues="true"/>
+  <fieldType name="pfloats" class="solr.FloatPointField" docValues="true" multiValued="true"/>
+  <fieldType name="plong" class="solr.LongPointField" docValues="true"/>
+  <fieldType name="plongs" class="solr.LongPointField" docValues="true" multiValued="true"/>
+  <fieldType name="pdouble" class="solr.DoublePointField" docValues="true"/>
+  <fieldType name="pdoubles" class="solr.DoublePointField" docValues="true" multiValued="true"/>
+
+  <!-- KD-tree versions of date fields -->
+  <fieldType name="pdate" class="solr.DatePointField" docValues="true"/>
+  <fieldType name="pdates" class="solr.DatePointField" docValues="true" multiValued="true"/>
+
   <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="true"/>
   <field name="signatureField" type="string" indexed="true" stored="false"/>
   <field name="uuid" type="uuid" stored="true"/>
@@ -681,6 +700,18 @@
   <dynamicField name="*_td" type="tdouble" indexed="true" stored="true"/>
   <dynamicField name="*_tdt" type="tdate" indexed="true" stored="true"/>
 
+  <!-- KD-tree (point) numerics -->
+  <dynamicField name="*_pi" type="pint"    indexed="true"  stored="true"/>
+  <dynamicField name="*_pis" type="pints"    indexed="true"  stored="true"/>
+  <dynamicField name="*_pl" type="plong"   indexed="true"  stored="true"/>
+  <dynamicField name="*_pls" type="plongs"   indexed="true"  stored="true"/>
+  <dynamicField name="*_pf" type="pfloat"  indexed="true"  stored="true"/>
+  <dynamicField name="*_pfs" type="pfloats"  indexed="true"  stored="true"/>
+  <dynamicField name="*_pd" type="pdouble" indexed="true"  stored="true"/>
+  <dynamicField name="*_pds" type="pdoubles" indexed="true"  stored="true"/>
+  <dynamicField name="*_pdt" type="pdate"  indexed="true"  stored="true"/>
+  <dynamicField name="*_pdts" type="pdates"  indexed="true"  stored="true"/>
+
   <dynamicField name="ignored_*" type="ignored" multiValued="true"/>
   <dynamicField name="attr_*" type="text" indexed="true" stored="true" multiValued="true"/>
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/566fcfce/solr/core/src/test-files/solr/collection1/conf/solrconfig-add-schema-fields-update-processor-chains.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-add-schema-fields-update-processor-chains.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-add-schema-fields-update-processor-chains.xml
index e574575..4541fbc 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-add-schema-fields-update-processor-chains.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-add-schema-fields-update-processor-chains.xml
@@ -40,27 +40,27 @@
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Integer</str>
-        <str name="fieldType">tint</str>
+        <str name="fieldType">pints</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Float</str>
-        <str name="fieldType">tfloat</str>
+        <str name="fieldType">pfloats</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.util.Date</str>
-        <str name="fieldType">tdate</str>
+        <str name="fieldType">pdates</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Long</str>
         <str name="valueClass">java.lang.Integer</str>
-        <str name="fieldType">tlong</str>
+        <str name="fieldType">plongs</str>
       </lst>
       <lst name="typeMapping">
         <arr name="valueClass">
           <str>java.lang.Double</str>
           <str>java.lang.Float</str>
         </arr>
-        <str name="fieldType">tdouble</str>
+        <str name="fieldType">pdoubles</str>
       </lst>
     </processor>
   </updateRequestProcessorChain>
@@ -74,24 +74,24 @@
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Integer</str>
-        <str name="fieldType">tint</str>
+        <str name="fieldType">pints</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Float</str>
-        <str name="fieldType">tfloat</str>
+        <str name="fieldType">pfloats</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.util.Date</str>
-        <str name="fieldType">tdate</str>
+        <str name="fieldType">pdates</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Long</str>
         <str name="valueClass">java.lang.Integer</str>
-        <str name="fieldType">tlong</str>
+        <str name="fieldType">plongs</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Number</str>
-        <str name="fieldType">tdouble</str>
+        <str name="fieldType">pdoubles</str>
       </lst>
     </processor>
     <processor class="solr.LogUpdateProcessorFactory" />
@@ -132,24 +132,24 @@
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Integer</str>
-        <str name="fieldType">tint</str>
+        <str name="fieldType">pints</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Float</str>
-        <str name="fieldType">tfloat</str>
+        <str name="fieldType">pfloats</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.util.Date</str>
-        <str name="fieldType">tdate</str>
+        <str name="fieldType">pdates</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Long</str>
         <str name="valueClass">java.lang.Integer</str>
-        <str name="fieldType">tlong</str>
+        <str name="fieldType">plongs</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Number</str>
-        <str name="fieldType">tdouble</str>
+        <str name="fieldType">pdoubles</str>
       </lst>
     </processor>
     <processor class="solr.LogUpdateProcessorFactory" />

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/566fcfce/solr/core/src/test-files/solr/collection1/conf/solrconfig-schemaless.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-schemaless.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-schemaless.xml
index 8247d69..ac8321b 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-schemaless.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-schemaless.xml
@@ -85,16 +85,16 @@
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.util.Date</str>
-        <str name="fieldType">tdate</str>
+        <str name="fieldType">pdates</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Long</str>
         <str name="valueClass">java.lang.Integer</str>
-        <str name="fieldType">tlong</str>
+        <str name="fieldType">plongs</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Number</str>
-        <str name="fieldType">tdouble</str>
+        <str name="fieldType">pdoubles</str>
       </lst>
     </processor>
     <processor class="solr.LogUpdateProcessorFactory"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/566fcfce/solr/core/src/test/org/apache/solr/rest/schema/TestFieldCollectionResource.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/rest/schema/TestFieldCollectionResource.java b/solr/core/src/test/org/apache/solr/rest/schema/TestFieldCollectionResource.java
index f3de92b..8d2b555 100644
--- a/solr/core/src/test/org/apache/solr/rest/schema/TestFieldCollectionResource.java
+++ b/solr/core/src/test/org/apache/solr/rest/schema/TestFieldCollectionResource.java
@@ -77,11 +77,11 @@ public class TestFieldCollectionResource extends SolrRestletTestBase {
              "/fields/[0]/name=='HTMLstandardtok'",
              "/fields/[1]/name=='HTMLwhitetok'",
              "/fields/[2]/name=='_version_'",
-             "/fields/[98]/name=='*_d'",
-             "/fields/[97]/name=='*_f'",
-             "/fields/[96]/name=='*_b'",
-             "/fields/[95]/name=='*_t'",
-             "/fields/[94]/name=='*_l'"
+             "/fields/[108]/name=='*_d'",
+             "/fields/[107]/name=='*_f'",
+             "/fields/[106]/name=='*_b'",
+             "/fields/[105]/name=='*_t'",
+             "/fields/[104]/name=='*_l'"
 
     );
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/566fcfce/solr/core/src/test/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactoryTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactoryTest.java b/solr/core/src/test/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactoryTest.java
index 8b59d0e..64d1abf 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactoryTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactoryTest.java
@@ -67,7 +67,7 @@ public class AddSchemaFieldsUpdateProcessorFactoryTest extends UpdateProcessorTe
     assertNotNull(d);
     schema = h.getCore().getLatestSchema();
     assertNotNull(schema.getFieldOrNull(fieldName));
-    assertEquals("tdate", schema.getFieldType(fieldName).getTypeName());
+    assertEquals("pdates", schema.getFieldType(fieldName).getTypeName());
   }
 
   public void testSingleFieldRoundTrip() throws Exception {
@@ -79,7 +79,7 @@ public class AddSchemaFieldsUpdateProcessorFactoryTest extends UpdateProcessorTe
     assertNotNull(d);
     schema = h.getCore().getLatestSchema();
     assertNotNull(schema.getFieldOrNull(fieldName));
-    assertEquals("tfloat", schema.getFieldType(fieldName).getTypeName());
+    assertEquals("pfloats", schema.getFieldType(fieldName).getTypeName());
     assertU(commit());
     assertQ(req("id:2"), "//arr[@name='" + fieldName + "']/float[.='" + floatValue.toString() + "']");
   }
@@ -95,7 +95,7 @@ public class AddSchemaFieldsUpdateProcessorFactoryTest extends UpdateProcessorTe
     assertNotNull(d);
     schema = h.getCore().getLatestSchema();
     assertNotNull(schema.getFieldOrNull(fieldName));
-    assertEquals("tdouble", schema.getFieldType(fieldName).getTypeName());
+    assertEquals("pdoubles", schema.getFieldType(fieldName).getTypeName());
     assertU(commit());
     assertQ(req("id:3")
         ,"//arr[@name='" + fieldName + "']/double[.='" + fieldValue1.toString() + "']"
@@ -141,8 +141,8 @@ public class AddSchemaFieldsUpdateProcessorFactoryTest extends UpdateProcessorTe
     schema = h.getCore().getLatestSchema();
     assertNotNull(schema.getFieldOrNull(fieldName1));
     assertNotNull(schema.getFieldOrNull(fieldName2));
-    assertEquals("tdouble", schema.getFieldType(fieldName1).getTypeName());
-    assertEquals("tlong", schema.getFieldType(fieldName2).getTypeName());
+    assertEquals("pdoubles", schema.getFieldType(fieldName1).getTypeName());
+    assertEquals("plongs", schema.getFieldType(fieldName2).getTypeName());
     assertU(commit());
     assertQ(req("id:5")
         ,"//arr[@name='" + fieldName1 + "']/double[.='" + field1Value1.toString() + "']"
@@ -194,10 +194,10 @@ public class AddSchemaFieldsUpdateProcessorFactoryTest extends UpdateProcessorTe
     assertNotNull(schema.getFieldOrNull(fieldName2));
     assertNotNull(schema.getFieldOrNull(fieldName3));
     assertNotNull(schema.getFieldOrNull(fieldName4));
-    assertEquals("tdouble", schema.getFieldType(fieldName1).getTypeName());
-    assertEquals("tlong", schema.getFieldType(fieldName2).getTypeName());
+    assertEquals("pdoubles", schema.getFieldType(fieldName1).getTypeName());
+    assertEquals("plongs", schema.getFieldType(fieldName2).getTypeName());
     assertEquals("text", schema.getFieldType(fieldName3).getTypeName());
-    assertEquals("tdate", schema.getFieldType(fieldName4).getTypeName());
+    assertEquals("pdates", schema.getFieldType(fieldName4).getTypeName());
     assertU(commit());
     assertQ(req("id:6")
         ,"//arr[@name='" + fieldName1 + "']/double[.='" + field1Value1.toString() + "']"

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/566fcfce/solr/example/files/conf/managed-schema
----------------------------------------------------------------------
diff --git a/solr/example/files/conf/managed-schema b/solr/example/files/conf/managed-schema
index 3c47c35..bf154f4 100644
--- a/solr/example/files/conf/managed-schema
+++ b/solr/example/files/conf/managed-schema
@@ -47,6 +47,16 @@
       <filter class="solr.DoubleMetaphoneFilterFactory" inject="false"/>
     </analyzer>
   </fieldType>
+  <fieldType name="pdate" class="solr.DatePointField" docValues="true"/>
+  <fieldType name="pdates" class="solr.DatePointField" docValues="true" multiValued="true"/>
+  <fieldType name="pdouble" class="solr.DoublePointField" docValues="true"/>
+  <fieldType name="pdoubles" class="solr.DoublePointField" docValues="true" multiValued="true"/>
+  <fieldType name="pfloat" class="solr.FloatPointField" docValues="true"/>
+  <fieldType name="pfloats" class="solr.FloatPointField" docValues="true" multiValued="true"/>
+  <fieldType name="pint" class="solr.IntPointField" docValues="true"/>
+  <fieldType name="pints" class="solr.IntPointField" docValues="true" multiValued="true"/>
+  <fieldType name="plong" class="solr.LongPointField" docValues="true"/>
+  <fieldType name="plongs" class="solr.LongPointField" docValues="true" multiValued="true"/>
   <fieldType name="point" class="solr.PointType" subFieldSuffix="_d" dimension="2"/>
   <fieldType name="random" class="solr.RandomSortField" indexed="true"/>
   <fieldType name="string" class="solr.StrField" sortMissingLast="true"/>
@@ -493,6 +503,7 @@
   <dynamicField name="*_srpt" type="location_rpt" indexed="true" stored="true"/>
   <dynamicField name="*_tdts" type="tdates" indexed="true" stored="true"/>
   <dynamicField name="attr_*" type="text_general" multiValued="true" indexed="true" stored="true"/>
+  <dynamicField name="*_pdts" type="pdates"  indexed="true"  stored="true"/>
   <dynamicField name="*_txt" type="text_general" indexed="true" stored="true"/>
   <dynamicField name="*_dts" type="date" multiValued="true" indexed="true" stored="true"/>
   <dynamicField name="*_tis" type="tints" indexed="true" stored="true"/>
@@ -500,6 +511,11 @@
   <dynamicField name="*_tfs" type="tfloats" indexed="true" stored="true"/>
   <dynamicField name="*_tds" type="tdoubles" indexed="true" stored="true"/>
   <dynamicField name="*_tdt" type="tdate" indexed="true" stored="true"/>
+  <dynamicField name="*_pds" type="pdoubles" indexed="true"  stored="true"/>
+  <dynamicField name="*_pdt" type="pdate"  indexed="true"  stored="true"/>
+  <dynamicField name="*_pfs" type="pfloats"  indexed="true"  stored="true"/>
+  <dynamicField name="*_pis" type="pints"    indexed="true"  stored="true"/>
+  <dynamicField name="*_pls" type="plongs"   indexed="true"  stored="true"/>
   <dynamicField name="*_is" type="ints" indexed="true" stored="true"/>
   <dynamicField name="*_ss" type="strings" indexed="true" stored="true"/>
   <dynamicField name="*_ls" type="longs" indexed="true" stored="true"/>
@@ -512,6 +528,10 @@
   <dynamicField name="*_tf" type="tfloat" indexed="true" stored="true"/>
   <dynamicField name="*_td" type="tdouble" indexed="true" stored="true"/>
   <dynamicField name="*_ws" type="text_ws" indexed="true" stored="true"/>
+  <dynamicField name="*_pd" type="pdouble" indexed="true"  stored="true"/>
+  <dynamicField name="*_pf" type="pfloat"  indexed="true"  stored="true"/>
+  <dynamicField name="*_pi" type="pint"    indexed="true"  stored="true"/>
+  <dynamicField name="*_pl" type="plong"   indexed="true"  stored="true"/>
   <dynamicField name="*_i" type="int" indexed="true" stored="true"/>
   <dynamicField name="*_s" type="string" indexed="true" stored="true"/>
   <dynamicField name="*_l" type="long" indexed="true" stored="true"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/566fcfce/solr/example/files/conf/solrconfig.xml
----------------------------------------------------------------------
diff --git a/solr/example/files/conf/solrconfig.xml b/solr/example/files/conf/solrconfig.xml
index 71da510..35ec28e 100644
--- a/solr/example/files/conf/solrconfig.xml
+++ b/solr/example/files/conf/solrconfig.xml
@@ -1229,16 +1229,16 @@
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.util.Date</str>
-        <str name="fieldType">tdates</str>
+        <str name="fieldType">pdates</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Long</str>
         <str name="valueClass">java.lang.Integer</str>
-        <str name="fieldType">tlongs</str>
+        <str name="fieldType">plongs</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Number</str>
-        <str name="fieldType">tdoubles</str>
+        <str name="fieldType">pdoubles</str>
       </lst>
     </processor>
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/566fcfce/solr/server/solr/configsets/basic_configs/conf/solrconfig.xml
----------------------------------------------------------------------
diff --git a/solr/server/solr/configsets/basic_configs/conf/solrconfig.xml b/solr/server/solr/configsets/basic_configs/conf/solrconfig.xml
index 53f74c3..770ac60 100644
--- a/solr/server/solr/configsets/basic_configs/conf/solrconfig.xml
+++ b/solr/server/solr/configsets/basic_configs/conf/solrconfig.xml
@@ -1223,16 +1223,16 @@
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.util.Date</str>
-        <str name="fieldType">tdates</str>
+        <str name="fieldType">pdates</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Long</str>
         <str name="valueClass">java.lang.Integer</str>
-        <str name="fieldType">tlongs</str>
+        <str name="fieldType">plongs</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Number</str>
-        <str name="fieldType">tdoubles</str>
+        <str name="fieldType">pdoubles</str>
       </lst>
     </processor>
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/566fcfce/solr/server/solr/configsets/data_driven_schema_configs/conf/solrconfig.xml
----------------------------------------------------------------------
diff --git a/solr/server/solr/configsets/data_driven_schema_configs/conf/solrconfig.xml b/solr/server/solr/configsets/data_driven_schema_configs/conf/solrconfig.xml
index 48d47e3..33ef773 100644
--- a/solr/server/solr/configsets/data_driven_schema_configs/conf/solrconfig.xml
+++ b/solr/server/solr/configsets/data_driven_schema_configs/conf/solrconfig.xml
@@ -1222,16 +1222,16 @@
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.util.Date</str>
-        <str name="fieldType">tdates</str>
+        <str name="fieldType">pdates</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Long</str>
         <str name="valueClass">java.lang.Integer</str>
-        <str name="fieldType">tlongs</str>
+        <str name="fieldType">plongs</str>
       </lst>
       <lst name="typeMapping">
         <str name="valueClass">java.lang.Number</str>
-        <str name="fieldType">tdoubles</str>
+        <str name="fieldType">pdoubles</str>
       </lst>
     </processor>
     <processor class="solr.LogUpdateProcessorFactory"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/566fcfce/solr/solr-ref-guide/src/schemaless-mode.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/schemaless-mode.adoc b/solr/solr-ref-guide/src/schemaless-mode.adoc
index fdf97ba..45ae8dd 100644
--- a/solr/solr-ref-guide/src/schemaless-mode.adoc
+++ b/solr/solr-ref-guide/src/schemaless-mode.adoc
@@ -139,16 +139,16 @@ The UpdateRequestProcessorChain allows Solr to guess field types, and you can de
     </lst>
     <lst name="typeMapping">
       <str name="valueClass">java.util.Date</str>
-      <str name="fieldType">tdates</str>
+      <str name="fieldType">pdates</str>
     </lst>
     <lst name="typeMapping">
       <str name="valueClass">java.lang.Long</str>
       <str name="valueClass">java.lang.Integer</str>
-      <str name="fieldType">tlongs</str>
+      <str name="fieldType">plongs</str>
     </lst>
     <lst name="typeMapping">
       <str name="valueClass">java.lang.Number</str>
-      <str name="fieldType">tdoubles</str>
+      <str name="fieldType">pdoubles</str>
     </lst>
   </processor>
   <processor class="solr.LogUpdateProcessorFactory"/>


[21/35] lucene-solr:jira/SOLR-10834: SOLR-10704 Wait until all leader replicas are recovered before deleting the originals.

Posted by ho...@apache.org.
SOLR-10704 Wait until all leader replicas are recovered before deleting
the originals.


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

Branch: refs/heads/jira/SOLR-10834
Commit: 232eff0893bccb93d01042f26a00e50870be2f29
Parents: f29e2d1
Author: Andrzej Bialecki <ab...@apache.org>
Authored: Tue Jun 13 17:36:51 2017 +0200
Committer: Andrzej Bialecki <ab...@apache.org>
Committed: Tue Jun 13 17:39:26 2017 +0200

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  3 +
 .../org/apache/solr/cloud/ReplaceNodeCmd.java   | 96 +++++++++++++++++++-
 .../org/apache/solr/cloud/ReplaceNodeTest.java  |  9 +-
 3 files changed, 102 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/232eff08/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 153ed82..d2a26c0 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -364,6 +364,9 @@ Bug Fixes
 
 * SOLR-10835: Add support for point fields in Export Handler (Tomás Fernández Löbbe)
 
+* SOLR-10704: REPLACENODE may cause data loss when replicationFactor is 1. (ab, shalin)
+
+
 Optimizations
 ----------------------
 * SOLR-10634: JSON Facet API: When a field/terms facet will retrieve all buckets (i.e. limit:-1)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/232eff08/solr/core/src/java/org/apache/solr/cloud/ReplaceNodeCmd.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/ReplaceNodeCmd.java b/solr/core/src/java/org/apache/solr/cloud/ReplaceNodeCmd.java
index e4240be..5adbe8c 100644
--- a/solr/core/src/java/org/apache/solr/cloud/ReplaceNodeCmd.java
+++ b/solr/core/src/java/org/apache/solr/cloud/ReplaceNodeCmd.java
@@ -20,15 +20,18 @@ package org.apache.solr.cloud;
 
 import java.lang.invoke.MethodHandles;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Set;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.cloud.ClusterState;
+import org.apache.solr.common.cloud.CollectionStateWatcher;
 import org.apache.solr.common.cloud.DocCollection;
 import org.apache.solr.common.cloud.Replica;
 import org.apache.solr.common.cloud.Slice;
@@ -60,6 +63,7 @@ public class ReplaceNodeCmd implements OverseerCollectionMessageHandler.Cmd {
     String source = message.getStr("source");
     String target = message.getStr("target");
     String async = message.getStr("async");
+    int timeout = message.getInt("timeout", 10 * 60); // 10 minutes
     boolean parallel = message.getBool("parallel", false);
     ClusterState clusterState = zkStateReader.getClusterState();
 
@@ -70,13 +74,34 @@ public class ReplaceNodeCmd implements OverseerCollectionMessageHandler.Cmd {
       throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Target Node: " + target + " is not live");
     }
     List<ZkNodeProps> sourceReplicas = getReplicasOfNode(source, clusterState);
-
+    // how many leaders are we moving? for these replicas we have to make sure that either:
+    // * another existing replica can become a leader, or
+    // * we wait until the newly created replica completes recovery (and can become the new leader)
+    int numLeaders = 0;
+    for (ZkNodeProps props : sourceReplicas) {
+      if (props.getBool(ZkStateReader.LEADER_PROP, false)) {
+        numLeaders++;
+      }
+    }
+    // map of collectionName_coreNodeName to watchers
+    Map<String, RecoveryWatcher> watchers = new HashMap<>();
     List<ZkNodeProps> createdReplicas = new ArrayList<>();
 
     AtomicBoolean anyOneFailed = new AtomicBoolean(false);
     CountDownLatch countDownLatch = new CountDownLatch(sourceReplicas.size());
 
+    CountDownLatch replicasToRecover = new CountDownLatch(numLeaders);
+
     for (ZkNodeProps sourceReplica : sourceReplicas) {
+      if (sourceReplica.getBool(ZkStateReader.LEADER_PROP, false)) {
+        String shardName = sourceReplica.getStr(SHARD_ID_PROP);
+        String replicaName = sourceReplica.getStr(ZkStateReader.REPLICA_PROP);
+        String collectionName = sourceReplica.getStr(COLLECTION_PROP);
+        String key = collectionName + "_" + replicaName;
+        RecoveryWatcher watcher = new RecoveryWatcher(collectionName, shardName, replicaName, replicasToRecover);
+        watchers.put(key, watcher);
+        zkStateReader.registerCollectionStateWatcher(collectionName, watcher);
+      }
       NamedList nl = new NamedList();
       log.info("Going to create replica for collection={} shard={} on node={}", sourceReplica.getStr(COLLECTION_PROP), sourceReplica.getStr(SHARD_ID_PROP), target);
       ZkNodeProps msg = sourceReplica.plus("parallel", String.valueOf(parallel)).plus(CoreAdminParams.NODE, target);
@@ -106,10 +131,26 @@ public class ReplaceNodeCmd implements OverseerCollectionMessageHandler.Cmd {
       }
     }
 
-    log.debug("Waiting for replace node action to complete");
-    countDownLatch.await(5, TimeUnit.MINUTES);
-    log.debug("Finished waiting for replace node action to complete");
+    log.debug("Waiting for replicas to be added");
+    if (!countDownLatch.await(timeout, TimeUnit.SECONDS)) {
+      log.info("Timed out waiting for replicas to be added");
+      anyOneFailed.set(true);
+    } else {
+      log.debug("Finished waiting for replicas to be added");
+    }
 
+    // now wait for leader replicas to recover
+    log.debug("Waiting for " + numLeaders + " leader replicas to recover");
+    if (!replicasToRecover.await(timeout, TimeUnit.SECONDS)) {
+      log.info("Timed out waiting for " + replicasToRecover.getCount() + " leader replicas to recover");
+      anyOneFailed.set(true);
+    } else {
+      log.debug("Finished waiting for leader replicas to recover");
+    }
+    // remove the watchers, we're done either way
+    for (RecoveryWatcher watcher : watchers.values()) {
+      zkStateReader.removeCollectionStateWatcher(watcher.collectionId, watcher);
+    }
     if (anyOneFailed.get()) {
       log.info("Failed to create some replicas. Cleaning up all replicas on target node");
       CountDownLatch cleanupLatch = new CountDownLatch(createdReplicas.size());
@@ -134,6 +175,7 @@ public class ReplaceNodeCmd implements OverseerCollectionMessageHandler.Cmd {
         }
       }
       cleanupLatch.await(5, TimeUnit.MINUTES);
+      return;
     }
 
 
@@ -155,6 +197,7 @@ public class ReplaceNodeCmd implements OverseerCollectionMessageHandler.Cmd {
                 ZkStateReader.CORE_NAME_PROP, replica.getCoreName(),
                 ZkStateReader.REPLICA_PROP, replica.getName(),
                 ZkStateReader.REPLICA_TYPE, replica.getType().name(),
+                ZkStateReader.LEADER_PROP, String.valueOf(replica.equals(slice.getLeader())),
                 CoreAdminParams.NODE, source);
             sourceReplicas.add(props);
           }
@@ -163,4 +206,49 @@ public class ReplaceNodeCmd implements OverseerCollectionMessageHandler.Cmd {
     }
     return sourceReplicas;
   }
+
+  // we use this watcher to wait for replicas to recover
+  private static class RecoveryWatcher implements CollectionStateWatcher {
+    String collectionId;
+    String shardId;
+    String replicaId;
+    CountDownLatch countDownLatch;
+
+    RecoveryWatcher(String collectionId, String shardId, String replicaId, CountDownLatch countDownLatch) {
+      this.collectionId = collectionId;
+      this.shardId = shardId;
+      this.replicaId = replicaId;
+      this.countDownLatch = countDownLatch;
+    }
+
+    @Override
+    public boolean onStateChanged(Set<String> liveNodes, DocCollection collectionState) {
+      if (collectionState == null) { // collection has been deleted - don't wait
+        countDownLatch.countDown();
+        return true;
+      }
+      Slice slice = collectionState.getSlice(shardId);
+      if (slice == null) { // shard has been removed - don't wait
+        countDownLatch.countDown();
+        return true;
+      }
+      for (Replica replica : slice.getReplicas()) {
+        // check if another replica exists - doesn't have to be the one we're moving
+        // as long as it's active and can become a leader, in which case we don't have to wait
+        // for recovery of specifically the one that we've just added
+        if (!replica.getName().equals(replicaId)) {
+          if (replica.getType().equals(Replica.Type.PULL)) { // not eligible for leader election
+            continue;
+          }
+          // check its state
+          if (replica.isActive(liveNodes)) { // recovered - stop waiting
+            countDownLatch.countDown();
+            return true;
+          }
+        }
+      }
+      // set the watch again to wait for the new replica to recover
+      return false;
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/232eff08/solr/core/src/test/org/apache/solr/cloud/ReplaceNodeTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/ReplaceNodeTest.java b/solr/core/src/test/org/apache/solr/cloud/ReplaceNodeTest.java
index ecfd3ee..d7fae92 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ReplaceNodeTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ReplaceNodeTest.java
@@ -67,11 +67,16 @@ public class ReplaceNodeTest extends SolrCloudTestCase {
     CollectionAdminRequest.Create create;
     // NOTE: always using the createCollection that takes in 'int' for all types of replicas, so we never
     // have to worry about null checking when comparing the Create command with the final Slices
-    create = pickRandom(CollectionAdminRequest.createCollection(coll, "conf1", 5, 2,0,0),
+    create = pickRandom(
+                        CollectionAdminRequest.createCollection(coll, "conf1", 5, 2,0,0),
                         CollectionAdminRequest.createCollection(coll, "conf1", 5, 1,1,0),
                         CollectionAdminRequest.createCollection(coll, "conf1", 5, 0,1,1),
                         CollectionAdminRequest.createCollection(coll, "conf1", 5, 1,0,1),
-                        CollectionAdminRequest.createCollection(coll, "conf1", 5, 0,2,0));
+                        CollectionAdminRequest.createCollection(coll, "conf1", 5, 0,2,0),
+                        // check also replicationFactor 1
+                        CollectionAdminRequest.createCollection(coll, "conf1", 5, 1,0,0),
+                        CollectionAdminRequest.createCollection(coll, "conf1", 5, 0,1,0)
+    );
     create.setCreateNodeSet(StrUtils.join(l, ',')).setMaxShardsPerNode(3);
     cloudClient.request(create);
     log.info("excluded_node : {}  ", emptyNode);


[23/35] lucene-solr:jira/SOLR-10834: SOLR-10704 Update the ref guide.

Posted by ho...@apache.org.
SOLR-10704 Update the ref guide.


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

Branch: refs/heads/jira/SOLR-10834
Commit: cdccbfb92f30cc70a3fee4c1b3655b1aaf1acb7a
Parents: 78fcbc0
Author: Andrzej Bialecki <ab...@apache.org>
Authored: Tue Jun 13 18:53:04 2017 +0200
Committer: Andrzej Bialecki <ab...@apache.org>
Committed: Tue Jun 13 18:53:44 2017 +0200

----------------------------------------------------------------------
 solr/solr-ref-guide/src/collections-api.adoc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cdccbfb9/solr/solr-ref-guide/src/collections-api.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/collections-api.adoc b/solr/solr-ref-guide/src/collections-api.adoc
index 33dcb94..9e71365 100644
--- a/solr/solr-ref-guide/src/collections-api.adoc
+++ b/solr/solr-ref-guide/src/collections-api.adoc
@@ -1887,7 +1887,7 @@ Deletes all replicas of all collections in that node. Please note that the node
 [[CollectionsAPI-replacenode]]
 == REPLACENODE: Move All Replicas in a Node to Another
 
-This command recreates replicas in the source node to the target node. After each replica is copied, the replicas in the source node are deleted.
+This command recreates replicas in the source node to the target node. After each replica is copied, the replicas in the source node are deleted. For source replicas that are also shard leaders the operation will wait for "timeout" seconds to make sure there's an active replica that can become a leader (either an existing replica becoming a leader or the new replica completing the recovery and becoming a leader).
 
 `/admin/collections?action=REPLACENODE&source=_source-node_&target=_target-node_`
 
@@ -1905,6 +1905,7 @@ This command recreates replicas in the source node to the target node. After eac
 |target |string |Yes |The target node
 |parallel |boolean |No |default=false. if this flag is set to true, all replicas are created inseparatee threads. Keep in mind that this can lead to very high network and disk I/O if the replicas have very large indices.
 |async |string |No |Request ID to track this action which will be <<CollectionsAPI-async,processed asynchronously>>.
+|timeout |int |No |default is 300. Timeout in seconds to wait until new replicas are created, and until leader replicas are fully recovered.
 |===
 
 [IMPORTANT]


[31/35] lucene-solr:jira/SOLR-10834: Revert "SOLR-8392: Remove instanceof checks on return value of SolrParam::get"

Posted by ho...@apache.org.
Revert "SOLR-8392: Remove instanceof checks on return value of SolrParam::get"

This reverts commit 94220a01e14f53e0632bfbc1678661ad9c67320a.


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

Branch: refs/heads/jira/SOLR-10834
Commit: d1db5f7af9edb2125583c6c63fa322380ee57cf7
Parents: 9a0d9e8
Author: Mike Drob <md...@apache.org>
Authored: Tue Jun 13 14:18:52 2017 -0700
Committer: Mike Drob <md...@apache.org>
Committed: Tue Jun 13 14:19:05 2017 -0700

----------------------------------------------------------------------
 solr/CHANGES.txt                                   |  2 --
 .../org/apache/solr/handler/SchemaHandler.java     |  6 +++++-
 .../org/apache/solr/rest/BaseSolrResource.java     |  6 ++++--
 .../apache/solr/common/params/MapSolrParams.java   | 17 +++++++++++++----
 4 files changed, 22 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1db5f7a/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 7810c81..a07b68f 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -260,8 +260,6 @@ Other Changes
 * SOLR-10800: Factor out HttpShardHandler.transformReplicasToShardUrls from HttpShardHandler.prepDistributed.
   (Domenico Fabio Marino, Christine Poerschke)
 
-* SOLR-8392: Remove instanceof checks on return value of SolrParam::get (Mike Drob, Varun Thacker)
-
 ==================  6.7.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1db5f7a/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java b/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
index 626f655..e3e292b 100644
--- a/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
@@ -138,7 +138,11 @@ public class SchemaHandler extends RequestHandlerBase implements SolrCoreAware,
           break;
         }
         case "/schema/zkversion": {
-          int refreshIfBelowVersion = req.getParams().getInt("refreshIfBelowVersion", -1);
+          int refreshIfBelowVersion = -1;
+          Object refreshParam = req.getParams().get("refreshIfBelowVersion");
+          if (refreshParam != null)
+            refreshIfBelowVersion = (refreshParam instanceof Number) ? ((Number) refreshParam).intValue()
+                : Integer.parseInt(refreshParam.toString());
           int zkVersion = -1;
           IndexSchema schema = req.getSchema();
           if (schema instanceof ManagedIndexSchema) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1db5f7a/solr/core/src/java/org/apache/solr/rest/BaseSolrResource.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/rest/BaseSolrResource.java b/solr/core/src/java/org/apache/solr/rest/BaseSolrResource.java
index cc1eeb2..5a9310d 100644
--- a/solr/core/src/java/org/apache/solr/rest/BaseSolrResource.java
+++ b/solr/core/src/java/org/apache/solr/rest/BaseSolrResource.java
@@ -125,9 +125,11 @@ public abstract class BaseSolrResource extends ServerResource {
             SolrCore.preDecorateResponse(solrRequest, solrResponse);
 
             // client application can set a timeout for update requests
-            String updateTimeoutSecsParam = getSolrRequest().getParams().get(UPDATE_TIMEOUT_SECS);
+            Object updateTimeoutSecsParam = getSolrRequest().getParams().get(UPDATE_TIMEOUT_SECS);
             if (updateTimeoutSecsParam != null)
-              updateTimeoutSecs = Integer.parseInt(updateTimeoutSecsParam);
+              updateTimeoutSecs = (updateTimeoutSecsParam instanceof Number)
+                  ? ((Number) updateTimeoutSecsParam).intValue()
+                  : Integer.parseInt(updateTimeoutSecsParam.toString());
 
           }
         }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1db5f7a/solr/solrj/src/java/org/apache/solr/common/params/MapSolrParams.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/params/MapSolrParams.java b/solr/solrj/src/java/org/apache/solr/common/params/MapSolrParams.java
index 53eff87..5454fca 100644
--- a/solr/solrj/src/java/org/apache/solr/common/params/MapSolrParams.java
+++ b/solr/solrj/src/java/org/apache/solr/common/params/MapSolrParams.java
@@ -20,7 +20,7 @@ import java.util.Iterator;
 import java.util.Map;
 
 /**
- * {@link SolrParams} implementation that can be built from and is backed by a {@link Map}.
+ *
  */
 public class MapSolrParams extends SolrParams {
   protected final Map<String,String> map;
@@ -31,13 +31,22 @@ public class MapSolrParams extends SolrParams {
 
   @Override
   public String get(String name) {
-    return map.get(name);
+    Object  o = map.get(name);
+    if(o == null) return null;
+    if (o instanceof String) return  (String) o;
+    if (o instanceof String[]) {
+      String[] strings = (String[]) o;
+      if(strings.length == 0) return null;
+      return strings[0];
+    }
+    return String.valueOf(o);
   }
 
   @Override
   public String[] getParams(String name) {
-    String val = map.get(name);
-    return val==null ? null : new String[]{val};
+    Object val = map.get(name);
+    if (val instanceof String[]) return (String[]) val;
+    return val==null ? null : new String[]{String.valueOf(val)};
   }
 
   @Override


[22/35] lucene-solr:jira/SOLR-10834: ref guide: clean up monospace syntax problems

Posted by ho...@apache.org.
ref guide: clean up monospace syntax problems


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

Branch: refs/heads/jira/SOLR-10834
Commit: 78fcbc0623cb0a602f406e7af844437ae98f729c
Parents: 232eff0
Author: Steve Rowe <sa...@gmail.com>
Authored: Tue Jun 13 12:01:13 2017 -0400
Committer: Steve Rowe <sa...@gmail.com>
Committed: Tue Jun 13 12:01:21 2017 -0400

----------------------------------------------------------------------
 solr/solr-ref-guide/src/filter-descriptions.adoc                 | 4 ++--
 solr/solr-ref-guide/src/indexconfig-in-solrconfig.adoc           | 2 +-
 solr/solr-ref-guide/src/learning-to-rank.adoc                    | 2 +-
 solr/solr-ref-guide/src/major-changes-from-solr-5-to-solr-6.adoc | 4 ++--
 solr/solr-ref-guide/src/rule-based-authorization-plugin.adoc     | 4 ++--
 solr/solr-ref-guide/src/running-solr-on-hdfs.adoc                | 4 ++--
 solr/solr-ref-guide/src/solr-control-script-reference.adoc       | 2 +-
 solr/solr-ref-guide/src/taking-solr-to-production.adoc           | 2 +-
 solr/solr-ref-guide/src/the-stats-component.adoc                 | 2 +-
 solr/solr-ref-guide/src/upgrading-solr.adoc                      | 2 +-
 solr/solr-ref-guide/src/using-solrj.adoc                         | 2 +-
 solr/solr-ref-guide/src/velocity-response-writer.adoc            | 2 +-
 solr/solr-ref-guide/src/working-with-dates.adoc                  | 2 +-
 solr/solr-ref-guide/src/zookeeper-access-control.adoc            | 4 ++--
 14 files changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/78fcbc06/solr/solr-ref-guide/src/filter-descriptions.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/filter-descriptions.adoc b/solr/solr-ref-guide/src/filter-descriptions.adoc
index 09dbe23..9458297 100644
--- a/solr/solr-ref-guide/src/filter-descriptions.adoc
+++ b/solr/solr-ref-guide/src/filter-descriptions.adoc
@@ -1419,9 +1419,9 @@ Case-sensitive matching, capitalized words not stopped. Token positions skip sto
 
 Like <<FilterDescriptions-StopFilter,Stop Filter>>, this filter discards, or _stops_ analysis of, tokens that are on the given stop words list.
 
-Suggest Stop Filter differs from Stop Filter in that it will not remove the last token unless it is followed by a token separator. For example, a query "`find the`" would preserve the '`the`' since it was not followed by a space, punctuation etc., and mark it as a `KEYWORD` so that following filters will not change or remove it.
+Suggest Stop Filter differs from Stop Filter in that it will not remove the last token unless it is followed by a token separator. For example, a query `"find the"` would preserve the `'the'` since it was not followed by a space, punctuation etc., and mark it as a `KEYWORD` so that following filters will not change or remove it.
 
-By contrast, a query like "`find the popsicle`" would remove "```the```" as a stopword, since it's followed by a space. When using one of the analyzing suggesters, you would normally use the ordinary `StopFilterFactory` in your index analyzer and then SuggestStopFilter in your query analyzer.
+By contrast, a query like "`find the popsicle`" would remove '`the`' as a stopword, since it's followed by a space. When using one of the analyzing suggesters, you would normally use the ordinary `StopFilterFactory` in your index analyzer and then SuggestStopFilter in your query analyzer.
 
 *Factory class:* `solr.SuggestStopFilterFactory`
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/78fcbc06/solr/solr-ref-guide/src/indexconfig-in-solrconfig.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/indexconfig-in-solrconfig.adoc b/solr/solr-ref-guide/src/indexconfig-in-solrconfig.adoc
index cfc1a78..ce32503 100644
--- a/solr/solr-ref-guide/src/indexconfig-in-solrconfig.adoc
+++ b/solr/solr-ref-guide/src/indexconfig-in-solrconfig.adoc
@@ -115,7 +115,7 @@ If the configuration options for the built-in merge policies do not fully suit y
 </mergePolicyFactory>
 ----
 
-The example above shows Solr's {solr-javadocs}/solr-core/org/apache/solr/index/SortingMergePolicyFactory.html[`SortingMergePolicyFactory`] being configured to sort documents in merged segments by `"timestamp desc"`, and wrapped around a `TieredMergePolicyFactory` configured to use the values `maxMergeAtOnce=10` and `segmentsPerTier=10` via the `inner` prefix defined by `SortingMergePolicyFactory`'s `wrapped.prefix` option. For more information on using `SortingMergePolicyFactory`, see <<common-query-parameters.adoc#CommonQueryParameters-ThesegmentTerminateEarlyParameter,the segmentTerminateEarly parameter>>.
+The example above shows Solr's {solr-javadocs}/solr-core/org/apache/solr/index/SortingMergePolicyFactory.html[`SortingMergePolicyFactory`] being configured to sort documents in merged segments by `"timestamp desc"`, and wrapped around a `TieredMergePolicyFactory` configured to use the values `maxMergeAtOnce=10` and `segmentsPerTier=10` via the `inner` prefix defined by `SortingMergePolicyFactory` 's `wrapped.prefix` option. For more information on using `SortingMergePolicyFactory`, see <<common-query-parameters.adoc#CommonQueryParameters-ThesegmentTerminateEarlyParameter,the segmentTerminateEarly parameter>>.
 
 [[IndexConfiginSolrConfig-mergeScheduler]]
 === mergeScheduler

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/78fcbc06/solr/solr-ref-guide/src/learning-to-rank.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/learning-to-rank.adoc b/solr/solr-ref-guide/src/learning-to-rank.adoc
index 3eb077e..64a461b 100644
--- a/solr/solr-ref-guide/src/learning-to-rank.adoc
+++ b/solr/solr-ref-guide/src/learning-to-rank.adoc
@@ -509,7 +509,7 @@ To inspect the content of the `commonFeatureStore` feature store:
 * A model need not use all the features defined in a feature store.
 * Multiple models can use the same feature store.
 
-To extract features for `currentFeatureStore`'s features:
+To extract features for `currentFeatureStore` 's features:
 
 `\http://localhost:8983/solr/techproducts/query?q=test&fl=id,score,[features store=currentFeatureStore]`
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/78fcbc06/solr/solr-ref-guide/src/major-changes-from-solr-5-to-solr-6.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/major-changes-from-solr-5-to-solr-6.adoc b/solr/solr-ref-guide/src/major-changes-from-solr-5-to-solr-6.adoc
index 9b58cef..6810e4b 100644
--- a/solr/solr-ref-guide/src/major-changes-from-solr-5-to-solr-6.adoc
+++ b/solr/solr-ref-guide/src/major-changes-from-solr-5-to-solr-6.adoc
@@ -76,9 +76,9 @@ Please review the <<schema-factory-definition-in-solrconfig.adoc#schema-factory-
 
 == Default Similarity Changes
 
-Solr's default behavior when a Schema does not explicitly define a global <<other-schema-elements.adoc#other-schema-elements,`<similarity/>`>> is now dependent on the `luceneMatchVersion` specified in the `solrconfig.xml`. When `luceneMatchVersion < 6.0`, an instance of `ClassicSimilarityFactory` will be used, otherwise an instance of `SchemaSimlarityFactory` will be used. Most notably this change means that users can take advantage of per Field Type similarity declarations, with out needing to also explicitly declare a global usage of `SchemaSimlarityFactory`.
+Solr's default behavior when a Schema does not explicitly define a global <<other-schema-elements.adoc#other-schema-elements,`<similarity/>`>> is now dependent on the `luceneMatchVersion` specified in the `solrconfig.xml`. When `luceneMatchVersion < 6.0`, an instance of `ClassicSimilarityFactory` will be used, otherwise an instance of `SchemaSimilarityFactory` will be used. Most notably this change means that users can take advantage of per Field Type similarity declarations, with out needing to also explicitly declare a global usage of `SchemaSimilarityFactory`.
 
-Regardless of whether it is explicitly declared, or used as an implicit global default, `SchemaSimlarityFactory`'s implicit behavior when a Field Types do not declare an explicit `<similarity />` has also been changed to depend on the the `luceneMatchVersion`. When `luceneMatchVersion < 6.0`, an instance of `ClassicSimilarity` will be used, otherwise an instance of `BM25Simlarity` will be used. A `defaultSimFromFieldType` init option may be specified on the `SchemaSimilarityFactory` declaration to change this behavior. Please review the `SchemaSimlarityFactory` javadocs for more details
+Regardless of whether it is explicitly declared, or used as an implicit global default, `SchemaSimilarityFactory` 's implicit behavior when a Field Types do not declare an explicit `<similarity />` has also been changed to depend on the the `luceneMatchVersion`. When `luceneMatchVersion < 6.0`, an instance of `ClassicSimilarity` will be used, otherwise an instance of `BM25Similarity` will be used. A `defaultSimFromFieldType` init option may be specified on the `SchemaSimilarityFactory` declaration to change this behavior. Please review the `SchemaSimilarityFactory` javadocs for more details
 
 == Replica & Shard Delete Command Changes
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/78fcbc06/solr/solr-ref-guide/src/rule-based-authorization-plugin.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/rule-based-authorization-plugin.adoc b/solr/solr-ref-guide/src/rule-based-authorization-plugin.adoc
index 76a6c4f..df37781 100644
--- a/solr/solr-ref-guide/src/rule-based-authorization-plugin.adoc
+++ b/solr/solr-ref-guide/src/rule-based-authorization-plugin.adoc
@@ -200,7 +200,7 @@ curl --user solr:SolrRocks -H 'Content-type:application/json' -d '{
 
 Permissions can be accessed using their index in the list. Use the `/admin/authorization` API to see the existing permissions and their indices.
 
-The following example updates the '`role`' attribute of permission at index '`3`':
+The following example updates the `'role'` attribute of permission at index `3`:
 
 [source,bash]
 ----
@@ -210,7 +210,7 @@ curl --user solr:SolrRocks -H 'Content-type:application/json' -d '{
 }' http://localhost:8983/solr/admin/authorization
 ----
 
-The following example deletes permission at index '`3`':
+The following example deletes permission at index `3`:
 
 [source,bash]
 ----

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/78fcbc06/solr/solr-ref-guide/src/running-solr-on-hdfs.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/running-solr-on-hdfs.adoc b/solr/solr-ref-guide/src/running-solr-on-hdfs.adoc
index b3e12a5..e23431c 100644
--- a/solr/solr-ref-guide/src/running-solr-on-hdfs.adoc
+++ b/solr/solr-ref-guide/src/running-solr-on-hdfs.adoc
@@ -38,7 +38,7 @@ For standalone Solr instances, there are a few parameters you should be sure to
 
 * You need to use an `HdfsDirectoryFactory` and a data dir of the form `hdfs://host:port/path`
 * You need to specify an UpdateLog location of the form `hdfs://host:port/path`
-* You should specify a lock factory type of '`hdfs`' or none.
+* You should specify a lock factory type of `'hdfs'` or none.
 
 If you do not modify `solrconfig.xml`, you can instead start Solr on HDFS with the following command:
 
@@ -58,7 +58,7 @@ This example will start Solr in standalone mode, using the defined JVM propertie
 In SolrCloud mode, it's best to leave the data and update log directories as the defaults Solr comes with and simply specify the `solr.hdfs.home`. All dynamically created collections will create the appropriate directories automatically under the `solr.hdfs.home` root directory.
 
 * Set `solr.hdfs.home` in the form `hdfs://host:port/path`
-* You should specify a lock factory type of '`hdfs`' or none.
+* You should specify a lock factory type of `'hdfs'` or none.
 
 [source,bash]
 ----

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/78fcbc06/solr/solr-ref-guide/src/solr-control-script-reference.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/solr-control-script-reference.adoc b/solr/solr-ref-guide/src/solr-control-script-reference.adoc
index 4c915e3..669c30a 100644
--- a/solr/solr-ref-guide/src/solr-control-script-reference.adoc
+++ b/solr/solr-ref-guide/src/solr-control-script-reference.adoc
@@ -605,7 +605,7 @@ Use the `zk cp` command for transferring files and directories between ZooKeeper
 |===
 |Parameter |Description |Example
 |-r |Optional. Do a recursive copy. The command will fail if the <src> has children unless '-r' is specified. |`-r`
-|<src> |The file or path to copy from. If prefixed with `zk:` then the source is presumed to be ZooKeeper. If no prefix or the prefix is 'file:' this is the local drive. At least one of <src> or <dest> must be prefixed by '`zk:`' or the command will fail. a|
+|<src> |The file or path to copy from. If prefixed with `zk:` then the source is presumed to be ZooKeeper. If no prefix or the prefix is 'file:' this is the local drive. At least one of <src> or <dest> must be prefixed by `'zk:'` or the command will fail. a|
 `zk:/configs/myconfigs/solrconfig.xml`
 
 `file:/Users/apache/configs/src`

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/78fcbc06/solr/solr-ref-guide/src/taking-solr-to-production.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/taking-solr-to-production.adoc b/solr/solr-ref-guide/src/taking-solr-to-production.adoc
index 799c494..9763410 100644
--- a/solr/solr-ref-guide/src/taking-solr-to-production.adoc
+++ b/solr/solr-ref-guide/src/taking-solr-to-production.adoc
@@ -226,7 +226,7 @@ bin/solr zk mkroot /solr -z <ZK_node>:<ZK_PORT>
 [NOTE]
 ====
 
-If you also want to bootstrap ZooKeeper with existing `solr_home`, you can instead use use `zkcli.sh` / `zkcli.bat`'s `bootstrap` command, which will also create the chroot path if it does not exist. See <<command-line-utilities.adoc#command-line-utilities,Command Line Utilities>> for more info.
+If you also want to bootstrap ZooKeeper with existing `solr_home`, you can instead use the `zkcli.sh` / `zkcli.bat` `bootstrap` command, which will also create the chroot path if it does not exist. See <<command-line-utilities.adoc#command-line-utilities,Command Line Utilities>> for more info.
 
 ====
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/78fcbc06/solr/solr-ref-guide/src/the-stats-component.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/the-stats-component.adoc b/solr/solr-ref-guide/src/the-stats-component.adoc
index 8014ccf..96ba88c 100644
--- a/solr/solr-ref-guide/src/the-stats-component.adoc
+++ b/solr/solr-ref-guide/src/the-stats-component.adoc
@@ -179,6 +179,6 @@ Here we compute some statistics for the price field. The min, max, mean, 90th, a
 [[TheStatsComponent-TheStatsComponentandFaceting]]
 == The Stats Component and Faceting
 
-Sets of `stats.field` parameters can be referenced by '`tag`' when using Pivot Faceting to compute multiple statistics at every level (i.e.: field) in the tree of pivot constraints.
+Sets of `stats.field` parameters can be referenced by `'tag'` when using Pivot Faceting to compute multiple statistics at every level (i.e.: field) in the tree of pivot constraints.
 
 For more information and a detailed example, please see <<faceting.adoc#Faceting-CombiningStatsComponentWithPivots,Combining Stats Component With Pivots>>.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/78fcbc06/solr/solr-ref-guide/src/upgrading-solr.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/upgrading-solr.adoc b/solr/solr-ref-guide/src/upgrading-solr.adoc
index 74142a9..e41b93b 100644
--- a/solr/solr-ref-guide/src/upgrading-solr.adoc
+++ b/solr/solr-ref-guide/src/upgrading-solr.adoc
@@ -63,7 +63,7 @@ If you are already using Solr 6.5, Solr 6.6 should not present any major problem
 * Several changes have been made regarding the "<<other-schema-elements.adoc#OtherSchemaElements-Similarity,`Similarity`>>" used in Solr, in order to provide better default behavior for new users. There are 3 key impacts of these changes on existing users who upgrade:
 ** `DefaultSimilarityFactory` has been removed. If you currently have `DefaultSimilarityFactory` explicitly referenced in your `schema.xml`, edit your config to use the functionally identical `ClassicSimilarityFactory`. See https://issues.apache.org/jira/browse/SOLR-8239[SOLR-8239] for more details.
 ** The implicit default Similarity used when no `<similarity/>` is configured in `schema.xml` has been changed to `SchemaSimilarityFactory`. Users who wish to preserve back-compatible behavior should either explicitly configure `ClassicSimilarityFactory`, or ensure that the `luceneMatchVersion` for the collection is less then 6.0. See https://issues.apache.org/jira/browse/SOLR-8270[SOLR-8270] + http://SOLR-8271[SOLR-8271] for details.
-** `SchemaSimilarityFactory` has been modified to use `BM25Similarity` as the default for `fieldTypes` that do not explicitly declare a Similarity. The legacy behavior of using `ClassicSimilarity` as the default will occur if the `luceneMatchVersion` for the collection is less then 6.0, or the '`defaultSimFromFieldType`' configuration option may be used to specify any default of your choosing. See https://issues.apache.org/jira/browse/SOLR-8261[SOLR-8261] + https://issues.apache.org/jira/browse/SOLR-8329[SOLR-8329] for more details.
+** `SchemaSimilarityFactory` has been modified to use `BM25Similarity` as the default for `fieldTypes` that do not explicitly declare a Similarity. The legacy behavior of using `ClassicSimilarity` as the default will occur if the `luceneMatchVersion` for the collection is less then 6.0, or the `'defaultSimFromFieldType'` configuration option may be used to specify any default of your choosing. See https://issues.apache.org/jira/browse/SOLR-8261[SOLR-8261] + https://issues.apache.org/jira/browse/SOLR-8329[SOLR-8329] for more details.
 * If your `solrconfig.xml` file doesn't explicitly mention the `schemaFactory` to use then Solr will choose the `ManagedIndexSchemaFactory` by default. Previously it would have chosen `ClassicIndexSchemaFactory`. This means that the Schema APIs (`/<collection>/schema`) are enabled and the schema is mutable. When Solr starts your `schema.xml` file will be renamed to `managed-schema`. If you want to retain the old behaviour then please ensure that the `solrconfig.xml` explicitly uses the `ClassicIndexSchemaFactory` or your `luceneMatchVersion` in the `solrconfig.xml` is less than 6.0. See the <<schema-factory-definition-in-solrconfig.adoc#schema-factory-definition-in-solrconfig,Schema Factory Definition in SolrConfig>> section for more details
 * `SolrIndexSearcher.QueryCommand` and `QueryResult` were moved to their own classes. If you reference them in your code, you should import them under o.a.s.search (or use your IDE's "Organize Imports").
 * The '<<request-parameters-api.adoc#request-parameters-api,`useParams`>>' attribute specified in request handler cannot be overridden from request params. See https://issues.apache.org/jira/browse/SOLR-8698[SOLR-8698] for more details.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/78fcbc06/solr/solr-ref-guide/src/using-solrj.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/using-solrj.adoc b/solr/solr-ref-guide/src/using-solrj.adoc
index b619aed..4788ea2 100644
--- a/solr/solr-ref-guide/src/using-solrj.adoc
+++ b/solr/solr-ref-guide/src/using-solrj.adoc
@@ -135,7 +135,7 @@ SolrDocumentList list = response.getResults();
 [[UsingSolrJ-IndexingDocuments]]
 == Indexing Documents
 
-Other operations are just as simple. To index (add) a document, all you need to do is create a `SolrInputDocument` and pass it along to the `SolrClient`'s `add()` method. This example assumes that the SolrClient object called 'solr' is already created based on the examples shown earlier.
+Other operations are just as simple. To index (add) a document, all you need to do is create a `SolrInputDocument` and pass it along to the `SolrClient` 's `add()` method. This example assumes that the SolrClient object called 'solr' is already created based on the examples shown earlier.
 
 [source,java]
 ----

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/78fcbc06/solr/solr-ref-guide/src/velocity-response-writer.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/velocity-response-writer.adoc b/solr/solr-ref-guide/src/velocity-response-writer.adoc
index fcfe560..b9bc3bd 100644
--- a/solr/solr-ref-guide/src/velocity-response-writer.adoc
+++ b/solr/solr-ref-guide/src/velocity-response-writer.adoc
@@ -57,7 +57,7 @@ The "params" resource loader allows templates to be specified in Solr request pa
 
 `\http://localhost:8983/solr/gettingstarted/select?q=\*:*&wt=velocity&v.template=custom&v.template.custom=CUSTOM%3A%20%23core_name`
 
-where `v.template=custom` says to render a template called "custom" and `v.template.custom`'s value is the actual custom template. This is disabled by default; it'd be a niche, unusual, use case to need this enabled.
+where `v.template=custom` says to render a template called "custom" and `v.template.custom` 's value is the actual custom template. This is disabled by default; it'd be a niche, unusual, use case to need this enabled.
 
  |false
 |solr.resource.loader.enabled |The "solr" resource loader is the only template loader registered by default. Templates are served from resources visible to the SolrResourceLoader under a `velocity/` subdirectory. The VelocityResponseWriter itself has some built-in templates (in its JAR file, under velocity/) that are available automatically through this loader. These built-in templates can be overridden when the same template name is in conf/velocity/ or by using the `template.base.dir` option. |true

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/78fcbc06/solr/solr-ref-guide/src/working-with-dates.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/working-with-dates.adoc b/solr/solr-ref-guide/src/working-with-dates.adoc
index 7d30b66..31d0f1f 100644
--- a/solr/solr-ref-guide/src/working-with-dates.adoc
+++ b/solr/solr-ref-guide/src/working-with-dates.adoc
@@ -43,7 +43,7 @@ You can optionally include fractional seconds if you wish, although any precisio
 * `1972-05-20T17:33:18.77Z`
 * `1972-05-20T17:33:18.7Z`
 
-There must be a leading '`-`' for dates prior to year 0000, and Solr will format dates with a leading '`+`' for years after 9999. Year 0000 is considered year 1 BC; there is no such thing as year 0 AD or BC.
+There must be a leading `'-'` for dates prior to year 0000, and Solr will format dates with a leading `'+'` for years after 9999. Year 0000 is considered year 1 BC; there is no such thing as year 0 AD or BC.
 
 .Query escaping may be required
 [WARNING]

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/78fcbc06/solr/solr-ref-guide/src/zookeeper-access-control.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/zookeeper-access-control.adoc b/solr/solr-ref-guide/src/zookeeper-access-control.adoc
index d3d6b71..919ccb3 100644
--- a/solr/solr-ref-guide/src/zookeeper-access-control.adoc
+++ b/solr/solr-ref-guide/src/zookeeper-access-control.adoc
@@ -58,7 +58,7 @@ Solr nodes, clients and tools (e.g. ZkCLI) always use a java class called {solr-
 [[ZooKeeperAccessControl-ControllingCredentials]]
 === Controlling Credentials
 
-You control which credentials provider will be used by configuring the `zkCredentialsProvider` property in `solr.xml`'s `<solrcloud>` section to the name of a class (on the classpath) implementing the {solr-javadocs}/solr-solrj/org/apache/solr/common/cloud/ZkCredentialsProvider[`ZkCredentialsProvider`] interface. `server/solr/solr.xml` in the Solr distribution defines the `zkCredentialsProvider` such that it will take on the value of the same-named `zkCredentialsProvider` system property if it is defined (e.g. by uncommenting the `SOLR_ZK_CREDS_AND_ACLS` environment variable definition in `solr.in.sh/.cmd` - see below), or if not, default to the `DefaultZkCredentialsProvider` implementation.
+You control which credentials provider will be used by configuring the `zkCredentialsProvider` property in `solr.xml` 's `<solrcloud>` section to the name of a class (on the classpath) implementing the {solr-javadocs}/solr-solrj/org/apache/solr/common/cloud/ZkCredentialsProvider[`ZkCredentialsProvider`] interface. `server/solr/solr.xml` in the Solr distribution defines the `zkCredentialsProvider` such that it will take on the value of the same-named `zkCredentialsProvider` system property if it is defined (e.g. by uncommenting the `SOLR_ZK_CREDS_AND_ACLS` environment variable definition in `solr.in.sh/.cmd` - see below), or if not, default to the `DefaultZkCredentialsProvider` implementation.
 
 ==== Out of the Box Credential Implementations
 
@@ -72,7 +72,7 @@ You can always make you own implementation, but Solr comes with two implementati
 [[ZooKeeperAccessControl-ControllingACLs]]
 === Controlling ACLs
 
-You control which ACLs will be added by configuring `zkACLProvider` property in `solr.xml`'s `<solrcloud>` section to the name of a class (on the classpath) implementing the {solr-javadocs}//solr-solrj/org/apache/solr/common/cloud/ZkACLProvider[`ZkACLProvider`] interface. `server/solr/solr.xml` in the Solr distribution defines the `zkACLProvider` such that it will take on the value of the same-named `zkACLProvider` system property if it is defined (e.g. by uncommenting the `SOLR_ZK_CREDS_AND_ACLS` environment variable definition in `solr.in.sh/.cmd` - see below), or if not, default to the `DefaultZkACLProvider` implementation.
+You control which ACLs will be added by configuring `zkACLProvider` property in `solr.xml` 's `<solrcloud>` section to the name of a class (on the classpath) implementing the {solr-javadocs}//solr-solrj/org/apache/solr/common/cloud/ZkACLProvider[`ZkACLProvider`] interface. `server/solr/solr.xml` in the Solr distribution defines the `zkACLProvider` such that it will take on the value of the same-named `zkACLProvider` system property if it is defined (e.g. by uncommenting the `SOLR_ZK_CREDS_AND_ACLS` environment variable definition in `solr.in.sh/.cmd` - see below), or if not, default to the `DefaultZkACLProvider` implementation.
 
 [[ZooKeeperAccessControl-OutoftheBoxImplementations]]
 ==== Out of the Box ACL Implementations


[30/35] lucene-solr:jira/SOLR-10834: SOLR-9910: Add solr/solr.cmd parameter to append jetty parameters to the start script.

Posted by ho...@apache.org.
SOLR-9910: Add solr/solr.cmd parameter to append jetty parameters to the start script.


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

Branch: refs/heads/jira/SOLR-10834
Commit: 9a0d9e83f69e9e10e18621f7bebe08db90b2f3d4
Parents: 061a768
Author: Mark Miller <ma...@apache.org>
Authored: Tue Jun 13 15:55:51 2017 -0400
Committer: Mark Miller <ma...@apache.org>
Committed: Tue Jun 13 15:55:51 2017 -0400

----------------------------------------------------------------------
 solr/CHANGES.txt  |  3 +++
 solr/bin/solr     | 17 ++++++++++++++---
 solr/bin/solr.cmd | 22 ++++++++++++++++++++--
 3 files changed, 37 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9a0d9e83/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 7468fc3..7810c81 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -343,6 +343,9 @@ New Features
 
 * SOLR-10660: Add reverse Stream Evaluator (Joel Bernstein)
 
+* SOLR-9910: Add solr/solr.cmd parameter to append jetty parameters to the start script.
+  (Mano Kovacs via Mark Miller)
+
 Bug Fixes
 ----------------------
 * SOLR-10723 JSON Facet API: resize() implemented incorrectly for CountSlotAcc, HllAgg.NumericAcc

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9a0d9e83/solr/bin/solr
----------------------------------------------------------------------
diff --git a/solr/bin/solr b/solr/bin/solr
index b7bf142..6b2b806 100755
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -340,6 +340,11 @@ function print_usage() {
     echo "                  you could pass: -a \"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=18983\""
     echo "                  In most cases, you should wrap the additional parameters in double quotes."
     echo ""
+    echo "  -j            Additional parameters to pass to Jetty when starting Solr."
+    echo "                  For example, to add configuration folder that jetty should read"
+    echo "                  you could pass: -j \"--include-jetty-dir=/etc/jetty/custom/server/\""
+    echo "                  In most cases, you should wrap the additional parameters in double quotes."
+    echo ""
     echo "  -noprompt     Don't prompt for input; accept all defaults when running examples that accept user input"
     echo ""
     echo "  -v and -q     Verbose (-v) or quiet (-q) logging. Sets default log level to DEBUG or WARN instead of INFO"
@@ -1437,6 +1442,11 @@ if [ $# -gt 0 ]; then
             PASS_TO_RUN_EXAMPLE+=" -a \"$ADDITIONAL_CMD_OPTS\""
             shift 2
         ;;
+        -j|-jettyconfig)
+            ADDITIONAL_JETTY_CONFIG="$2"
+            PASS_TO_RUN_EXAMPLE+=" -j \"$ADDITIONAL_JETTY_CONFIG\""
+            shift 2
+        ;;
         -k|-key)
             STOP_KEY="$2"
             shift 2
@@ -1803,6 +1813,7 @@ function launch_solr() {
   stop_port="$STOP_PORT"
   
   SOLR_ADDL_ARGS="$2"
+  SOLR_JETTY_ADDL_CONFIG="$3"
 
   # define default GC_TUNE
   if [ -z ${GC_TUNE+x} ]; then
@@ -1911,12 +1922,12 @@ function launch_solr() {
   esac
 
   if [ "$run_in_foreground" == "true" ]; then
-    exec "$JAVA" "${SOLR_START_OPTS[@]}" $SOLR_ADDL_ARGS -jar start.jar "${SOLR_JETTY_CONFIG[@]}"
+    exec "$JAVA" "${SOLR_START_OPTS[@]}" $SOLR_ADDL_ARGS -jar start.jar "${SOLR_JETTY_CONFIG[@]}" $SOLR_JETTY_ADDL_CONFIG
   else
     # run Solr in the background
     nohup "$JAVA" "${SOLR_START_OPTS[@]}" $SOLR_ADDL_ARGS -Dsolr.log.muteconsole \
 	"-XX:OnOutOfMemoryError=$SOLR_TIP/bin/oom_solr.sh $SOLR_PORT $SOLR_LOGS_DIR" \
-        -jar start.jar "${SOLR_JETTY_CONFIG[@]}" \
+        -jar start.jar "${SOLR_JETTY_CONFIG[@]}" $SOLR_JETTY_ADDL_CONFIG \
 	1>"$SOLR_LOGS_DIR/solr-$SOLR_PORT-console.log" 2>&1 & echo $! > "$SOLR_PID_DIR/solr-$SOLR_PORT.pid"
 
     # check if /proc/sys/kernel/random/entropy_avail exists then check output of cat /proc/sys/kernel/random/entropy_avail to see if less than 300
@@ -1960,6 +1971,6 @@ function launch_solr() {
   fi
 }
 
-launch_solr "$FG" "$ADDITIONAL_CMD_OPTS"
+launch_solr "$FG" "$ADDITIONAL_CMD_OPTS" "$ADDITIONAL_JETTY_CONFIG"
 
 exit $?

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9a0d9e83/solr/bin/solr.cmd
----------------------------------------------------------------------
diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd
index 820b89f..0afea02 100644
--- a/solr/bin/solr.cmd
+++ b/solr/bin/solr.cmd
@@ -323,6 +323,11 @@ goto done
 @echo                 you could pass: -a "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=18983"
 @echo                 In most cases, you should wrap the additional parameters in double quotes.
 @echo.
+@echo   -j opts       Additional parameters to pass to Jetty when starting Solr.
+@echo                 For example, to add configuration folder that jetty should read
+@echo                 you could pass: -j "--include-jetty-dir=/etc/jetty/custom/server/"
+@echo                 In most cases, you should wrap the additional parameters in double quotes.
+@echo.
 @echo   -noprompt     Don't prompt for input; accept all defaults when running examples that accept user input
 @echo.
 @echo   -v and -q     Verbose (-v) or quiet (-q) logging. Sets default log level to DEBUG or WARN instead of INFO
@@ -610,6 +615,8 @@ IF "%1"=="-z" goto set_zookeeper
 IF "%1"=="-zkhost" goto set_zookeeper
 IF "%1"=="-a" goto set_addl_opts
 IF "%1"=="-addlopts" goto set_addl_opts
+IF "%1"=="-j" goto set_addl_jetty_config
+IF "%1"=="-jettyconfig" goto set_addl_jetty_config
 IF "%1"=="-noprompt" goto set_noprompt
 IF "%1"=="-k" goto set_stop_key
 IF "%1"=="-key" goto set_stop_key
@@ -816,6 +823,13 @@ SHIFT
 SHIFT
 goto parse_args
 
+:set_addl_jetty_config
+set "arg=%~2"
+set "SOLR_JETTY_ADDL_CONFIG=%~2"
+SHIFT
+SHIFT
+goto parse_args
+
 :set_passthru
 set "PASSTHRU=%~1=%~2"
 IF NOT "%SOLR_OPTS%"=="" (
@@ -1112,6 +1126,10 @@ IF "%verbose%"=="1" (
     CALL :safe_echo "     SOLR_ADDL_ARGS  = %SOLR_ADDL_ARGS%"
   )
 
+  IF NOT "%SOLR_JETTY_ADDL_CONFIG%"=="" (
+    CALL :safe_echo "     SOLR_JETTY_ADDL_CONFIG  = %SOLR_JETTY_ADDL_CONFIG%"
+  )
+
   IF "%ENABLE_REMOTE_JMX_OPTS%"=="true" (
     @echo     RMI_PORT        = !RMI_PORT!
     @echo     REMOTE_JMX_OPTS = %REMOTE_JMX_OPTS%
@@ -1176,7 +1194,7 @@ IF "%FG%"=="1" (
     -Dlog4j.configuration="%LOG4J_CONFIG%" -DSTOP.PORT=!STOP_PORT! -DSTOP.KEY=%STOP_KEY% ^
     -Dsolr.solr.home="%SOLR_HOME%" -Dsolr.install.dir="%SOLR_TIP%" ^
     -Djetty.host=%SOLR_JETTY_HOST% -Djetty.port=%SOLR_PORT% -Djetty.home="%SOLR_SERVER_DIR%" ^
-    -Djava.io.tmpdir="%SOLR_SERVER_DIR%\tmp" -jar start.jar "%SOLR_JETTY_CONFIG%"
+    -Djava.io.tmpdir="%SOLR_SERVER_DIR%\tmp" -jar start.jar "%SOLR_JETTY_CONFIG%" "%SOLR_JETTY_ADDL_CONFIG%"
 ) ELSE (
   START /B "Solr-%SOLR_PORT%" /D "%SOLR_SERVER_DIR%" ^
     "%JAVA%" %SERVEROPT% %SOLR_JAVA_MEM% %START_OPTS% %GCLOG_OPT% ^
@@ -1184,7 +1202,7 @@ IF "%FG%"=="1" (
     -Dsolr.log.muteconsole ^
     -Dsolr.solr.home="%SOLR_HOME%" -Dsolr.install.dir="%SOLR_TIP%" ^
     -Djetty.host=%SOLR_JETTY_HOST% -Djetty.port=%SOLR_PORT% -Djetty.home="%SOLR_SERVER_DIR%" ^
-    -Djava.io.tmpdir="%SOLR_SERVER_DIR%\tmp" -jar start.jar "%SOLR_JETTY_CONFIG%" > "!SOLR_LOGS_DIR!\solr-%SOLR_PORT%-console.log"
+    -Djava.io.tmpdir="%SOLR_SERVER_DIR%\tmp" -jar start.jar "%SOLR_JETTY_CONFIG%" "%SOLR_JETTY_ADDL_CONFIG%" > "!SOLR_LOGS_DIR!\solr-%SOLR_PORT%-console.log"
   echo %SOLR_PORT%>"%SOLR_TIP%"\bin\solr-%SOLR_PORT%.port
 
   REM now wait to see Solr come online ...


[26/35] lucene-solr:jira/SOLR-10834: Merge branch 'master' into jira/SOLR-10834

Posted by ho...@apache.org.
Merge branch 'master' into jira/SOLR-10834

Conflicts:
	solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java


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

Branch: refs/heads/jira/SOLR-10834
Commit: d333f7b1eee10893a81532ac2f5a77a46716d90b
Parents: 15983ce 6396cb7
Author: Chris Hostetter <ho...@apache.org>
Authored: Tue Jun 13 10:28:42 2017 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Tue Jun 13 10:28:42 2017 -0700

----------------------------------------------------------------------
 dev-tools/idea/solr/solrj/src/java/solrj.iml    |   3 +
 .../lucene/analysis/core/TestFactories.java     |  46 +++--
 .../lucene/analysis/core/TestRandomChains.java  |   3 +
 .../lucene/analysis/ja/TestFactories.java       |  46 +++--
 solr/CHANGES.txt                                |  34 ++++
 .../java/org/apache/solr/api/V2HttpCall.java    |  13 +-
 .../org/apache/solr/cloud/ReplaceNodeCmd.java   |  96 ++++++++-
 .../org/apache/solr/core/CoreContainer.java     |   9 +-
 .../org/apache/solr/handler/ExportWriter.java   | 105 +++++++---
 .../solr/handler/MoreLikeThisHandler.java       |   7 +
 .../org/apache/solr/handler/SchemaHandler.java  |   6 +-
 .../org/apache/solr/rest/BaseSolrResource.java  |   6 +-
 .../apache/solr/schema/DoublePointField.java    |  10 +-
 .../org/apache/solr/schema/FloatPointField.java |  10 +-
 .../org/apache/solr/schema/IndexSchema.java     |  31 ++-
 .../org/apache/solr/schema/IntPointField.java   |  10 +-
 .../org/apache/solr/schema/LongPointField.java  |  10 +-
 .../apache/solr/schema/NumericFieldType.java    |  88 +++++++-
 .../java/org/apache/solr/schema/PointField.java |   7 +-
 .../java/org/apache/solr/schema/TrieField.java  |  60 +++---
 .../solr/search/IGainTermsQParserPlugin.java    |   5 +-
 .../search/SignificantTermsQParserPlugin.java   |   9 +-
 .../TextLogisticRegressionQParserPlugin.java    |   5 +-
 .../apache/solr/servlet/SolrRequestParsers.java |  13 +-
 .../apache/solr/update/AddUpdateCommand.java    |   8 +-
 .../solr/update/DirectUpdateHandler2.java       |   3 +-
 .../org/apache/solr/update/DocumentBuilder.java |   8 +-
 .../AddSchemaFieldsUpdateProcessorFactory.java  |  12 +-
 ...-schema-uniquekey-diff-type-dynamic-root.xml |  36 ++++
 .../bad-schema-uniquekey-diff-type-root.xml     |  35 ++++
 ...chema-add-schema-fields-update-processor.xml |  22 ++
 .../solr/collection1/conf/schema-rest.xml       |  33 ++-
 .../collection1/conf/schema-sortingresponse.xml |  71 ++++++-
 .../test-files/solr/collection1/conf/schema.xml |  16 +-
 .../solr/collection1/conf/schema11.xml          |   4 +
 .../solr/collection1/conf/schema12.xml          |  23 ++-
 ...dd-schema-fields-update-processor-chains.xml |  30 +--
 .../collection1/conf/solrconfig-schemaless.xml  |   6 +-
 .../solr/configsets/cloud-hdfs/conf/schema.xml  |   2 +-
 .../conf/managed-schema                         |   2 +-
 .../cloud-managed-upgrade/conf/schema.xml       |   2 +-
 .../cloud-managed/conf/managed-schema           |   2 +-
 .../cloud-minimal-jmx/conf/schema.xml           |   2 +-
 .../configsets/cloud-minimal/conf/schema.xml    |   2 +-
 .../configsets/cloud-subdirs/conf/schema.xml    |   2 +-
 .../exitable-directory/conf/schema.xml          |   2 +-
 .../org/apache/solr/BasicFunctionalityTest.java |  77 ++++++-
 .../org/apache/solr/cloud/ReplaceNodeTest.java  |   9 +-
 .../apache/solr/handler/TestReqParamsAPI.java   |   2 +-
 .../solr/handler/V2ApiIntegrationTest.java      |  21 +-
 .../apache/solr/handler/V2StandaloneTest.java   |  53 +++++
 .../handler/admin/CoreAdminHandlerTest.java     |  50 +++++
 .../apache/solr/response/TestExportWriter.java  | 199 ++++++++++++++++++-
 .../schema/TestFieldCollectionResource.java     |  10 +-
 .../apache/solr/schema/BadIndexSchemaTest.java  |  15 ++
 .../org/apache/solr/search/TestQueryTypes.java  |  46 ++++-
 .../apache/solr/search/TestSolrQueryParser.java |  36 ++++
 ...dSchemaFieldsUpdateProcessorFactoryTest.java |  16 +-
 solr/example/files/conf/managed-schema          |  20 ++
 solr/example/files/conf/solrconfig.xml          |   6 +-
 .../basic_configs/conf/solrconfig.xml           |   6 +-
 .../conf/solrconfig.xml                         |   6 +-
 solr/solr-ref-guide/src/collections-api.adoc    |   3 +-
 .../src/common-query-parameters.adoc            |  30 +--
 solr/solr-ref-guide/src/config-api.adoc         |   2 +-
 .../src/configuring-solrconfig-xml.adoc         |   2 +-
 solr/solr-ref-guide/src/coreadmin-api.adoc      |   8 +-
 ...adir-and-directoryfactory-in-solrconfig.adoc |   2 +-
 solr/solr-ref-guide/src/de-duplication.adoc     |   4 +-
 .../detecting-languages-during-indexing.adoc    |   2 +-
 .../distributed-search-with-index-sharding.adoc |   2 +-
 solr/solr-ref-guide/src/enabling-ssl.adoc       |   6 +-
 .../src/exporting-result-sets.adoc              |   2 +-
 solr/solr-ref-guide/src/faceting.adoc           |  54 ++---
 .../field-type-definitions-and-properties.adoc  |   2 +-
 .../solr-ref-guide/src/filter-descriptions.adoc |   4 +-
 solr/solr-ref-guide/src/highlighting.adoc       |   4 +-
 solr/solr-ref-guide/src/index-replication.adoc  |   2 +-
 .../src/indexconfig-in-solrconfig.adoc          |  16 +-
 .../src/introduction-to-solr-indexing.adoc      |   2 +-
 solr/solr-ref-guide/src/learning-to-rank.adoc   |   2 +-
 .../src/local-parameters-in-queries.adoc        |   2 +-
 .../major-changes-from-solr-5-to-solr-6.adoc    |   6 +-
 solr/solr-ref-guide/src/merging-indexes.adoc    |   2 +-
 .../src/near-real-time-searching.adoc           |  10 +-
 .../src/parallel-sql-interface.adoc             |  16 +-
 .../src/query-settings-in-solrconfig.adoc       |  22 +-
 .../read-and-write-side-fault-tolerance.adoc    |   4 +-
 .../src/request-parameters-api.adoc             |   2 +-
 .../src/requestdispatcher-in-solrconfig.adoc    |   8 +-
 solr/solr-ref-guide/src/response-writers.adoc   |   8 +-
 .../src/rule-based-authorization-plugin.adoc    |   4 +-
 .../src/running-solr-on-hdfs.adoc               |   4 +-
 ...schema-factory-definition-in-solrconfig.adoc |   6 +-
 solr/solr-ref-guide/src/schemaless-mode.adoc    |   6 +-
 .../src/solr-control-script-reference.adoc      |   2 +-
 solr/solr-ref-guide/src/spatial-search.adoc     |   6 +-
 solr/solr-ref-guide/src/spell-checking.adoc     |  40 ++--
 .../src/taking-solr-to-production.adoc          |   2 +-
 .../src/the-dismax-query-parser.adoc            |  20 +-
 .../src/the-extended-dismax-query-parser.adoc   |  26 +--
 .../src/the-query-elevation-component.adoc      |  14 +-
 .../src/the-standard-query-parser.adoc          |  12 +-
 .../solr-ref-guide/src/the-stats-component.adoc |   2 +-
 .../src/transforming-result-documents.adoc      |  31 ++-
 .../src/updatehandlers-in-solrconfig.adoc       |   6 +-
 solr/solr-ref-guide/src/upgrading-solr.adoc     |   2 +-
 .../src/uploading-data-with-index-handlers.adoc |   2 +-
 ...g-data-with-solr-cell-using-apache-tika.adoc |   4 +-
 solr/solr-ref-guide/src/using-solrj.adoc        |  10 +-
 ...zookeeper-to-manage-configuration-files.adoc |   2 +-
 .../src/velocity-response-writer.adoc           |   2 +-
 solr/solr-ref-guide/src/working-with-dates.adoc |  10 +-
 .../src/working-with-enum-fields.adoc           |   6 +-
 ...rking-with-external-files-and-processes.adoc |   4 +-
 .../src/zookeeper-access-control.adoc           |   4 +-
 .../solr/client/solrj/impl/CloudSolrClient.java |  10 +-
 .../solrj/impl/ConcurrentUpdateSolrClient.java  |  18 +-
 .../solr/client/solrj/impl/HttpSolrClient.java  |  80 ++++++--
 .../client/solrj/impl/LBHttpSolrClient.java     |  38 +++-
 .../solr/common/params/MapSolrParams.java       |  17 +-
 .../solr/common/params/MoreLikeThisParams.java  |   1 +
 122 files changed, 1625 insertions(+), 522 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d333f7b1/solr/core/src/test-files/solr/collection1/conf/schema.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d333f7b1/solr/core/src/test-files/solr/collection1/conf/schema11.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d333f7b1/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d333f7b1/solr/core/src/test/org/apache/solr/search/TestQueryTypes.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d333f7b1/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
----------------------------------------------------------------------
diff --cc solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
index ee0da09,4b82e62..21bf2c7
--- a/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
+++ b/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
@@@ -1038,4 -1039,39 +1039,39 @@@ public class TestSolrQueryParser extend
          , "/response/numFound==1"
      );
    }
+   
+   @Test
+   public void testBadRequestInSetQuery() throws SyntaxError {
+     SolrQueryRequest req = req();
+     QParser qParser;
+     String[] fieldSuffix = new String[] {
+         "ti", "tf", "td", "tl",
+         "i", "f", "d", "l",
+         "is", "fs", "ds", "ls",
+         "i_dv", "f_dv", "d_dv", "l_dv",
+         "is_dv", "fs_dv", "ds_dv", "ls_dv",
+         "i_dvo", "f_dvo", "d_dvo", "l_dvo",
+     };
+     
+     for (String suffix:fieldSuffix) {
+       //Good queries
+       qParser = QParser.getParser("foo_" + suffix + ":(1 2 3 4 5 6 7 8 9 10 20 19 18 17 16 15 14 13 12 25)", req);
+       qParser.setIsFilter(true);
+       qParser.getQuery();
+     }
+     
+     for (String suffix:fieldSuffix) {
+       qParser = QParser.getParser("foo_" + suffix + ":(1 2 3 4 5 6 7 8 9 10 20 19 18 17 16 15 14 13 12 NOT_A_NUMBER)", req);
+       qParser.setIsFilter(true); // this may change in the future
+       try {
+         qParser.getQuery();
+         fail("Expecting exception");
+       } catch (SolrException e) {
+         assertEquals(SolrException.ErrorCode.BAD_REQUEST.code, e.code());
+         assertTrue("Unexpected exception: " + e.getMessage(), e.getMessage().contains("Invalid Number: NOT_A_NUMBER"));
+       }
+     }
+     
+     
+   }
 -}
 +}


[32/35] lucene-solr:jira/SOLR-10834: SOLR-7452: convert bucket values in FacetStream from Integer to Long for calcite, make bucket labels in JSON Facet API consistent for facet refinement

Posted by ho...@apache.org.
SOLR-7452: convert bucket values in FacetStream from Integer to Long for calcite, make bucket labels in JSON Facet API consistent for facet refinement


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

Branch: refs/heads/jira/SOLR-10834
Commit: a18a4ce2450b33b0f03dc9882557fa48040f54c8
Parents: d1db5f7
Author: yonik <yo...@apache.org>
Authored: Tue Jun 13 17:31:30 2017 -0400
Committer: yonik <yo...@apache.org>
Committed: Tue Jun 13 17:31:30 2017 -0400

----------------------------------------------------------------------
 .../solr/search/facet/FacetFieldProcessor.java  |  1 +
 .../apache/solr/search/facet/FacetRange.java    |  6 +++-
 .../search/facet/TestJsonFacetRefinement.java   | 36 +++++++++++++-------
 .../solr/search/facet/TestJsonFacets.java       |  6 ++++
 .../client/solrj/io/stream/FacetStream.java     |  3 ++
 5 files changed, 39 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a18a4ce2/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessor.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessor.java b/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessor.java
index 7b08e14..143cfd6 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessor.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessor.java
@@ -680,6 +680,7 @@ abstract class FacetFieldProcessor extends FacetProcessor<FacetField> {
   private SimpleOrderedMap<Object> refineBucket(Object bucketVal, boolean skip, Map<String,Object> facetInfo) throws IOException {
     SimpleOrderedMap<Object> bucket = new SimpleOrderedMap<>();
     FieldType ft = sf.getType();
+    bucketVal = ft.toNativeType(bucketVal);  // refinement info passed in as JSON will cause int->long and float->double
     bucket.add("val", bucketVal);
     // String internal = ft.toInternal( tobj.toString() );  // TODO - we need a better way to get from object to query...
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a18a4ce2/solr/core/src/java/org/apache/solr/search/facet/FacetRange.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetRange.java b/solr/core/src/java/org/apache/solr/search/facet/FacetRange.java
index 398fa63..f627348 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/FacetRange.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/FacetRange.java
@@ -533,6 +533,10 @@ class FacetRangeProcessor extends FacetProcessor<FacetRange> {
 
     public IntCalc(final SchemaField f) { super(f); }
     @Override
+    public Comparable bitsToValue(long bits) {
+      return (int)bits;
+    }
+    @Override
     protected Integer parseStr(String rawval) {
       return Integer.valueOf(rawval);
     }
@@ -700,7 +704,7 @@ class FacetRangeProcessor extends FacetProcessor<FacetRange> {
 
     SimpleOrderedMap<Object> bucket = new SimpleOrderedMap<>();
     FieldType ft = sf.getType();
-    bucket.add("val", bucketVal);
+    bucket.add("val", range.low); // use "low" instead of bucketVal because it will be the right type (we may have been passed back long instead of int for example)
     // String internal = ft.toInternal( tobj.toString() );  // TODO - we need a better way to get from object to query...
 
     Query domainQ = sf.getType().getRangeQuery(null, sf, range.low == null ? null : calc.formatValue(range.low), range.high==null ? null : calc.formatValue(range.high), range.includeLower, range.includeUpper);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a18a4ce2/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetRefinement.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetRefinement.java b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetRefinement.java
index 7cf1428..94b753f 100644
--- a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetRefinement.java
+++ b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacetRefinement.java
@@ -236,18 +236,18 @@ public class TestJsonFacetRefinement extends SolrTestCaseHS {
 
   @Test
   public void testBasicRefinement() throws Exception {
-    ModifiableSolrParams p = params("cat_s", "cat_s", "xy_s", "xy_s", "num_d", "num_d", "qw_s", "qw_s", "er_s","er_s");
+    ModifiableSolrParams p = params("cat_s", "cat_s", "cat_i", "cat_i", "xy_s", "xy_s", "num_d", "num_d", "qw_s", "qw_s", "er_s","er_s");
     doBasicRefinement( p );
 
     p.set("terms","method:dvhash,");
     doBasicRefinement( p );
 
-    // multi-valued strings
-    p = params("cat_s", "cat_ss", "xy_s", "xy_ss", "num_d", "num_d", "qw_s", "qw_ss", "er_s","er_ss");
+    // multi-valued
+    p = params("cat_s", "cat_ss", "cat_i", "cat_is", "xy_s", "xy_ss", "num_d", "num_d", "qw_s", "qw_ss", "er_s","er_ss");
     doBasicRefinement( p );
 
     // single valued docvalues
-    p = params("cat_s", "cat_sd", "xy_s", "xy_sd", "num_d", "num_dd", "qw_s", "qw_sd", "er_s","er_sd");
+    p = params("cat_s", "cat_sd", "cat_i", "cat_id", "xy_s", "xy_sd", "num_d", "num_dd", "qw_s", "qw_sd", "er_s","er_sd");
     doBasicRefinement( p );
   }
 
@@ -262,21 +262,22 @@ public class TestJsonFacetRefinement extends SolrTestCaseHS {
     client.deleteByQuery("*:*", null);
 
     String cat_s = p.get("cat_s");
+    String cat_i = p.get("cat_i"); // just like cat_s, but a number
     String xy_s = p.get("xy_s");
     String qw_s = p.get("qw_s");
     String er_s = p.get("er_s");  // this field is designed to test numBuckets refinement... the first phase will only have a single bucket returned for the top count bucket of cat_s
     String num_d = p.get("num_d");
 
-    clients.get(0).add( sdoc("id", "01", "all_s","all", cat_s, "A", xy_s, "X" ,num_d, -1,  qw_s, "Q", er_s,"E") ); // A wins count tie
-    clients.get(0).add( sdoc("id", "02", "all_s","all", cat_s, "B", xy_s, "Y", num_d, 3                       ) );
+    clients.get(0).add( sdoc("id", "01", "all_s","all", cat_s, "A", cat_i,1, xy_s, "X" ,num_d, -1,  qw_s, "Q", er_s,"E") ); // A wins count tie
+    clients.get(0).add( sdoc("id", "02", "all_s","all", cat_s, "B", cat_i,2, xy_s, "Y", num_d, 3                       ) );
 
-    clients.get(1).add( sdoc("id", "11", "all_s","all", cat_s, "B", xy_s, "X", num_d, -5            , er_s,"E") ); // B highest count
-    clients.get(1).add( sdoc("id", "12", "all_s","all", cat_s, "B", xy_s, "Y", num_d, -11, qw_s, "W"          ) );
-    clients.get(1).add( sdoc("id", "13", "all_s","all", cat_s, "A", xy_s, "X", num_d, 7             , er_s,"R") );       // "R" will only be picked up via refinement when parent facet is cat_s
+    clients.get(1).add( sdoc("id", "11", "all_s","all", cat_s, "B", cat_i,2, xy_s, "X", num_d, -5            , er_s,"E") ); // B highest count
+    clients.get(1).add( sdoc("id", "12", "all_s","all", cat_s, "B", cat_i,2, xy_s, "Y", num_d, -11, qw_s, "W"          ) );
+    clients.get(1).add( sdoc("id", "13", "all_s","all", cat_s, "A", cat_i,1, xy_s, "X", num_d, 7             , er_s,"R") );       // "R" will only be picked up via refinement when parent facet is cat_s
 
-    clients.get(2).add( sdoc("id", "21", "all_s","all", cat_s, "A", xy_s, "X", num_d, 17,  qw_s, "W", er_s,"E") ); // A highest count
-    clients.get(2).add( sdoc("id", "22", "all_s","all", cat_s, "A", xy_s, "Y", num_d, -19                     ) );
-    clients.get(2).add( sdoc("id", "23", "all_s","all", cat_s, "B", xy_s, "X", num_d, 11                      ) );
+    clients.get(2).add( sdoc("id", "21", "all_s","all", cat_s, "A", cat_i,1, xy_s, "X", num_d, 17,  qw_s, "W", er_s,"E") ); // A highest count
+    clients.get(2).add( sdoc("id", "22", "all_s","all", cat_s, "A", cat_i,1, xy_s, "Y", num_d, -19                     ) );
+    clients.get(2).add( sdoc("id", "23", "all_s","all", cat_s, "B", cat_i,2, xy_s, "X", num_d, 11                      ) );
 
     client.commit();
 
@@ -315,6 +316,17 @@ public class TestJsonFacetRefinement extends SolrTestCaseHS {
             "}"
     );
 
+    // same as above, but with an integer field instead of a string
+    client.testJQ(params(p, "q", "*:*",
+        "json.facet", "{" +
+            "cat0:{${terms} type:terms, field:${cat_i}, sort:'count desc', limit:1, overrequest:0, refine:true}" +
+            "}"
+        )
+        , "facets=={ count:8" +
+            ", cat0:{ buckets:[ {val:1,count:4} ] }" +  // w/o overrequest, we need refining to get the correct count.
+            "}"
+    );
+
     // basic refining test through/under a query facet
     client.testJQ(params(p, "q", "*:*",
         "json.facet", "{" +

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a18a4ce2/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
index 03cc480..2f73b50 100644
--- a/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
+++ b/solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
@@ -507,6 +507,12 @@ public class TestJsonFacets extends SolrTestCaseHS {
     if (terms_method != null) {
       terms=terms+terms_method;
     }
+    String refine_method = p.get("refine_method");
+    if (refine_method == null && random().nextBoolean()) {
+      refine_method = "refine:true,";
+    }
+    if (refine_method != null) terms = terms + refine_method;
+
     p.set("terms", terms);
     // "${terms}" should be put at the beginning of generic terms facets.
     // It may specify "method=..." or "limit:-1", so should not be used if the facet explicitly specifies.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a18a4ce2/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FacetStream.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FacetStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FacetStream.java
index c5bd56b..fb53e84 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FacetStream.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FacetStream.java
@@ -477,6 +477,9 @@ public class FacetStream extends TupleStream implements Expressible  {
     for(int b=0; b<allBuckets.size(); b++) {
       NamedList bucket = (NamedList)allBuckets.get(b);
       Object val = bucket.get("val");
+      if (val instanceof Integer) {
+        val=((Integer)val).longValue();  // calcite currently expects Long values here
+      }
       Tuple t = currentTuple.clone();
       t.put(bucketName, val);
       int nextLevel = level+1;


[16/35] lucene-solr:jira/SOLR-10834: SOLR-8392: Remove instanceof checks on return value of SolrParam::get

Posted by ho...@apache.org.
SOLR-8392: Remove instanceof checks on return value of SolrParam::get


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

Branch: refs/heads/jira/SOLR-10834
Commit: 94220a01e14f53e0632bfbc1678661ad9c67320a
Parents: c51f6fa
Author: Mike Drob <md...@apache.org>
Authored: Mon Jun 12 15:15:54 2017 -0700
Committer: Mike Drob <md...@apache.org>
Committed: Mon Jun 12 15:15:54 2017 -0700

----------------------------------------------------------------------
 solr/CHANGES.txt                                   |  2 ++
 .../org/apache/solr/handler/SchemaHandler.java     |  6 +-----
 .../org/apache/solr/rest/BaseSolrResource.java     |  6 ++----
 .../apache/solr/common/params/MapSolrParams.java   | 17 ++++-------------
 4 files changed, 9 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94220a01/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 9135cfa..51d2d53 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -256,6 +256,8 @@ Other Changes
 * SOLR-10800: Factor out HttpShardHandler.transformReplicasToShardUrls from HttpShardHandler.prepDistributed.
   (Domenico Fabio Marino, Christine Poerschke)
 
+* SOLR-8392: Remove instanceof checks on return value of SolrParam::get (Mike Drob, Varun Thacker)
+
 ==================  6.7.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94220a01/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java b/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
index e3e292b..626f655 100644
--- a/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
@@ -138,11 +138,7 @@ public class SchemaHandler extends RequestHandlerBase implements SolrCoreAware,
           break;
         }
         case "/schema/zkversion": {
-          int refreshIfBelowVersion = -1;
-          Object refreshParam = req.getParams().get("refreshIfBelowVersion");
-          if (refreshParam != null)
-            refreshIfBelowVersion = (refreshParam instanceof Number) ? ((Number) refreshParam).intValue()
-                : Integer.parseInt(refreshParam.toString());
+          int refreshIfBelowVersion = req.getParams().getInt("refreshIfBelowVersion", -1);
           int zkVersion = -1;
           IndexSchema schema = req.getSchema();
           if (schema instanceof ManagedIndexSchema) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94220a01/solr/core/src/java/org/apache/solr/rest/BaseSolrResource.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/rest/BaseSolrResource.java b/solr/core/src/java/org/apache/solr/rest/BaseSolrResource.java
index 5a9310d..cc1eeb2 100644
--- a/solr/core/src/java/org/apache/solr/rest/BaseSolrResource.java
+++ b/solr/core/src/java/org/apache/solr/rest/BaseSolrResource.java
@@ -125,11 +125,9 @@ public abstract class BaseSolrResource extends ServerResource {
             SolrCore.preDecorateResponse(solrRequest, solrResponse);
 
             // client application can set a timeout for update requests
-            Object updateTimeoutSecsParam = getSolrRequest().getParams().get(UPDATE_TIMEOUT_SECS);
+            String updateTimeoutSecsParam = getSolrRequest().getParams().get(UPDATE_TIMEOUT_SECS);
             if (updateTimeoutSecsParam != null)
-              updateTimeoutSecs = (updateTimeoutSecsParam instanceof Number)
-                  ? ((Number) updateTimeoutSecsParam).intValue()
-                  : Integer.parseInt(updateTimeoutSecsParam.toString());
+              updateTimeoutSecs = Integer.parseInt(updateTimeoutSecsParam);
 
           }
         }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94220a01/solr/solrj/src/java/org/apache/solr/common/params/MapSolrParams.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/params/MapSolrParams.java b/solr/solrj/src/java/org/apache/solr/common/params/MapSolrParams.java
index 5454fca..53eff87 100644
--- a/solr/solrj/src/java/org/apache/solr/common/params/MapSolrParams.java
+++ b/solr/solrj/src/java/org/apache/solr/common/params/MapSolrParams.java
@@ -20,7 +20,7 @@ import java.util.Iterator;
 import java.util.Map;
 
 /**
- *
+ * {@link SolrParams} implementation that can be built from and is backed by a {@link Map}.
  */
 public class MapSolrParams extends SolrParams {
   protected final Map<String,String> map;
@@ -31,22 +31,13 @@ public class MapSolrParams extends SolrParams {
 
   @Override
   public String get(String name) {
-    Object  o = map.get(name);
-    if(o == null) return null;
-    if (o instanceof String) return  (String) o;
-    if (o instanceof String[]) {
-      String[] strings = (String[]) o;
-      if(strings.length == 0) return null;
-      return strings[0];
-    }
-    return String.valueOf(o);
+    return map.get(name);
   }
 
   @Override
   public String[] getParams(String name) {
-    Object val = map.get(name);
-    if (val instanceof String[]) return (String[]) val;
-    return val==null ? null : new String[]{String.valueOf(val)};
+    String val = map.get(name);
+    return val==null ? null : new String[]{val};
   }
 
   @Override


[10/35] lucene-solr:jira/SOLR-10834: SOLR-10715: Move change entry to 6.7.0

Posted by ho...@apache.org.
SOLR-10715: Move change entry to 6.7.0


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

Branch: refs/heads/jira/SOLR-10834
Commit: 661a3c46d42114b5d3c3f20b0c412b4b5deb5afb
Parents: e11eb63
Author: Cao Manh Dat <da...@apache.org>
Authored: Mon Jun 12 16:44:42 2017 +0700
Committer: Cao Manh Dat <da...@apache.org>
Committed: Mon Jun 12 16:44:42 2017 +0700

----------------------------------------------------------------------
 solr/CHANGES.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/661a3c46/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 6eb2152..9ba932f 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -156,8 +156,6 @@ Bug Fixes
 
 * SOLR-10223: Allow running examples as root on Linux with -force option (janhoy)
 
-* SOLR-10715: /v2/ should not be an alias for /v2/collections (Cao Manh Dat)
-
 Optimizations
 ----------------------
 
@@ -357,6 +355,8 @@ Bug Fixes
   shards. The fix included an optimization to use Solr's cached AtomicReader instead of re-calculating.
   (David Smiley)
 
+* SOLR-10715: /v2/ should not be an alias for /v2/collections (Cao Manh Dat)
+
 Optimizations
 ----------------------
 * SOLR-10634: JSON Facet API: When a field/terms facet will retrieve all buckets (i.e. limit:-1)


[06/35] lucene-solr:jira/SOLR-10834: SOLR-10857: Solr loads UNLOADed core on request.

Posted by ho...@apache.org.
SOLR-10857: Solr loads UNLOADed core on request.


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

Branch: refs/heads/jira/SOLR-10834
Commit: 95841d9ed406def6be62ab039dba8c4dd4b552a8
Parents: d7808eb
Author: Erick <er...@apache.org>
Authored: Sun Jun 11 12:13:25 2017 -0700
Committer: Erick <er...@apache.org>
Committed: Sun Jun 11 12:13:25 2017 -0700

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  7 +++
 .../org/apache/solr/core/CoreContainer.java     |  9 ++--
 .../handler/admin/CoreAdminHandlerTest.java     | 52 ++++++++++++++++++++
 3 files changed, 63 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/95841d9e/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 039a2c4..275710d 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -397,6 +397,13 @@ Other Changes
 * SOLR-10761: Switch trie numeric/date fields to points in data-driven-enabled example and test schemas.
   (Steve Rowe)
 
+==================  6.6.1 ==================
+
+Bug Fixes
+----------------------
+
+* SOLR-10857: standalone Solr loads UNLOADed core on request (Erick Erickson, Mikhail Khludnev)
+
 ==================  6.6.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/95841d9e/solr/core/src/java/org/apache/solr/core/CoreContainer.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
index 37842f8..6055acf 100644
--- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java
+++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
@@ -1285,6 +1285,8 @@ public class CoreContainer {
 
     boolean close = solrCores.isLoadedNotPendingClose(name);
     SolrCore core = solrCores.remove(name);
+
+    solrCores.removeCoreDescriptor(cd);
     coresLocator.delete(this, cd);
     if (core == null) {
       // transient core
@@ -1298,8 +1300,8 @@ public class CoreContainer {
     if (zkSys.getZkController() != null) {
       // cancel recovery in cloud mode
       core.getSolrCoreState().cancelRecovery();
-      if (core.getCoreDescriptor().getCloudDescriptor().getReplicaType() == Replica.Type.PULL
-          || core.getCoreDescriptor().getCloudDescriptor().getReplicaType() == Replica.Type.TLOG) {
+      if (cd.getCloudDescriptor().getReplicaType() == Replica.Type.PULL
+          || cd.getCloudDescriptor().getReplicaType() == Replica.Type.TLOG) {
         // Stop replication if this is part of a pull/tlog replica before closing the core
         zkSys.getZkController().stopReplicationFromLeader(name);
       }
@@ -1319,9 +1321,6 @@ public class CoreContainer {
         throw new SolrException(ErrorCode.SERVER_ERROR, "Error unregistering core [" + name + "] from cloud state", e);
       }
     }
-    if (deleteInstanceDir) { // we aren't going to reload this if we delete the instance dir.
-      solrCores.removeCoreDescriptor(cd);
-    }
   }
 
   public void rename(String name, String toName) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/95841d9e/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java
index a81cf13..f1770f8 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java
@@ -27,10 +27,12 @@ import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;
 import org.apache.commons.io.FileUtils;
 import org.apache.lucene.util.Constants;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.impl.HttpSolrClient;
 import org.apache.solr.client.solrj.request.CoreAdminRequest;
 import org.apache.solr.client.solrj.request.CoreStatus;
+import org.apache.solr.client.solrj.response.QueryResponse;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.common.params.CoreAdminParams;
@@ -283,6 +285,56 @@ public class CoreAdminHandlerTest extends SolrTestCaseJ4 {
   }
 
   @Test
+  public void testUnloadForever() throws Exception  {
+    File solrHomeDirectory = new File(initCoreDataDir, getClass().getName() + "-corex-"
+        + System.nanoTime());
+    solrHomeDirectory.mkdirs();
+    copySolrHomeToTemp(solrHomeDirectory, "corex");
+    File corex = new File(solrHomeDirectory, "corex");
+    FileUtils.write(new File(corex, "core.properties"), "", StandardCharsets.UTF_8);
+    JettySolrRunner runner = new JettySolrRunner(solrHomeDirectory.getAbsolutePath(), buildJettyConfig("/solr"));
+    runner.start();
+
+    try (HttpSolrClient client = getHttpSolrClient(runner.getBaseUrl() + "/corex")) {
+      client.setConnectionTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT);
+      client.setSoTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT);
+      SolrInputDocument doc = new SolrInputDocument();
+      doc.addField("id", "123");
+      client.add(doc);
+      client.commit();
+    }
+
+    try (HttpSolrClient client = getHttpSolrClient(runner.getBaseUrl() + "/corex")) {
+      client.setConnectionTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT);
+      client.setSoTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT);
+      QueryResponse result = client.query(new SolrQuery("id:*"));
+      assertEquals(1,result.getResults().getNumFound());
+    }
+    
+    try (HttpSolrClient client = getHttpSolrClient(runner.getBaseUrl().toString())) {
+      client.setConnectionTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT);
+      client.setSoTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT);
+      CoreAdminRequest.Unload req = new CoreAdminRequest.Unload(false);
+      req.setDeleteInstanceDir(false);//random().nextBoolean());
+      req.setCoreName("corex");
+      req.process(client);
+    }
+
+    try (HttpSolrClient client = getHttpSolrClient(runner.getBaseUrl() + "/corex")) {
+      client.setConnectionTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT);
+      client.setSoTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT*1000);
+      QueryResponse result = client.query(new SolrQuery("id:*"));
+      //assertEquals(1,result.getResults().getNumFound());
+      fail("expect 404");
+    }catch(Exception e){
+      e.printStackTrace();
+    }
+    finally{
+      runner.stop();
+    }
+  }
+  
+  @Test
   public void testDeleteInstanceDirAfterCreateFailure() throws Exception  {
     assumeFalse("Ignore test on windows because it does not delete data directory immediately after unload", Constants.WINDOWS);
     File solrHomeDirectory = new File(initCoreDataDir, getClass().getName() + "-corex-"


[14/35] lucene-solr:jira/SOLR-10834: SOLR-10871: remove backticks for monospace type in headings

Posted by ho...@apache.org.
SOLR-10871: remove backticks for monospace type in headings


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

Branch: refs/heads/jira/SOLR-10834
Commit: 0411504dd8dfccb2d997546759c1f26d7bb0eae9
Parents: 5a737a3
Author: Cassandra Targett <ct...@apache.org>
Authored: Mon Jun 12 12:30:51 2017 -0500
Committer: Cassandra Targett <ct...@apache.org>
Committed: Mon Jun 12 12:31:41 2017 -0500

----------------------------------------------------------------------
 .../src/common-query-parameters.adoc            | 30 +++++------
 solr/solr-ref-guide/src/config-api.adoc         |  2 +-
 .../src/configuring-solrconfig-xml.adoc         |  2 +-
 solr/solr-ref-guide/src/coreadmin-api.adoc      |  8 +--
 ...adir-and-directoryfactory-in-solrconfig.adoc |  2 +-
 solr/solr-ref-guide/src/de-duplication.adoc     |  4 +-
 .../detecting-languages-during-indexing.adoc    |  2 +-
 .../distributed-search-with-index-sharding.adoc |  2 +-
 solr/solr-ref-guide/src/enabling-ssl.adoc       |  6 +--
 .../src/exporting-result-sets.adoc              |  2 +-
 solr/solr-ref-guide/src/faceting.adoc           | 54 ++++++++++----------
 .../field-type-definitions-and-properties.adoc  |  2 +-
 solr/solr-ref-guide/src/highlighting.adoc       |  4 +-
 solr/solr-ref-guide/src/index-replication.adoc  |  2 +-
 .../src/indexconfig-in-solrconfig.adoc          | 14 ++---
 .../src/introduction-to-solr-indexing.adoc      |  2 +-
 .../src/local-parameters-in-queries.adoc        |  2 +-
 .../major-changes-from-solr-5-to-solr-6.adoc    |  2 +-
 solr/solr-ref-guide/src/merging-indexes.adoc    |  2 +-
 .../src/near-real-time-searching.adoc           | 10 ++--
 .../src/parallel-sql-interface.adoc             | 16 +++---
 .../src/query-settings-in-solrconfig.adoc       | 22 ++++----
 .../read-and-write-side-fault-tolerance.adoc    |  4 +-
 .../src/request-parameters-api.adoc             |  2 +-
 .../src/requestdispatcher-in-solrconfig.adoc    |  8 +--
 solr/solr-ref-guide/src/response-writers.adoc   |  8 +--
 ...schema-factory-definition-in-solrconfig.adoc |  6 +--
 solr/solr-ref-guide/src/spatial-search.adoc     |  6 +--
 solr/solr-ref-guide/src/spell-checking.adoc     | 40 +++++++--------
 .../src/the-dismax-query-parser.adoc            | 20 ++++----
 .../src/the-extended-dismax-query-parser.adoc   | 26 +++++-----
 .../src/the-query-elevation-component.adoc      | 14 ++---
 .../src/the-standard-query-parser.adoc          | 12 ++---
 .../src/transforming-result-documents.adoc      | 31 +++++------
 .../src/updatehandlers-in-solrconfig.adoc       |  6 +--
 .../src/uploading-data-with-index-handlers.adoc |  2 +-
 ...g-data-with-solr-cell-using-apache-tika.adoc |  4 +-
 ...zookeeper-to-manage-configuration-files.adoc |  2 +-
 solr/solr-ref-guide/src/working-with-dates.adoc |  8 +--
 .../src/working-with-enum-fields.adoc           |  6 +--
 ...rking-with-external-files-and-processes.adoc |  4 +-
 41 files changed, 199 insertions(+), 202 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/common-query-parameters.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/common-query-parameters.adoc b/solr/solr-ref-guide/src/common-query-parameters.adoc
index 5b6c701..826cbe2 100644
--- a/solr/solr-ref-guide/src/common-query-parameters.adoc
+++ b/solr/solr-ref-guide/src/common-query-parameters.adoc
@@ -46,7 +46,7 @@ The table below summarizes Solr's common query parameters, which are supported b
 The following sections describe these parameters in detail.
 
 [[CommonQueryParameters-ThedefTypeParameter]]
-== The `defType` Parameter
+== The defType Parameter
 
 The defType parameter selects the query parser that Solr should use to process the main query parameter (`q`) in the request. For example:
 
@@ -55,7 +55,7 @@ The defType parameter selects the query parser that Solr should use to process t
 If no defType param is specified, then by default, the <<the-standard-query-parser.adoc#the-standard-query-parser,The Standard Query Parser>> is used. (eg: `defType=lucene`)
 
 [[CommonQueryParameters-ThesortParameter]]
-== The `sort` Parameter
+== The sort Parameter
 
 The `sort` parameter arranges search results in either ascending (`asc`) or descending (`desc`) order. The parameter can be used with either numerical or alphabetical content. The directions can be entered in either all lowercase or all uppercase letters (i.e., both `asc` or `ASC`).
 
@@ -88,7 +88,7 @@ Regarding the sort parameter's arguments:
 ** When more than one sort criteria is provided, the second entry will only be used if the first entry results in a tie. If there is a third entry, it will only be used if the first AND second entries are tied. This pattern continues with further entries.
 
 [[CommonQueryParameters-ThestartParameter]]
-== The `start` Parameter
+== The start Parameter
 
 When specified, the `start` parameter specifies an offset into a query's result set and instructs Solr to begin displaying results from this offset.
 
@@ -99,14 +99,14 @@ Setting the `start` parameter to some other number, such as 3, causes Solr to sk
 You can use the `start` parameter this way for paging. For example, if the `rows` parameter is set to 10, you could display three successive pages of results by setting start to 0, then re-issuing the same query and setting start to 10, then issuing the query again and setting start to 20.
 
 [[CommonQueryParameters-TherowsParameter]]
-== The `rows` Parameter
+== The rows Parameter
 
 You can use the rows parameter to paginate results from a query. The parameter specifies the maximum number of documents from the complete result set that Solr should return to the client at one time.
 
 The default value is 10. That is, by default, Solr returns 10 documents at a time in response to a query.
 
 [[CommonQueryParameters-Thefq_FilterQuery_Parameter]]
-== The `fq` (Filter Query) Parameter
+== The fq (Filter Query) Parameter
 
 The `fq` parameter defines a query that can be used to restrict the superset of documents that can be returned, without influencing score. It can be very useful for speeding up complex queries, since the queries specified with `fq` are cached independently of the main query. When a later query uses the same filter, there's a cache hit, and filter results are returned quickly from the cache.
 
@@ -132,7 +132,7 @@ fq=+popularity:[10 TO *] +section:0
 * As with all parameters: special characters in an URL need to be properly escaped and encoded as hex values. Online tools are available to help you with URL-encoding. For example: http://meyerweb.com/eric/tools/dencoder/.
 
 [[CommonQueryParameters-Thefl_FieldList_Parameter]]
-== The `fl` (Field List) Parameter
+== The fl (Field List) Parameter
 
 The `fl` parameter limits the information included in a query response to a specified list of fields. The fields need to either be `stored="true"` or `docValues="true"``.`
 
@@ -204,7 +204,7 @@ fl=id,sales_price:price,secret_sauce:prod(price,popularity),why_score:[explain s
 ----
 
 [[CommonQueryParameters-ThedebugParameter]]
-== The `debug` Parameter
+== The debug Parameter
 
 The `debug` parameter can be specified multiple times and supports the following arguments:
 
@@ -219,7 +219,7 @@ For backwards compatibility with older versions of Solr, `debugQuery=true` may i
 The default behavior is not to include debugging information.
 
 [[CommonQueryParameters-TheexplainOtherParameter]]
-== The `explainOther` Parameter
+== The explainOther Parameter
 
 The `explainOther` parameter specifies a Lucene query in order to identify a set of documents. If this parameter is included and is set to a non-blank value, the query will return debugging information, along with the "explain info" of each document that matches the Lucene query, relative to the main query (which is specified by the q parameter). For example:
 
@@ -233,7 +233,7 @@ The query above allows you to examine the scoring explain info of the top matchi
 The default value of this parameter is blank, which causes no extra "explain info" to be returned.
 
 [[CommonQueryParameters-ThetimeAllowedParameter]]
-== The `timeAllowed` Parameter
+== The timeAllowed Parameter
 
 This parameter specifies the amount of time, in milliseconds, allowed for a search to complete. If this time expires before the search is complete, any partial results will be returned, but values such as `numFound`, <<faceting.adoc#faceting,facet>> counts, and result <<the-stats-component.adoc#the-stats-component,stats>> may not be accurate for the entire result set.
 
@@ -245,7 +245,7 @@ This value is only checked at the time of:
 As this check is periodically performed, the actual time for which a request can be processed before it is aborted would be marginally greater than or equal to the value of `timeAllowed`. If the request consumes more time in other stages, e.g., custom components, etc., this parameter is not expected to abort the request.
 
 [[CommonQueryParameters-ThesegmentTerminateEarlyParameter]]
-== The `segmentTerminateEarly` Parameter
+== The segmentTerminateEarly Parameter
 
 This parameter may be set to either true or false.
 
@@ -258,19 +258,19 @@ Similar to using <<CommonQueryParameters-ThetimeAllowedParameter,the `timeAllowe
 The default value of this parameter is false.
 
 [[CommonQueryParameters-TheomitHeaderParameter]]
-== The `omitHeader` Parameter
+== The omitHeader Parameter
 
 This parameter may be set to either true or false.
 
 If set to true, this parameter excludes the header from the returned results. The header contains information about the request, such as the time it took to complete. The default value for this parameter is false.
 
 [[CommonQueryParameters-ThewtParameter]]
-== The `wt` Parameter
+== The wt Parameter
 
 The `wt` parameter selects the Response Writer that Solr should use to format the query's response. For detailed descriptions of Response Writers, see <<response-writers.adoc#response-writers,Response Writers>>.
 
 [[CommonQueryParameters-Thecache_falseParameter]]
-== The `cache=false` Parameter
+== The cache=false Parameter
 
 Solr caches the results of all queries and filter queries by default. To disable result caching, set the `cache=false` parameter.
 
@@ -296,7 +296,7 @@ fq={!frange l=10 u=100 cache=false cost=100}mul(popularity,price)
 ----
 
 [[CommonQueryParameters-ThelogParamsListParameter]]
-== The `logParamsList` Parameter
+== The logParamsList Parameter
 
 By default, Solr logs all parameters of requests. Set this parameter to restrict which parameters of a request are logged. This may help control logging to only those parameters considered important to your organization.
 
@@ -314,7 +314,7 @@ This parameter does not only apply to query requests, but to any kind of request
 ====
 
 [[CommonQueryParameters-TheechoParamsParameter]]
-== The `echoParams` Parameter
+== The echoParams Parameter
 
 The `echoParams` parameter controls what information about request parameters is included in the response header.
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/config-api.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/config-api.adoc b/solr/solr-ref-guide/src/config-api.adoc
index 13d523b..1b330d0 100644
--- a/solr/solr-ref-guide/src/config-api.adoc
+++ b/solr/solr-ref-guide/src/config-api.adoc
@@ -212,7 +212,7 @@ For more information about user-defined properties, see the section <<configurin
 See also the section <<ConfigAPI-CreatingandUpdatingUser-DefinedProperties,Creating and Updating User-Defined Properties>> below for examples of how to use this type of command.
 
 [[ConfigAPI-HowtoMapsolrconfig.xmlPropertiestoJSON]]
-== How to Map `solrconfig.xml` Properties to JSON
+== How to Map solrconfig.xml Properties to JSON
 
 By using this API, you will be generating JSON representations of properties defined in `solrconfig.xml`. To understand how properties should be represented with the API, let's take a look at a few examples.
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/configuring-solrconfig-xml.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/configuring-solrconfig-xml.adoc b/solr/solr-ref-guide/src/configuring-solrconfig-xml.adoc
index c3a3021..48f9084 100644
--- a/solr/solr-ref-guide/src/configuring-solrconfig-xml.adoc
+++ b/solr/solr-ref-guide/src/configuring-solrconfig-xml.adoc
@@ -121,7 +121,7 @@ The path and name of the `solrcore.properties` file can be overridden using the
 ====
 
 [[Configuringsolrconfig.xml-Userdefinedpropertiesfromcore.properties]]
-=== User-Defined Properties in `core.properties`
+=== User-Defined Properties in core.properties
 
 Every Solr core has a `core.properties` file, automatically created when using the APIs. When you create a SolrCloud collection, you can pass through custom parameters to go into each core.properties that will be created, by prefixing the parameter name with "property." as a URL parameter. Example:
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/coreadmin-api.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/coreadmin-api.adoc b/solr/solr-ref-guide/src/coreadmin-api.adoc
index a2e3aa3..fef4929 100644
--- a/solr/solr-ref-guide/src/coreadmin-api.adoc
+++ b/solr/solr-ref-guide/src/coreadmin-api.adoc
@@ -289,25 +289,25 @@ Either `path` or `targetCore` parameter must be specified but not both. The rang
 
 The `core` index will be split into as many pieces as the number of `path` or `targetCore` parameters.
 
-==== Usage with two `targetCore` parameters:
+==== Usage with two targetCore parameters:
 
 `\http://localhost:8983/solr/admin/cores?action=SPLIT&core=core0&targetCore=core1&targetCore=core2`
 
 Here the `core` index will be split into two pieces and merged into the two `targetCore` indexes.
 
-==== Usage with two `path` parameters:
+==== Usage with two path parameters:
 
 `\http://localhost:8983/solr/admin/cores?action=SPLIT&core=core0&path=/path/to/index/1&path=/path/to/index/2`
 
 The `core` index will be split into two pieces and written into the two directory paths specified.
 
-==== Usage with the `split.key` parameter:
+==== Usage with the split.key parameter:
 
 `\http://localhost:8983/solr/admin/cores?action=SPLIT&core=core0&targetCore=core1&split.key=A!`
 
 Here all documents having the same route key as the `split.key` i.e. 'A!' will be split from the `core` index and written to the `targetCore`.
 
-==== Usage with `ranges` parameter:
+==== Usage with ranges parameter:
 
 `\http://localhost:8983/solr/admin/cores?action=SPLIT&core=core0&targetCore=core1&targetCore=core2&targetCore=core3&ranges=0-1f4,1f5-3e8,3e9-5dc`
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/datadir-and-directoryfactory-in-solrconfig.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/datadir-and-directoryfactory-in-solrconfig.adoc b/solr/solr-ref-guide/src/datadir-and-directoryfactory-in-solrconfig.adoc
index 496830d..8ee43be 100644
--- a/solr/solr-ref-guide/src/datadir-and-directoryfactory-in-solrconfig.adoc
+++ b/solr/solr-ref-guide/src/datadir-and-directoryfactory-in-solrconfig.adoc
@@ -20,7 +20,7 @@
 
 Where and how Solr stores its indexes are configurable options.
 
-== Specifying a Location for Index Data with the `dataDir` Parameter
+== Specifying a Location for Index Data with the dataDir Parameter
 
 By default, Solr stores its index data in a directory called `/data` under the core's instance directory (`instanceDir`). If you would like to specify a different directory for storing index data, you can configure the `dataDir` in the `core.properties` file for the core, or use the `<dataDir>` parameter in the `solrconfig.xml` file. You can specify another directory either with an absolute path or a pathname relative to the instanceDir of the SolrCore. For example:
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/de-duplication.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/de-duplication.adoc b/solr/solr-ref-guide/src/de-duplication.adoc
index 2a3b902..8f4d01a 100644
--- a/solr/solr-ref-guide/src/de-duplication.adoc
+++ b/solr/solr-ref-guide/src/de-duplication.adoc
@@ -47,7 +47,7 @@ Of course the `signatureField` could be the unique field, but generally you want
 There are two places in Solr to configure de-duplication: in `solrconfig.xml` and in `schema.xml`.
 
 [[De-Duplication-Insolrconfig.xml]]
-=== In `solrconfig.xml`
+=== In solrconfig.xml
 
 The `SignatureUpdateProcessorFactory` has to be registered in `solrconfig.xml` as part of an <<update-request-processors.adoc#update-request-processors,Update Request Processor Chain>>, as in this example:
 
@@ -87,7 +87,7 @@ A Signature implementation for generating a signature hash. The full classpath o
 |===
 
 [[De-Duplication-Inschema.xml]]
-=== In `schema.xml`
+=== In schema.xml
 
 If you are using a separate field for storing the signature, you must have it indexed:
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/detecting-languages-during-indexing.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/detecting-languages-during-indexing.adoc b/solr/solr-ref-guide/src/detecting-languages-during-indexing.adoc
index 26786e4..b73fdf7 100644
--- a/solr/solr-ref-guide/src/detecting-languages-during-indexing.adoc
+++ b/solr/solr-ref-guide/src/detecting-languages-during-indexing.adoc
@@ -67,7 +67,7 @@ Here is an example of a minimal LangDetect `langid` configuration in `solrconfig
 ----
 
 [[DetectingLanguagesDuringIndexing-langidParameters]]
-== `langid` Parameters
+== langid Parameters
 
 As previously mentioned, both implementations of the `langid` UpdateRequestProcessor take the same parameters.
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/distributed-search-with-index-sharding.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/distributed-search-with-index-sharding.adoc b/solr/solr-ref-guide/src/distributed-search-with-index-sharding.adoc
index 9b2ca46..b1ad8dc 100644
--- a/solr/solr-ref-guide/src/distributed-search-with-index-sharding.adoc
+++ b/solr/solr-ref-guide/src/distributed-search-with-index-sharding.adoc
@@ -34,7 +34,7 @@ When not using SolrCloud, it is up to you to get all your documents indexed on e
 In the legacy distributed mode, Solr does not calculate universal term/doc frequencies. For most large-scale implementations, it is not likely to matter that Solr calculates TF/IDF at the shard level. However, if your collection is heavily skewed in its distribution across servers, you may find misleading relevancy results in your searches. In general, it is probably best to randomly distribute documents to your shards.
 
 [[DistributedSearchwithIndexSharding-ExecutingDistributedSearcheswiththeshardsParameter]]
-== Executing Distributed Searches with the `shards` Parameter
+== Executing Distributed Searches with the shards Parameter
 
 If a query request includes the `shards` parameter, the Solr server distributes the request across all the shards listed as arguments to the parameter. The `shards` parameter uses this syntax:
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/enabling-ssl.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/enabling-ssl.adoc b/solr/solr-ref-guide/src/enabling-ssl.adoc
index c26e4af..32b3cc0 100644
--- a/solr/solr-ref-guide/src/enabling-ssl.adoc
+++ b/solr/solr-ref-guide/src/enabling-ssl.adoc
@@ -253,7 +253,7 @@ curl -E solr-ssl.keystore.p12:secret --cacert solr-ssl.cacert.pem ...
 
 NOTE: If your operating system does not include cURL, you can download binaries here: http://curl.haxx.se/download.html
 
-=== Create a SolrCloud Collection using `bin/solr`
+=== Create a SolrCloud Collection using bin/solr
 
 Create a 2-shard, replicationFactor=1 collection named mycollection using the default configset (data_driven_schema_configs):
 
@@ -318,7 +318,7 @@ You should get a response that looks like this:
 ----
 
 [[EnablingSSL-Indexdocumentsusingpost.jar]]
-=== Index Documents using `post.jar`
+=== Index Documents using post.jar
 
 Use `post.jar` to index some example documents to the SolrCloud collection created above:
 
@@ -340,7 +340,7 @@ curl -E solr-ssl.pem:secret --cacert solr-ssl.pem "https://localhost:8984/solr/m
 ----
 
 [[EnablingSSL-IndexadocumentusingCloudSolrClient]]
-=== Index a document using `CloudSolrClient`
+=== Index a document using CloudSolrClient
 
 From a java client using SolrJ, index a document. In the code below, the `javax.net.ssl.*` system properties are set programmatically, but you could instead specify them on the java command line, as in the `post.jar` example above:
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/exporting-result-sets.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/exporting-result-sets.adoc b/solr/solr-ref-guide/src/exporting-result-sets.adoc
index 37401a5..33852fa 100644
--- a/solr/solr-ref-guide/src/exporting-result-sets.adoc
+++ b/solr/solr-ref-guide/src/exporting-result-sets.adoc
@@ -31,7 +31,7 @@ The cases where this functionality may be useful include: session analysis, dist
 All the fields being sorted and exported must have docValues set to true. For more information, see the section on <<docvalues.adoc#docvalues,DocValues>>.
 
 [[ExportingResultSets-The_exportRequestHandler]]
-== The `/export` RequestHandler
+== The /export RequestHandler
 
 The `/export` request handler with the appropriate configuration is one of Solr's out-of-the-box request handlers - see <<implicit-requesthandlers.adoc#implicit-requesthandlers,Implicit RequestHandlers>> for more information.
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/faceting.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/faceting.adoc b/solr/solr-ref-guide/src/faceting.adoc
index d61dbcf..158b2db 100644
--- a/solr/solr-ref-guide/src/faceting.adoc
+++ b/solr/solr-ref-guide/src/faceting.adoc
@@ -29,12 +29,12 @@ Searchers are presented with the indexed terms, along with numerical counts of h
 There are two general parameters for controlling faceting.
 
 [[Faceting-ThefacetParameter]]
-=== The `facet` Parameter
+=== The facet Parameter
 
 If set to *true*, this parameter enables facet counts in the query response. If set to *false*, a blank or missing value, this parameter disables faceting. None of the other parameters listed below will have any effect unless this parameter is set to *true*. The default value is blank (false).
 
 [[Faceting-Thefacet.queryParameter]]
-=== The `facet.query` Parameter
+=== The facet.query Parameter
 
 This parameter allows you to specify an arbitrary query in the Lucene default syntax to generate a facet count.
 
@@ -83,7 +83,7 @@ The table below summarizes Solr's field value faceting parameters.
 These parameters are described in the sections below.
 
 [[Faceting-Thefacet.fieldParameter]]
-=== The `facet.field` Parameter
+=== The facet.field Parameter
 
 The `facet.field` parameter identifies a field that should be treated as a facet. It iterates over each Term in the field and generate a facet count using that Term as the constraint. This parameter can be specified multiple times in a query to select multiple facet fields.
 
@@ -93,28 +93,28 @@ If you do not set this parameter to at least one field in the schema, none of th
 ====
 
 [[Faceting-Thefacet.prefixParameter]]
-=== The `facet.prefix` Parameter
+=== The facet.prefix Parameter
 
 The `facet.prefix` parameter limits the terms on which to facet to those starting with the given string prefix. This does not limit the query in any way, only the facets that would be returned in response to the query.
 
 This parameter can be specified on a per-field basis with the syntax of `f.<fieldname>.facet.prefix`.
 
 [[Faceting-Thefacet.containsParameter]]
-=== The `facet.contains` Parameter
+=== The facet.contains Parameter
 
 The `facet.contains` parameter limits the terms on which to facet to those containing the given substring. This does not limit the query in any way, only the facets that would be returned in response to the query.
 
 This parameter can be specified on a per-field basis with the syntax of `f.<fieldname>.facet.contains`.
 
 [[Faceting-Thefacet.contains.ignoreCaseParameter]]
-=== The `facet.contains.ignoreCase` Parameter
+=== The facet.contains.ignoreCase Parameter
 
 If `facet.contains` is used, the `facet.contains.ignoreCase` parameter causes case to be ignored when matching the given substring against candidate facet terms.
 
 This parameter can be specified on a per-field basis with the syntax of `f.<fieldname>.facet.contains.ignoreCase`.
 
 [[Faceting-Thefacet.sortParameter]]
-=== The `facet.sort` Parameter
+=== The facet.sort Parameter
 
 This parameter determines the ordering of the facet field constraints.
 
@@ -128,7 +128,7 @@ The default is `count` if `facet.limit` is greater than 0, otherwise, the defaul
 This parameter can be specified on a per-field basis with the syntax of `f.<fieldname>.facet.sort`.
 
 [[Faceting-Thefacet.limitParameter]]
-=== The `facet.limit` Parameter
+=== The facet.limit Parameter
 
 This parameter specifies the maximum number of constraint counts (essentially, the number of facets for a field that are returned) that should be returned for the facet fields. A negative value means that Solr will return unlimited number of constraint counts.
 
@@ -137,7 +137,7 @@ The default value is 100.
 This parameter can be specified on a per-field basis to apply a distinct limit to each field with the syntax of `f.<fieldname>.facet.limit`.
 
 [[Faceting-Thefacet.offsetParameter]]
-=== The `facet.offset` Parameter
+=== The facet.offset Parameter
 
 The `facet.offset` parameter indicates an offset into the list of constraints to allow paging.
 
@@ -146,7 +146,7 @@ The default value is 0.
 This parameter can be specified on a per-field basis with the syntax of `f.<fieldname>.facet.offset`.
 
 [[Faceting-Thefacet.mincountParameter]]
-=== The `facet.mincount` Parameter
+=== The facet.mincount Parameter
 
 The `facet.mincount` parameter specifies the minimum counts required for a facet field to be included in the response. If a field's counts are below the minimum, the field's facet is not returned.
 
@@ -155,7 +155,7 @@ The default value is 0.
 This parameter can be specified on a per-field basis with the syntax of `f.<fieldname>.facet.mincount`.
 
 [[Faceting-Thefacet.missingParameter]]
-=== The `facet.missing` Parameter
+=== The facet.missing Parameter
 
 If set to true, this parameter indicates that, in addition to the Term-based constraints of a facet field, a count of all results that match the query but which have no facet value for the field should be computed and returned in the response.
 
@@ -164,7 +164,7 @@ The default value is false.
 This parameter can be specified on a per-field basis with the syntax of `f.<fieldname>.facet.missing`.
 
 [[Faceting-Thefacet.methodParameter]]
-=== The `facet.method` Parameter
+=== The facet.method Parameter
 
 The facet.method parameter selects the type of algorithm or method Solr should use when faceting a field.
 
@@ -189,7 +189,7 @@ The default value is `fc` (except for fields using the `BoolField` field type an
 This parameter can be specified on a per-field basis with the syntax of `f.<fieldname>.facet.method`.
 
 [[Faceting-Thefacet.enum.cache.minDfParameter]]
-=== The `facet.enum.cache.minDf` Parameter
+=== The facet.enum.cache.minDf Parameter
 
 This parameter indicates the minimum document frequency (the number of documents matching a term) for which the filterCache should be used when determining the constraint count for that term. This is only used with the `facet.method=enum` method of faceting.
 
@@ -200,14 +200,14 @@ The default value is 0, causing the filterCache to be used for all terms in the
 This parameter can be specified on a per-field basis with the syntax of `f.<fieldname>.facet.enum.cache.minDf`.
 
 [[Faceting-Thefacet.existsParameter]]
-=== The `facet.exists` Parameter
+=== The facet.exists Parameter
 
 To cap facet counts by 1, specify `facet.exists=true`. It can be used with `facet.method=enum` or when it's omitted. It can be used only on non-trie fields (such as strings). It may speed up facet counting on large indices and/or high-cardinality facet values..
 
 This parameter can be specified on a per-field basis with the syntax of `f.<fieldname>.facet.exists` or via local parameter` facet.field={!facet.method=enum facet.exists=true}size`.
 
 [[Faceting-Thefacet.excludeTermsParameter]]
-=== The `facet.excludeTerms` Parameter
+=== The facet.excludeTerms Parameter
 
 If you want to remove terms from facet counts but keep them in the index, the `facet.excludeTerms` parameter allows you to do that.
 
@@ -219,7 +219,7 @@ In some situations, the accuracy in selecting the "top" constraints returned for
 In some situations, depending on how your docs are partitioned across your shards, and what `facet.limit` value you used, you may find it advantageous to increase or decrease the amount of over-requesting Solr does. This can be achieved by setting the `facet.overrequest.count` (defaults to 10) and `facet.overrequest.ratio` (defaults to 1.5) parameters.
 
 [[Faceting-Thefacet.threadsParameter]]
-=== The `facet.threads` Parameter
+=== The facet.threads Parameter
 
 This param will cause loading the underlying fields used in faceting to be executed in parallel with the number of threads specified. Specify as `facet.threads=N` where `N` is the maximum number of threads used. Omitting this parameter or specifying the thread count as 0 will not spawn any threads, and only the main request thread will be used. Specifying a negative number of threads will create up to Integer.MAX_VALUE threads.
 
@@ -244,7 +244,7 @@ You can use Range Faceting on any date field or any numeric field that supports
 |===
 
 [[Faceting-Thefacet.rangeParameter]]
-=== The `facet.range` Parameter
+=== The facet.range Parameter
 
 The `facet.range` parameter defines the field for which Solr should create range facets. For example:
 
@@ -253,7 +253,7 @@ The `facet.range` parameter defines the field for which Solr should create range
 `facet.range=lastModified_dt`
 
 [[Faceting-Thefacet.range.startParameter]]
-=== The `facet.range.start` Parameter
+=== The facet.range.start Parameter
 
 The `facet.range.start` parameter specifies the lower bound of the ranges. You can specify this parameter on a per field basis with the syntax of `f.<fieldname>.facet.range.start`. For example:
 
@@ -262,7 +262,7 @@ The `facet.range.start` parameter specifies the lower bound of the ranges. You c
 `f.lastModified_dt.facet.range.start=NOW/DAY-30DAYS`
 
 [[Faceting-Thefacet.range.endParameter]]
-=== The `facet.range.end` Parameter
+=== The facet.range.end Parameter
 
 The facet.range.end specifies the upper bound of the ranges. You can specify this parameter on a per field basis with the syntax of `f.<fieldname>.facet.range.end`. For example:
 
@@ -271,7 +271,7 @@ The facet.range.end specifies the upper bound of the ranges. You can specify thi
 `f.lastModified_dt.facet.range.end=NOW/DAY+30DAYS`
 
 [[Faceting-Thefacet.range.gapParameter]]
-=== The `facet.range.gap` Parameter
+=== The facet.range.gap Parameter
 
 The span of each range expressed as a value to be added to the lower bound. For date fields, this should be expressed using the {solr-javadocs}/solr-core/org/apache/solr/util/DateMathParser.html[`DateMathParser` syntax] (such as, `facet.range.gap=%2B1DAY ... '+1DAY'`). You can specify this parameter on a per-field basis with the syntax of `f.<fieldname>.facet.range.gap`. For example:
 
@@ -280,7 +280,7 @@ The span of each range expressed as a value to be added to the lower bound. For
 `f.lastModified_dt.facet.range.gap=+1DAY`
 
 [[Faceting-Thefacet.range.hardendParameter]]
-=== The `facet.range.hardend` Parameter
+=== The facet.range.hardend Parameter
 
 The `facet.range.hardend` parameter is a Boolean parameter that specifies how Solr should handle cases where the `facet.range.gap` does not divide evenly between `facet.range.start` and `facet.range.end`.
 
@@ -289,7 +289,7 @@ If *true*, the last range constraint will have the `facet.range.end` value as an
 This parameter can be specified on a per field basis with the syntax `f.<fieldname>.facet.range.hardend`.
 
 [[Faceting-Thefacet.range.includeParameter]]
-=== The `facet.range.include` Parameter
+=== The facet.range.include Parameter
 
 By default, the ranges used to compute range faceting between `facet.range.start` and `facet.range.end` are inclusive of their lower bounds and exclusive of the upper bounds. The "before" range defined with the `facet.range.other` parameter is exclusive and the "after" range is inclusive. This default, equivalent to "lower" below, will not result in double counting at the boundaries. You can use the `facet.range.include` parameter to modify this behavior using the following options:
 
@@ -313,7 +313,7 @@ To ensure you avoid double-counting, do not choose both `lower` and `upper`, do
 ====
 
 [[Faceting-Thefacet.range.otherParameter]]
-=== The `facet.range.other` Parameter
+=== The facet.range.other Parameter
 
 The `facet.range.other` parameter specifies that in addition to the counts for each range constraint between `facet.range.start` and `facet.range.end`, counts should also be computed for these options:
 
@@ -332,7 +332,7 @@ The `facet.range.other` parameter specifies that in addition to the counts for e
 This parameter can be specified on a per field basis with the syntax of `f.<fieldname>.facet.range.other`. In addition to the `all` option, this parameter can be specified multiple times to indicate multiple choices, but `none` will override all other options.
 
 [[Faceting-Thefacet.range.methodParameter]]
-=== The `facet.range.method` Parameter
+=== The facet.range.method Parameter
 
 The `facet.range.method` parameter selects the type of algorithm or method Solr should use for range faceting. Both methods produce the same results, but performance may vary.
 
@@ -343,7 +343,7 @@ dv:: This method iterates the documents that match the main query, and for each
 Default value for this parameter is "filter".
 
 [[Faceting-Thefacet.mincountParameterinRangeFaceting]]
-=== The `facet.mincount` Parameter in Range Faceting
+=== The facet.mincount Parameter in Range Faceting
 
 The `facet.mincount` parameter, the same one as used in field faceting is also applied to range faceting. When used, no ranges with a count below the minimum will be included in the response.
 
@@ -653,14 +653,14 @@ If you are concerned about the performance of your searches you should test with
 This method will use <<docvalues.adoc#docvalues,docValues>> if they are enabled for the field, will use fieldCache otherwise.
 
 [[Faceting-Thefacet.intervalparameter]]
-=== The `facet.interval` parameter
+=== The facet.interval parameter
 
 This parameter Indicates the field where interval faceting must be applied. It can be used multiple times in the same request to indicate multiple fields.
 
 `facet.interval=price&facet.interval=size`
 
 [[Faceting-Thefacet.interval.setparameter]]
-=== The `facet.interval.set` parameter
+=== The facet.interval.set parameter
 
 This parameter is used to set the intervals for the field, it can be specified multiple times to indicate multiple intervals. This parameter is global, which means that it will be used for all fields indicated with `facet.interval` unless there is an override for a specific field. To override this parameter on a specific field you can use: `f.<fieldname>.facet.interval.set`, for example:
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/field-type-definitions-and-properties.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/field-type-definitions-and-properties.adoc b/solr/solr-ref-guide/src/field-type-definitions-and-properties.adoc
index 92b32a3..12d2913 100644
--- a/solr/solr-ref-guide/src/field-type-definitions-and-properties.adoc
+++ b/solr/solr-ref-guide/src/field-type-definitions-and-properties.adoc
@@ -28,7 +28,7 @@ A field type definition can include four types of information:
 * Field type properties - depending on the implementation class, some properties may be mandatory.
 
 [[FieldTypeDefinitionsandProperties-FieldTypeDefinitionsinschema.xml]]
-== Field Type Definitions in `schema.xml`
+== Field Type Definitions in schema.xml
 
 Field types are defined in `schema.xml`. Each field type is defined between `fieldType` elements. They can optionally be grouped within a `types` element. Here is an example of a field type definition for a type called `text_general`:
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/highlighting.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/highlighting.adoc b/solr/solr-ref-guide/src/highlighting.adoc
index 77fae07..117ccbc 100644
--- a/solr/solr-ref-guide/src/highlighting.adoc
+++ b/solr/solr-ref-guide/src/highlighting.adoc
@@ -251,7 +251,7 @@ The FastVector Highlighter will occasionally truncate highlighted words. To prev
 Solr supports two boundary scanners: `breakIterator` and `simple`.
 
 [[Highlighting-ThebreakIteratorBoundaryScanner]]
-==== The `breakIterator` Boundary Scanner
+==== The breakIterator Boundary Scanner
 
 The `breakIterator` boundary scanner offers excellent performance right out of the box by taking locale and boundary type into account. In most cases you will want to use the `breakIterator` boundary scanner. To implement the `breakIterator` boundary scanner, add this code to the `highlighting` section of your `solrconfig.xml` file, adjusting the type, language, and country values as appropriate to your application:
 
@@ -269,7 +269,7 @@ The `breakIterator` boundary scanner offers excellent performance right out of t
 Possible values for the `hl.bs.type` parameter are WORD, LINE, SENTENCE, and CHARACTER.
 
 [[Highlighting-ThesimpleBoundaryScanner]]
-==== The `simple` Boundary Scanner
+==== The simple Boundary Scanner
 
 The `simple` boundary scanner scans term boundaries for a specified maximum character value (`hl.bs.maxScan`) and for common delimiters such as punctuation marks (`hl.bs.chars`). The `simple` boundary scanner may be useful for some custom To implement the `simple` boundary scanner, add this code to the `highlighting` section of your `solrconfig.xml` file, adjusting the values as appropriate to your application:
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/index-replication.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/index-replication.adoc b/solr/solr-ref-guide/src/index-replication.adoc
index 90fa470..df8e9c6 100644
--- a/solr/solr-ref-guide/src/index-replication.adoc
+++ b/solr/solr-ref-guide/src/index-replication.adoc
@@ -111,7 +111,7 @@ The example below shows a possible 'master' configuration for the `ReplicationHa
 ----
 
 [[IndexReplication-Replicatingsolrconfig.xml]]
-==== Replicating `solrconfig.xml`
+==== Replicating solrconfig.xml
 
 In the configuration file on the master server, include a line like the following:
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/indexconfig-in-solrconfig.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/indexconfig-in-solrconfig.adoc b/solr/solr-ref-guide/src/indexconfig-in-solrconfig.adoc
index 74d5f97..cfc1a78 100644
--- a/solr/solr-ref-guide/src/indexconfig-in-solrconfig.adoc
+++ b/solr/solr-ref-guide/src/indexconfig-in-solrconfig.adoc
@@ -33,7 +33,7 @@ By default, the settings are commented out in the sample `solrconfig.xml` includ
 == Writing New Segments
 
 [[IndexConfiginSolrConfig-ramBufferSizeMB]]
-=== `ramBufferSizeMB`
+=== ramBufferSizeMB
 
 Once accumulated document updates exceed this much memory space (defined in megabytes), then the pending updates are flushed. This can also create new segments or trigger a merge. Using this setting is generally preferable to `maxBufferedDocs`. If both `maxBufferedDocs` and `ramBufferSizeMB` are set in `solrconfig.xml`, then a flush will occur when either limit is reached. The default is 100Mb.
 
@@ -43,7 +43,7 @@ Once accumulated document updates exceed this much memory space (defined in mega
 ----
 
 [[IndexConfiginSolrConfig-maxBufferedDocs]]
-=== `maxBufferedDocs`
+=== maxBufferedDocs
 
 Sets the number of document updates to buffer in memory before they are flushed as a new segment. This may also trigger a merge. The default Solr configuration sets to flush by RAM usage (`ramBufferSizeMB`).
 
@@ -66,7 +66,7 @@ Controls whether newly written (and not yet merged) index segments should use th
 == Merging Index Segments
 
 [[IndexConfiginSolrConfig-mergePolicyFactory]]
-=== `mergePolicyFactory`
+=== mergePolicyFactory
 
 Defines how merging segments is done.
 
@@ -118,7 +118,7 @@ If the configuration options for the built-in merge policies do not fully suit y
 The example above shows Solr's {solr-javadocs}/solr-core/org/apache/solr/index/SortingMergePolicyFactory.html[`SortingMergePolicyFactory`] being configured to sort documents in merged segments by `"timestamp desc"`, and wrapped around a `TieredMergePolicyFactory` configured to use the values `maxMergeAtOnce=10` and `segmentsPerTier=10` via the `inner` prefix defined by `SortingMergePolicyFactory`'s `wrapped.prefix` option. For more information on using `SortingMergePolicyFactory`, see <<common-query-parameters.adoc#CommonQueryParameters-ThesegmentTerminateEarlyParameter,the segmentTerminateEarly parameter>>.
 
 [[IndexConfiginSolrConfig-mergeScheduler]]
-=== `mergeScheduler`
+=== mergeScheduler
 
 The merge scheduler controls how merges are performed. The default `ConcurrentMergeScheduler` performs merges in the background using separate threads. The alternative, `SerialMergeScheduler`, does not perform merges with separate threads.
 
@@ -128,7 +128,7 @@ The merge scheduler controls how merges are performed. The default `ConcurrentMe
 ----
 
 [[IndexConfiginSolrConfig-mergedSegmentWarmer]]
-=== `mergedSegmentWarmer`
+=== mergedSegmentWarmer
 
 When using Solr in for <<near-real-time-searching.adoc#near-real-time-searching,Near Real Time Searching>> a merged segment warmer can be configured to warm the reader on the newly merged segment, before the merge commits. This is not required for near real-time search, but will reduce search latency on opening a new near real-time reader after a merge completes.
 
@@ -159,7 +159,7 @@ Many <<IndexConfiginSolrConfig-MergingIndexSegments,Merge Policy>> implementatio
 == Index Locks
 
 [[IndexConfiginSolrConfig-lockType]]
-=== `lockType`
+=== lockType
 
 The LockFactory options specify the locking implementation to use.
 
@@ -178,7 +178,7 @@ For more information on the nuances of each LockFactory, see http://wiki.apache.
 ----
 
 [[IndexConfiginSolrConfig-writeLockTimeout]]
-=== `writeLockTimeout`
+=== writeLockTimeout
 
 The maximum time to wait for a write lock on an IndexWriter. The default is 1000, expressed in milliseconds.
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/introduction-to-solr-indexing.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/introduction-to-solr-indexing.adoc b/solr/solr-ref-guide/src/introduction-to-solr-indexing.adoc
index 2412f01..888d8db 100644
--- a/solr/solr-ref-guide/src/introduction-to-solr-indexing.adoc
+++ b/solr/solr-ref-guide/src/introduction-to-solr-indexing.adoc
@@ -44,7 +44,7 @@ For more information on indexing in Solr, see the https://wiki.apache.org/solr/F
 When starting Solr with the "-e" option, the `example/` directory will be used as base directory for the example Solr instances that are created. This directory also includes an `example/exampledocs/` subdirectory containing sample documents in a variety of formats that you can use to experiment with indexing into the various examples.
 
 [[IntroductiontoSolrIndexing-ThecurlUtilityforTransferringFiles]]
-== The `curl` Utility for Transferring Files
+== The curl Utility for Transferring Files
 
 Many of the instructions and examples in this section make use of the `curl` utility for transferring content through a URL. `curl` posts and retrieves data over HTTP, FTP, and many other protocols. Most Linux distributions include a copy of `curl`. You'll find curl downloads for Linux, Windows, and many other operating systems at http://curl.haxx.se/download.html. Documentation for `curl` is available here: http://curl.haxx.se/docs/manpage.html.
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/local-parameters-in-queries.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/local-parameters-in-queries.adoc b/solr/solr-ref-guide/src/local-parameters-in-queries.adoc
index 4618ec3..1ed8eea 100644
--- a/solr/solr-ref-guide/src/local-parameters-in-queries.adoc
+++ b/solr/solr-ref-guide/src/local-parameters-in-queries.adoc
@@ -64,7 +64,7 @@ is equivilent to:
 
 `fq={!type=lucene df=summary}solr rocks`
 
-== Specifying the Parameter Value with the `v` Key
+== Specifying the Parameter Value with the v Key
 
 A special key of `v` within local parameters is an alternate way to specify the value of that parameter.
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/major-changes-from-solr-5-to-solr-6.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/major-changes-from-solr-5-to-solr-6.adoc b/solr/solr-ref-guide/src/major-changes-from-solr-5-to-solr-6.adoc
index 7c2f7d6..9b58cef 100644
--- a/solr/solr-ref-guide/src/major-changes-from-solr-5-to-solr-6.adoc
+++ b/solr/solr-ref-guide/src/major-changes-from-solr-5-to-solr-6.adoc
@@ -84,6 +84,6 @@ Regardless of whether it is explicitly declared, or used as an implicit global d
 
 DELETESHARD and DELETEREPLICA now default to deleting the instance directory, data directory, and index directory for any replica they delete. Please review the <<collections-api.adoc#collections-api,Collection API>> documentation for details on new request parameters to prevent this behavior if you wish to keep all data on disk when using these commands
 
-== `facet.date.*` Parameters Removed
+== facet.date.* Parameters Removed
 
 The `facet.date` parameter (and associated `facet.date.*` parameters) that were deprecated in Solr 3.x have been removed completely. If you have not yet switched to using the equivalent <<faceting.adoc#faceting,`facet.range`>> functionality you must do so now before upgrading.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/merging-indexes.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/merging-indexes.adoc b/solr/solr-ref-guide/src/merging-indexes.adoc
index e57e3ab..49afe4e 100644
--- a/solr/solr-ref-guide/src/merging-indexes.adoc
+++ b/solr/solr-ref-guide/src/merging-indexes.adoc
@@ -28,7 +28,7 @@ To merge indexes, they must meet these requirements:
 Optimally, the two indexes should be built using the same schema.
 
 [[MergingIndexes-UsingIndexMergeTool]]
-== Using `IndexMergeTool`
+== Using IndexMergeTool
 
 To merge the indexes, do the following:
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/near-real-time-searching.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/near-real-time-searching.adoc b/solr/solr-ref-guide/src/near-real-time-searching.adoc
index 641208e..8d87d54 100644
--- a/solr/solr-ref-guide/src/near-real-time-searching.adoc
+++ b/solr/solr-ref-guide/src/near-real-time-searching.adoc
@@ -31,7 +31,7 @@ However, pay special attention to cache and autowarm settings as they can have a
 
 A commit operation makes index changes visible to new search requests. A *hard commit* uses the transaction log to get the id of the latest document changes, and also calls `fsync` on the index files to ensure they have been flushed to stable storage and no data loss will result from a power failure. The current transaction log is closed and a new one is opened. See the "transaction log" discussion below for data loss issues.
 
-A *soft commit* is much faster since it only makes index changes visible and does not `fsync` index files, or write a new index descriptor or start a new transaction log. Search collections that have NRT requirements (that want index changes to be quickly visible to searches) will want to soft commit often but hard commit less frequently. A softCommit may be "less expensive", but it is not free, since it can slow throughput. See the "transaction log" discussion below for data loss issues. 
+A *soft commit* is much faster since it only makes index changes visible and does not `fsync` index files, or write a new index descriptor or start a new transaction log. Search collections that have NRT requirements (that want index changes to be quickly visible to searches) will want to soft commit often but hard commit less frequently. A softCommit may be "less expensive", but it is not free, since it can slow throughput. See the "transaction log" discussion below for data loss issues.
 
 An *optimize* is like a *hard commit* except that it forces all of the index segments to be merged into a single segment first. Depending on the use, this operation should be performed infrequently (e.g., nightly), if at all, since it involves reading and re-writing the entire index. Segments are normally merged over time anyway (as determined by the merge policy), and optimize just forces these merges to occur immediately.
 
@@ -52,7 +52,7 @@ Use `maxDocs` and `maxTime` judiciously to fine-tune your commit strategies.
 === Transaction Logs (tlogs)
 
 Transaction logs are a "rolling window" of at least the last `N` (default 100) documents indexed. Tlogs are configured in solrconfig.xml, including the value of `N`. The current transaction log is closed and a new one opened each time any variety of hard commit occurs. Soft commits have no effect on the transaction log.
-  
+
 When tlogs are enabled, documents being added to the index are written to the tlog before the indexing call returns to the client. In the event of an un-graceful shutdown (power loss, JVM crash, `kill -9` etc) any documents written to the tlog that was open when Solr stopped are replayed on startup.
 
 When Solr is shut down gracefully (i.e. using the `bin/solr stop` command and the like) Solr will close the tlog file and index segments so no replay will be necessary on startup.
@@ -76,7 +76,7 @@ For example:
 It's better to use `maxTime` rather than `maxDocs` to modify an `autoSoftCommit`, especially when indexing a large number of documents through the commit operation. It's also better to turn off `autoSoftCommit` for bulk indexing.
 
 [[NearRealTimeSearching-OptionalAttributesforcommitandoptimize]]
-=== Optional Attributes for `commit` and `optimize`
+=== Optional Attributes for commit and optimize
 
 // TODO: Change column width to %autowidth.spread when https://github.com/asciidoctor/asciidoctor-pdf/issues/599 is fixed
 
@@ -100,7 +100,7 @@ Example of `commit` and `optimize` with optional attributes:
 ----
 
 [[NearRealTimeSearching-PassingcommitandcommitWithinparametersaspartoftheURL]]
-=== Passing `commit` and `commitWithin` Parameters as Part of the URL
+=== Passing commit and commitWithin Parameters as Part of the URL
 
 Update handlers can also get `commit`-related parameters as part of the update URL. This example adds a small test document and causes an explicit commit to happen immediately afterwards:
 
@@ -133,7 +133,7 @@ curl http://localhost:8983/solr/my_collection/update?commitWithin=10000
 ----
 
 [[NearRealTimeSearching-ChangingdefaultcommitWithinBehavior]]
-=== Changing default `commitWithin` Behavior
+=== Changing default commitWithin Behavior
 
 The `commitWithin` settings allow forcing document commits to happen in a defined time period. This is used most frequently with <<near-real-time-searching.adoc#near-real-time-searching,Near Real Time Searching>>, and for that reason the default is to perform a soft commit. This does not, however, replicate new documents to slave servers in a master/slave environment. If that's a requirement for your implementation, you can force a hard commit by adding a parameter, as in this example:
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/parallel-sql-interface.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/parallel-sql-interface.adoc b/solr/solr-ref-guide/src/parallel-sql-interface.adoc
index 5dccfce..57cea47 100644
--- a/solr/solr-ref-guide/src/parallel-sql-interface.adoc
+++ b/solr/solr-ref-guide/src/parallel-sql-interface.adoc
@@ -180,7 +180,7 @@ SELECT fieldA as fa, fieldB as fb, fieldC as fc FROM tableA WHERE fieldC = 'term
 
 We've covered many syntax options with this example, so let's walk through what's possible below.
 
-=== `WHERE` Clause and Boolean Predicates
+=== WHERE Clause and Boolean Predicates
 
 [IMPORTANT]
 ====
@@ -226,7 +226,7 @@ To specify NOT queries, you use the `AND NOT` syntax as follows:
 WHERE (fieldA = 'term1') AND NOT (fieldB = 'term2')
 ----
 
-==== Supported `WHERE` Operators
+==== Supported WHERE Operators
 
 The parallel SQL interface supports and pushes down most common SQL operators, specifically:
 
@@ -247,7 +247,7 @@ Some operators that are not supported are BETWEEN, LIKE and IN. However, there a
 * BETWEEN can be supported with a range query, such as `field = [50 TO 100]`.
 * A simplistic LIKE can be used with a wildcard, such as `field = 'sam*'`.
 
-=== `ORDER BY` Clause
+=== ORDER BY Clause
 
 The `ORDER BY` clause maps directly to Solr fields. Multiple `ORDER BY` fields and directions are supported.
 
@@ -257,7 +257,7 @@ If the `ORDER BY` clause contains the exact fields in the `GROUP BY` clause, the
 
 Order by fields are case sensitive.
 
-=== `LIMIT` Clause
+=== LIMIT Clause
 
 Limits the result set to the specified size. In the example above the clause `LIMIT 100` will limit the result set to 100 records.
 
@@ -267,7 +267,7 @@ There are a few differences to note between limited and unlimited queries:
 * Limited queries allow any stored field in the field list. Unlimited queries require the fields to be stored as a DocValues field.
 * Limited queries allow any indexed field in the `ORDER BY` list. Unlimited queries require the fields to be stored as a DocValues field.
 
-=== `SELECT DISTINCT` Queries
+=== SELECT DISTINCT Queries
 
 The SQL interface supports both MapReduce and Facet implementations for `SELECT DISTINCT` queries.
 
@@ -293,13 +293,13 @@ Because these functions never require data to be shuffled, the aggregations are
 SELECT count(*) as count, sum(fieldB) as sum FROM tableA WHERE fieldC = 'Hello'
 ----
 
-=== `GROUP BY` Aggregations
+=== GROUP BY Aggregations
 
 The SQL interface also supports `GROUP BY` aggregate queries.
 
 As with `SELECT DISTINCT` queries, the SQL interface supports both a MapReduce implementation and a Facet implementation. The MapReduce implementation can build aggregations over extremely high cardinality fields. The Facet implementations provides high performance aggregation over fields with moderate levels of cardinality.
 
-==== Basic `GROUP BY` with Aggregates
+==== Basic GROUP BY with Aggregates
 
 Here is a basic example of a GROUP BY query that requests aggregations:
 
@@ -327,7 +327,7 @@ The non-function fields in the field list determine the fields to calculate the
 
 The `GROUP BY` clause can contain up to 4 fields in the Solr index. These fields should correspond with the non-function fields in the field list.
 
-=== `HAVING` Clause
+=== HAVING Clause
 
 The `HAVING` clause may contain any function listed in the field list. Complex `HAVING` clauses such as this are supported:
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/query-settings-in-solrconfig.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/query-settings-in-solrconfig.adoc b/solr/solr-ref-guide/src/query-settings-in-solrconfig.adoc
index f380110..1a6b315 100644
--- a/solr/solr-ref-guide/src/query-settings-in-solrconfig.adoc
+++ b/solr/solr-ref-guide/src/query-settings-in-solrconfig.adoc
@@ -55,7 +55,7 @@ FastLRUCache and LFUCache support `showItems` attribute. This is the number of c
 Details of each cache are described below.
 
 [[QuerySettingsinSolrConfig-filterCache]]
-=== `filterCache`
+=== filterCache
 
 This cache is used by `SolrIndexSearcher` for filters (DocSets) for unordered sets of all documents that match a query. The numeric attributes control the number of entries in the cache.
 
@@ -72,7 +72,7 @@ Solr also uses this cache for faceting when the configuration parameter `facet.m
 ----
 
 [[QuerySettingsinSolrConfig-queryResultCache]]
-=== `queryResultCache`
+=== queryResultCache
 
 This cache holds the results of previous searches: ordered lists of document IDs (DocList) based on a query, a sort, and the range of documents requested.
 
@@ -88,7 +88,7 @@ The `queryResultCache` has an additional (optional) setting to limit the maximum
 ----
 
 [[QuerySettingsinSolrConfig-documentCache]]
-=== `documentCache`
+=== documentCache
 
 This cache holds Lucene Document objects (the stored fields for each document). Since Lucene internal document IDs are transient, this cache is not auto-warmed. The size for the `documentCache` should always be greater than `max_results` times the `max_concurrent_queries`, to ensure that Solr does not need to refetch a document during a request. The more fields you store in your documents, the higher the memory usage of this cache will be.
 
@@ -120,7 +120,7 @@ If you want auto-warming of your cache, include a `regenerator` attribute with t
 == Query Sizing and Warming
 
 [[QuerySettingsinSolrConfig-maxBooleanClauses]]
-=== `maxBooleanClauses`
+=== maxBooleanClauses
 
 This sets the maximum number of clauses allowed in a boolean query. This can affect range or prefix queries that expand to a query with a large number of boolean terms. If this limit is exceeded, an exception is thrown.
 
@@ -135,7 +135,7 @@ This option modifies a global property that effects all Solr cores. If multiple
 ====
 
 [[QuerySettingsinSolrConfig-enableLazyFieldLoading]]
-=== `enableLazyFieldLoading`
+=== enableLazyFieldLoading
 
 If this parameter is set to true, then fields that are not directly requested will be loaded lazily as needed. This can boost performance if the most common queries only need a small subset of fields, especially if infrequently accessed fields are large in size.
 
@@ -145,7 +145,7 @@ If this parameter is set to true, then fields that are not directly requested wi
 ----
 
 [[QuerySettingsinSolrConfig-useFilterForSortedQuery]]
-=== `useFilterForSortedQuery`
+=== useFilterForSortedQuery
 
 This parameter configures Solr to use a filter to satisfy a search. If the requested sort does not include "score", the `filterCache` will be checked for a filter matching the query. For most situations, this is only useful if the same search is requested often with different sort options and none of them ever use "score".
 
@@ -155,7 +155,7 @@ This parameter configures Solr to use a filter to satisfy a search. If the reque
 ----
 
 [[QuerySettingsinSolrConfig-queryResultWindowSize]]
-=== `queryResultWindowSize`
+=== queryResultWindowSize
 
 Used with the `queryResultCache`, this will cache a superset of the requested number of document IDs. For example, if the a search in response to a particular query requests documents 10 through 19, and `queryWindowSize` is 50, documents 0 through 49 will be cached.
 
@@ -165,7 +165,7 @@ Used with the `queryResultCache`, this will cache a superset of the requested nu
 ----
 
 [[QuerySettingsinSolrConfig-queryResultMaxDocsCached]]
-=== `queryResultMaxDocsCached`
+=== queryResultMaxDocsCached
 
 This parameter sets the maximum number of documents to cache for any entry in the `queryResultCache`.
 
@@ -175,7 +175,7 @@ This parameter sets the maximum number of documents to cache for any entry in th
 ----
 
 [[QuerySettingsinSolrConfig-useColdSearcher]]
-=== `useColdSearcher`
+=== useColdSearcher
 
 This setting controls whether search requests for which there is not a currently registered searcher should wait for a new searcher to warm up (false) or proceed immediately (true). When set to "false", requests will block until the searcher has warmed its caches.
 
@@ -185,7 +185,7 @@ This setting controls whether search requests for which there is not a currently
 ----
 
 [[QuerySettingsinSolrConfig-maxWarmingSearchers]]
-=== `maxWarmingSearchers`
+=== maxWarmingSearchers
 
 This parameter sets the maximum number of searchers that may be warming up in the background at any given time. Exceeding this limit will raise an error. For read-only slaves, a value of two is reasonable. Masters should probably be set a little higher.
 
@@ -227,7 +227,7 @@ The (commented out) examples below can be found in the `solrconfig.xml` file of
 ====
 The above code comes from a _sample_ `solrconfig.xml`.
 
-A key best practice is to modify these defaults before taking your application to production, but please note: while the sample queries are commented out in the section for the "newSearcher", the sample query is not commented out for the "firstSearcher" event. 
+A key best practice is to modify these defaults before taking your application to production, but please note: while the sample queries are commented out in the section for the "newSearcher", the sample query is not commented out for the "firstSearcher" event.
 
 There is no point in auto-warming your Index Searcher with the query string "static firstSearcher warming in solrconfig.xml" if that is not relevant to your search application.
 ====

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/read-and-write-side-fault-tolerance.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/read-and-write-side-fault-tolerance.adoc b/solr/solr-ref-guide/src/read-and-write-side-fault-tolerance.adoc
index 07ebd16..947c760 100644
--- a/solr/solr-ref-guide/src/read-and-write-side-fault-tolerance.adoc
+++ b/solr/solr-ref-guide/src/read-and-write-side-fault-tolerance.adoc
@@ -30,7 +30,7 @@ In a SolrCloud cluster each individual node load balances read requests across a
 Even if some nodes in the cluster are offline or unreachable, a Solr node will be able to correctly respond to a search request as long as it can communicate with at least one replica of every shard, or one replica of every _relevant_ shard if the user limited the search via the `shards` or `\_route_` parameters. The more replicas there are of every shard, the more likely that the Solr cluster will be able to handle search results in the event of node failures.
 
 [[ReadandWriteSideFaultTolerance-zkConnected]]
-=== `zkConnected`
+=== zkConnected
 
 A Solr node will return the results of a search request as long as it can communicate with at least one replica of every shard that it knows about, even if it can _not_ communicate with ZooKeeper at the time it receives the request. This is normally the preferred behavior from a fault tolerance standpoint, but may result in stale or incorrect results if there have been major changes to the collection structure that the node has not been informed of via ZooKeeper (i.e., shards may have been added or removed, or split into sub-shards)
 
@@ -57,7 +57,7 @@ A `zkConnected` header is included in every search response indicating if the no
 ----
 
 [[ReadandWriteSideFaultTolerance-shards.tolerant]]
-=== `shards.tolerant`
+=== shards.tolerant
 
 In the event that one or more shards queried are completely unavailable, then Solr's default behavior is to fail the request. However, there are many use-cases where partial results are acceptable and so Solr provides a boolean `shards.tolerant` parameter (default `false`).
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/request-parameters-api.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/request-parameters-api.adoc b/solr/solr-ref-guide/src/request-parameters-api.adoc
index 0c53e98..45275d0 100644
--- a/solr/solr-ref-guide/src/request-parameters-api.adoc
+++ b/solr/solr-ref-guide/src/request-parameters-api.adoc
@@ -148,7 +148,7 @@ curl http://localhost:8983/solr/techproducts/config/params/myQueries
 ----
 
 [[RequestParametersAPI-TheuseParamsParameter]]
-== The `useParams` Parameter
+== The useParams Parameter
 
 When making a request, the `useParams` parameter applies the request parameters sent to the request. This is translated at request time to the actual parameters.
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/requestdispatcher-in-solrconfig.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/requestdispatcher-in-solrconfig.adoc b/solr/solr-ref-guide/src/requestdispatcher-in-solrconfig.adoc
index 3243f4a..2883f9a 100644
--- a/solr/solr-ref-guide/src/requestdispatcher-in-solrconfig.adoc
+++ b/solr/solr-ref-guide/src/requestdispatcher-in-solrconfig.adoc
@@ -23,7 +23,7 @@ The `requestDispatcher` element of `solrconfig.xml` controls the way the Solr HT
 Included are parameters for defining if it should handle `/select` urls (for Solr 1.1 compatibility), if it will support remote streaming, the maximum size of file uploads and how it will respond to HTTP cache headers in requests.
 
 [[RequestDispatcherinSolrConfig-handleSelectElement]]
-== `handleSelect` Element
+== handleSelect Element
 
 [IMPORTANT]
 ====
@@ -42,7 +42,7 @@ In recent versions of Solr, a `/select` requestHandler is defined by default, so
 ----
 
 [[RequestDispatcherinSolrConfig-requestParsersElement]]
-== `requestParsers` Element
+== requestParsers Element
 
 The `<requestParsers>` sub-element controls values related to parsing requests. This is an empty XML element that doesn't have any content, only attributes.
 
@@ -65,7 +65,7 @@ The attribute `addHttpRequestToContext` can be used to indicate that the origina
 ----
 
 [[RequestDispatcherinSolrConfig-httpCachingElement]]
-== `httpCaching` Element
+== httpCaching Element
 
 The `<httpCaching>` element controls HTTP cache control headers. Do not confuse these settings with Solr's internal cache configuration. This element controls caching of HTTP responses as defined by the W3C HTTP specifications.
 
@@ -91,7 +91,7 @@ This element allows for three attributes and one sub-element. The attributes of
 ----
 
 [[RequestDispatcherinSolrConfig-cacheControlElement]]
-=== `cacheControl` Element
+=== cacheControl Element
 
 In addition to these attributes, `<httpCaching>` accepts one child element: `<cacheControl>`. The content of this element will be sent as the value of the Cache-Control header on HTTP responses. This header is used to modify the default caching behavior of the requesting client. The possible values for the Cache-Control header are defined by the HTTP 1.1 specification in http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9[Section 14.9].
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/response-writers.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/response-writers.adoc b/solr/solr-ref-guide/src/response-writers.adoc
index 2cb03ee..8d11370 100644
--- a/solr/solr-ref-guide/src/response-writers.adoc
+++ b/solr/solr-ref-guide/src/response-writers.adoc
@@ -51,7 +51,7 @@ Note that the XSLT Response Writer can be used to convert the XML produced by th
 The behavior of the XML Response Writer can be driven by the following query parameters.
 
 [[ResponseWriters-TheversionParameter]]
-=== The `version` Parameter
+=== The version Parameter
 
 The `version` parameter determines the XML protocol used in the response. Clients are strongly encouraged to _always_ specify the protocol version, so as to ensure that the format of the response they receive does not change unexpectedly if the Solr server is upgraded and a new default format is introduced.
 
@@ -66,7 +66,7 @@ Currently supported version values are:
 The default value is the latest supported.
 
 [[ResponseWriters-ThestylesheetParameter]]
-=== The `stylesheet` Parameter
+=== The stylesheet Parameter
 
 The `stylesheet` parameter can be used to direct Solr to include a `<?xml-stylesheet type="text/xsl" href="..."?>` declaration in the XML response it returns.
 
@@ -78,7 +78,7 @@ Use of the `stylesheet` parameter is discouraged, as there is currently no way t
 ====
 
 [[ResponseWriters-TheindentParameter]]
-=== The `indent` Parameter
+=== The indent Parameter
 
 If the `indent` parameter is used, and has a non-blank value, then Solr will make some attempts at indenting its XML response to make it more readable by humans.
 
@@ -90,7 +90,7 @@ The default behavior is not to indent.
 The XSLT Response Writer applies an XML stylesheet to output. It can be used for tasks such as formatting results for an RSS feed.
 
 [[ResponseWriters-trParameter]]
-=== `tr` Parameter
+=== tr Parameter
 
 The XSLT Response Writer accepts one parameter: the `tr` parameter, which identifies the XML transformation to use. The transformation must be found in the Solr `conf/xslt` directory.
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/schema-factory-definition-in-solrconfig.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/schema-factory-definition-in-solrconfig.adoc b/solr/solr-ref-guide/src/schema-factory-definition-in-solrconfig.adoc
index 4254e61..9d0e60d 100644
--- a/solr/solr-ref-guide/src/schema-factory-definition-in-solrconfig.adoc
+++ b/solr/solr-ref-guide/src/schema-factory-definition-in-solrconfig.adoc
@@ -55,7 +55,7 @@ If you wish to explicitly configure `ManagedIndexSchemaFactory` the following op
 With the default configuration shown above, you can use the <<schema-api.adoc#schema-api,Schema API>> to modify the schema as much as you want, and then later change the value of `mutable` to *false* if you wish to "lock" the schema in place and prevent future changes.
 
 [[SchemaFactoryDefinitioninSolrConfig-Classicschema.xml]]
-== Classic `schema.xml`
+== Classic schema.xml
 
 An alternative to using a managed schema is to explicitly configure a `ClassicIndexSchemaFactory`. `ClassicIndexSchemaFactory` requires the use of a `schema.xml` configuration file, and disallows any programatic changes to the Schema at run time. The `schema.xml` file must be edited manually and is only loaded only when the collection is loaded.
 
@@ -65,7 +65,7 @@ An alternative to using a managed schema is to explicitly configure a `ClassicIn
 ----
 
 [[SchemaFactoryDefinitioninSolrConfig-Switchingfromschema.xmltoManagedSchema]]
-=== Switching from `schema.xml` to Managed Schema
+=== Switching from schema.xml to Managed Schema
 
 If you have an existing Solr collection that uses `ClassicIndexSchemaFactory`, and you wish to convert to use a managed schema, you can simply modify the `solrconfig.xml` to specify the use of the `ManagedIndexSchemaFactory`.
 
@@ -79,7 +79,7 @@ Once Solr is restarted and it detects that a `schema.xml` file exists, but the `
 You are now free to use the <<schema-api.adoc#schema-api,Schema API>> as much as you want to make changes, and remove the `schema.xml.bak`.
 
 [[SchemaFactoryDefinitioninSolrConfig-SwitchingfromManagedSchematoManuallyEditedschema.xml]]
-=== Switching from Managed Schema to Manually Edited `schema.xml`
+=== Switching from Managed Schema to Manually Edited schema.xml
 
 If you have started Solr with managed schema enabled and you would like to switch to manually editing a `schema.xml` file, you should take the following steps:
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/spatial-search.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/spatial-search.adoc b/solr/solr-ref-guide/src/spatial-search.adoc
index c44ed77..69d1305 100644
--- a/solr/solr-ref-guide/src/spatial-search.adoc
+++ b/solr/solr-ref-guide/src/spatial-search.adoc
@@ -99,7 +99,7 @@ When used with `BBoxField`, additional options are supported:
 |===
 
 [[SpatialSearch-geofilt]]
-=== `geofilt`
+=== geofilt
 
 The `geofilt` filter allows you to retrieve results based on the geospatial distance (AKA the "great circle distance") from a given point. Another way of looking at it is that it creates a circular shape filter. For example, to find all documents within five kilometers of a given lat/lon point, you could enter `&q=*:*&fq={!geofilt sfield=store}&pt=45.15,-93.85&d=5`. This filter returns all results within a circle of the given radius around the initial point:
 
@@ -107,7 +107,7 @@ image::images/spatial-search/circle.png[image]
 
 
 [[SpatialSearch-bbox]]
-=== `bbox`
+=== bbox
 
 The `bbox` filter is very similar to `geofilt` except it uses the _bounding box_ of the calculated circle. See the blue box in the diagram below. It takes the same parameters as geofilt.
 
@@ -162,7 +162,7 @@ There are four distance function queries:
 For more information about these function queries, see the section on <<function-queries.adoc#function-queries,Function Queries>>.
 
 [[SpatialSearch-geodist]]
-=== `geodist`
+=== geodist
 
 `geodist` is a distance function that takes three optional parameters: `(sfield,latitude,longitude)`. You can use the `geodist` function to sort results by distance or score return results.
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/spell-checking.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/spell-checking.adoc b/solr/solr-ref-guide/src/spell-checking.adoc
index c371192..adb784a 100644
--- a/solr/solr-ref-guide/src/spell-checking.adoc
+++ b/solr/solr-ref-guide/src/spell-checking.adoc
@@ -26,7 +26,7 @@ The basis for these suggestions can be terms in a field in Solr, externally crea
 == Configuring the SpellCheckComponent
 
 [[SpellChecking-DefineSpellCheckinsolrconfig.xml]]
-=== Define Spell Check in `solrconfig.xml`
+=== Define Spell Check in solrconfig.xml
 
 The first step is to specify the source of terms in `solrconfig.xml`. There are three approaches to spell checking in Solr, discussed below.
 
@@ -205,12 +205,12 @@ The SpellCheck component accepts the parameters described in the table below.
 |===
 
 [[SpellChecking-ThespellcheckParameter]]
-=== The `spellcheck` Parameter
+=== The spellcheck Parameter
 
 This parameter turns on SpellCheck suggestions for the request. If *true*, then spelling suggestions will be generated.
 
 [[SpellChecking-Thespellcheck.qorqParameter]]
-=== The `spellcheck.q` or `q` Parameter
+=== The spellcheck.q or q Parameter
 
 This parameter specifies the query to spellcheck. If `spellcheck.q` is defined, then it is used; otherwise the original input query is used. The `spellcheck.q` parameter is intended to be the original query, minus any extra markup like field names, boosts, and so on. If the `q` parameter is specified, then the `SpellingQueryConverter` class is used to parse it into tokens; otherwise the <<tokenizers.adoc#Tokenizers-WhiteSpaceTokenizer,`WhitespaceTokenizer`>> is used. The choice of which one to use is up to the application. Essentially, if you have a spelling "ready" version in your application, then it is probably better to use `spellcheck.q`. Otherwise, if you just want Solr to do the job, use the `q` parameter.
 
@@ -220,44 +220,44 @@ The SpellingQueryConverter class does not deal properly with non-ASCII character
 ====
 
 [[SpellChecking-Thespellcheck.buildParameter]]
-=== The `spellcheck.build` Parameter
+=== The spellcheck.build Parameter
 
 If set to *true*, this parameter creates the dictionary that the SolrSpellChecker will use for spell-checking. In a typical search application, you will need to build the dictionary before using the SolrSpellChecker. However, it's not always necessary to build a dictionary first. For example, you can configure the spellchecker to use a dictionary that already exists.
 
 The dictionary will take some time to build, so this parameter should not be sent with every request.
 
 [[SpellChecking-Thespellcheck.reloadParameter]]
-=== The `spellcheck.reload` Parameter
+=== The spellcheck.reload Parameter
 
 If set to true, this parameter reloads the spellchecker. The results depend on the implementation of `SolrSpellChecker.reload()`. In a typical implementation, reloading the spellchecker means reloading the dictionary.
 
 [[SpellChecking-Thespellcheck.countParameter]]
-=== The `spellcheck.count` Parameter
+=== The spellcheck.count Parameter
 
 This parameter specifies the maximum number of suggestions that the spellchecker should return for a term. If this parameter isn't set, the value defaults to 1. If the parameter is set but not assigned a number, the value defaults to 5. If the parameter is set to a positive integer, that number becomes the maximum number of suggestions returned by the spellchecker.
 
 [[SpellChecking-Thespellcheck.onlyMorePopularParameter]]
-=== The `spellcheck.onlyMorePopular` Parameter
+=== The spellcheck.onlyMorePopular Parameter
 
 If *true*, Solr will to return suggestions that result in more hits for the query than the existing query. Note that this will return more popular suggestions even when the given query term is present in the index and considered "correct".
 
 [[SpellChecking-Thespellcheck.maxResultsForSuggestParameter]]
-=== The `spellcheck.maxResultsForSuggest` Parameter
+=== The spellcheck.maxResultsForSuggest Parameter
 
 For example, if this is set to 5 and the user's query returns 5 or fewer results, the spellchecker will report "correctlySpelled=false" and also offer suggestions (and collations if requested). Setting this greater than zero is useful for creating "did-you-mean?" suggestions for queries that return a low number of hits.
 
 [[SpellChecking-Thespellcheck.alternativeTermCountParameter]]
-=== The `spellcheck.alternativeTermCount` Parameter
+=== The spellcheck.alternativeTermCount Parameter
 
 Specify the number of suggestions to return for each query term existing in the index and/or dictionary. Presumably, users will want fewer suggestions for words with docFrequency>0. Also setting this value turns "on" context-sensitive spell suggestions.
 
 [[SpellChecking-Thespellcheck.extendedResultsParameter]]
-=== The `spellcheck.extendedResults` Parameter
+=== The spellcheck.extendedResults Parameter
 
 This parameter causes to Solr to include additional information about the suggestion, such as the frequency in the index.
 
 [[SpellChecking-Thespellcheck.collateParameter]]
-=== The `spellcheck.collate` Parameter
+=== The spellcheck.collate Parameter
 
 If *true*, this parameter directs Solr to take the best suggestion for each token (if one exists) and construct a new query from the suggestions. For example, if the input query was "jawa class lording" and the best suggestion for "jawa" was "java" and "lording" was "loading", then the resulting collation would be "java class loading".
 
@@ -266,27 +266,27 @@ The spellcheck.collate parameter only returns collations that are guaranteed to
 NOTE: This only returns a query to be used. It does not actually run the suggested query.
 
 [[SpellChecking-Thespellcheck.maxCollationsParameter]]
-=== The `spellcheck.maxCollations` Parameter
+=== The spellcheck.maxCollations Parameter
 
 The maximum number of collations to return. The default is *1*. This parameter is ignored if `spellcheck.collate` is false.
 
 [[SpellChecking-Thespellcheck.maxCollationTriesParameter]]
-=== The `spellcheck.maxCollationTries` Parameter
+=== The spellcheck.maxCollationTries Parameter
 
 This parameter specifies the number of collation possibilities for Solr to try before giving up. Lower values ensure better performance. Higher values may be necessary to find a collation that can return results. The default value is `0`, which maintains backwards-compatible (Solr 1.4) behavior (do not check collations). This parameter is ignored if `spellcheck.collate` is false.
 
 [[SpellChecking-Thespellcheck.maxCollationEvaluationsParameter]]
-=== The `spellcheck.maxCollationEvaluations` Parameter
+=== The spellcheck.maxCollationEvaluations Parameter
 
 This parameter specifies the maximum number of word correction combinations to rank and evaluate prior to deciding which collation candidates to test against the index. This is a performance safety-net in case a user enters a query with many misspelled words. The default is *10,000* combinations, which should work well in most situations.
 
 [[SpellChecking-Thespellcheck.collateExtendedResultsParameter]]
-=== The `spellcheck.collateExtendedResults` Parameter
+=== The spellcheck.collateExtendedResults Parameter
 
 If *true*, this parameter returns an expanded response format detailing the collations Solr found. The default value is *false* and this is ignored if `spellcheck.collate` is false.
 
 [[SpellChecking-Thespellcheck.collateMaxCollectDocsParameter]]
-=== The `spellcheck.collateMaxCollectDocs` Parameter
+=== The spellcheck.collateMaxCollectDocs Parameter
 
 This parameter specifies the maximum number of documents that should be collect when testing potential collations against the index. A value of *0* indicates that all documents should be collected, resulting in exact hit-counts. Otherwise an estimation is provided as a performance optimization in cases where exact hit-counts are unnecessary – the higher the value specified, the more precise the estimation.
 
@@ -294,23 +294,23 @@ The default value for this parameter is *0*, but when `spellcheck.collateExtende
 
 
 [[SpellChecking-Thespellcheck.collateParam._ParameterPrefix]]
-=== The `spellcheck.collateParam.*` Parameter Prefix
+=== The spellcheck.collateParam.* Parameter Prefix
 
 This parameter prefix can be used to specify any additional parameters that you wish to the Spellchecker to use when internally validating collation queries. For example, even if your regular search results allow for loose matching of one or more query terms via parameters like `q.op=OR` and `mm=20%` you can specify override params such as `spellcheck.collateParam.q.op=AND&spellcheck.collateParam.mm=100%` to require that only collations consisting of words that are all found in at least one document may be returned.
 
 [[SpellChecking-Thespellcheck.dictionaryParameter]]
-=== The `spellcheck.dictionary` Parameter
+=== The spellcheck.dictionary Parameter
 
 This parameter causes Solr to use the dictionary named in the parameter's argument. The default setting is "default". This parameter can be used to invoke a specific spellchecker on a per request basis.
 
 [[SpellChecking-Thespellcheck.accuracyParameter]]
-=== The `spellcheck.accuracy` Parameter
+=== The spellcheck.accuracy Parameter
 
 Specifies an accuracy value to be used by the spell checking implementation to decide whether a result is worthwhile or not. The value is a float between 0 and 1. Defaults to `Float.MIN_VALUE`.
 
 
 [[spellcheck_DICT_NAME]]
-=== The `spellcheck.<DICT_NAME>.key` Parameter
+=== The spellcheck.<DICT_NAME>.key Parameter
 
 Specifies a key/value pair for the implementation handling a given dictionary. The value that is passed through is just `key=value` (`spellcheck.<DICT_NAME>.` is stripped off.
 


[13/35] lucene-solr:jira/SOLR-10834: SOLR-10871: remove backticks for monospace type in headings

Posted by ho...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/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 ea250b1..d624d7c 100644
--- a/solr/solr-ref-guide/src/the-dismax-query-parser.adoc
+++ b/solr/solr-ref-guide/src/the-dismax-query-parser.adoc
@@ -58,7 +58,7 @@ In addition to the common request parameter, highlighting parameters, and simple
 The sections below explain these parameters in detail.
 
 [[TheDisMaxQueryParser-TheqParameter]]
-=== The `q` Parameter
+=== The q Parameter
 
 The `q` parameter defines the main "query" constituting the essence of the search. The parameter supports raw input strings provided by users with no special escaping. The + and - characters are treated as "mandatory" and "prohibited" modifiers for terms. Text wrapped in balanced quote characters (for example, "San Jose") is treated as a phrase. Any query containing an odd number of quote characters is evaluated as if there were no quote characters at all.
 
@@ -70,13 +70,13 @@ The `q` parameter does not support wildcard characters such as *.
 ====
 
 [[TheDisMaxQueryParser-Theq.altParameter]]
-=== The `q.alt` Parameter
+=== The q.alt Parameter
 
 If specified, the `q.alt` parameter defines a query (which by default will be parsed using standard query parsing syntax) when the main q parameter is not specified or is blank. The `q.alt` parameter comes in handy when you need something like a query to match all documents (don't forget `&rows=0` for that one!) in order to get collection-wide faceting counts.
 
 
 [[TheDisMaxQueryParser-Theqf_QueryFields_Parameter]]
-=== The `qf` (Query Fields) Parameter
+=== The qf (Query Fields) Parameter
 
 The `qf` parameter introduces a list of fields, each of which is assigned a boost factor to increase or decrease that particular field's importance in the query. For example, the query below:
 
@@ -86,7 +86,7 @@ assigns `fieldOne` a boost of 2.3, leaves `fieldTwo` with the default boost (bec
 
 
 [[TheDisMaxQueryParser-Themm_MinimumShouldMatch_Parameter]]
-=== The `mm` (Minimum Should Match) Parameter
+=== The mm (Minimum Should Match) Parameter
 
 When processing queries, Lucene/Solr recognizes three types of clauses: mandatory, prohibited, and "optional" (also known as "should" clauses). By default, all words or phrases specified in the `q` parameter are treated as "optional" clauses unless they are preceded by a "+" or a "-". When dealing with these "optional" clauses, the `mm` parameter makes it possible to say that a certain minimum number of those clauses must match. The DisMax query parser offers great flexibility in how the minimum number can be specified.
 
@@ -116,7 +116,7 @@ The default value of `mm` is 100% (meaning that all clauses must match).
 
 
 [[TheDisMaxQueryParser-Thepf_PhraseFields_Parameter]]
-=== The `pf` (Phrase Fields) Parameter
+=== The pf (Phrase Fields) Parameter
 
 Once the list of matching documents has been identified using the `fq` and `qf` parameters, the `pf` parameter can be used to "boost" the score of documents in cases where all of the terms in the q parameter appear in close proximity.
 
@@ -124,19 +124,19 @@ The format is the same as that used by the `qf` parameter: a list of fields and
 
 
 [[TheDisMaxQueryParser-Theps_PhraseSlop_Parameter]]
-=== The `ps` (Phrase Slop) Parameter
+=== The ps (Phrase Slop) Parameter
 
 The `ps` parameter specifies the amount of "phrase slop" to apply to queries specified with the pf parameter. Phrase slop is the number of positions one token needs to be moved in relation to another token in order to match a phrase specified in a query.
 
 
 [[TheDisMaxQueryParser-Theqs_QueryPhraseSlop_Parameter]]
-=== The `qs` (Query Phrase Slop) Parameter
+=== The qs (Query Phrase Slop) Parameter
 
 The `qs` parameter specifies the amount of slop permitted on phrase queries explicitly included in the user's query string with the `qf` parameter. As explained above, slop refers to the number of positions one token needs to be moved in relation to another token in order to match a phrase specified in a query.
 
 
 [[TheDisMaxQueryParser-Thetie_TieBreaker_Parameter]]
-=== The `tie` (Tie Breaker) Parameter
+=== The tie (Tie Breaker) Parameter
 
 The `tie` parameter specifies a float value (which should be something much less than 1) to use as tiebreaker in DisMax queries.
 
@@ -146,7 +146,7 @@ A value of "0.0" - the default - makes the query a pure "disjunction max query":
 
 
 [[TheDisMaxQueryParser-Thebq_BoostQuery_Parameter]]
-=== The `bq` (Boost Query) Parameter
+=== The bq (Boost Query) Parameter
 
 The `bq` parameter specifies an additional, optional, query clause that will be added to the user's main query to influence the score. For example, if you wanted to add a relevancy boost for recent documents:
 
@@ -160,7 +160,7 @@ You can specify multiple `bq` parameters. If you want your query to be parsed as
 
 
 [[TheDisMaxQueryParser-Thebf_BoostFunctions_Parameter]]
-=== The `bf` (Boost Functions) Parameter
+=== The bf (Boost Functions) Parameter
 
 The `bf` parameter specifies functions (with optional boosts) that will be used to construct FunctionQueries which will be added to the user's main query as optional clauses that will influence the score. Any function supported natively by Solr can be used, along with a boost value. For example:
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/the-extended-dismax-query-parser.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/the-extended-dismax-query-parser.adoc b/solr/solr-ref-guide/src/the-extended-dismax-query-parser.adoc
index fff5909..c0fdcae 100644
--- a/solr/solr-ref-guide/src/the-extended-dismax-query-parser.adoc
+++ b/solr/solr-ref-guide/src/the-extended-dismax-query-parser.adoc
@@ -39,64 +39,64 @@ In addition to supporting all the DisMax query parser parameters, Extended Disma
 In addition to all the <<the-dismax-query-parser.adoc#TheDisMaxQueryParser-DisMaxParameters,DisMax parameters>>, Extended DisMax includes these query parameters:
 
 [[TheExtendedDisMaxQueryParser-ThesowParameter]]
-=== The `sow` Parameter
+=== The sow Parameter
 
 Split on whitespace: if set to `false`, whitespace-separated term sequences will be provided to text analysis in one shot, enabling proper function of analysis filters that operate over term sequences, e.g. multi-word synonyms and shingles. Defaults to `true`: text analysis is invoked separately for each individual whitespace-separated term.
 
 [[TheExtendedDisMaxQueryParser-Themm.autoRelaxParameter]]
-=== The `mm.autoRelax` Parameter
+=== The mm.autoRelax Parameter
 
 If true, the number of clauses required (<<the-dismax-query-parser.adoc#TheDisMaxQueryParser-Themm_MinimumShouldMatch_Parameter,minimum should match>>) will automatically be relaxed if a clause is removed (by e.g. stopwords filter) from some but not all <<the-dismax-query-parser.adoc#TheDisMaxQueryParser-Theqf_QueryFields_Parameter,`qf`>> fields. Use this parameter as a workaround if you experience that queries return zero hits due to uneven stopword removal between the `qf` fields.
 
 Note that relaxing mm may cause undesired side effects, hurting the precision of the search, depending on the nature of your index content.
 
 [[TheExtendedDisMaxQueryParser-TheboostParameter]]
-=== The `boost` Parameter
+=== The boost Parameter
 
 A multivalued list of strings parsed as queries with scores multiplied by the score from the main query for all matching documents. This parameter is shorthand for wrapping the query produced by eDisMax using the `BoostQParserPlugin`
 
 [[TheExtendedDisMaxQueryParser-ThelowercaseOperatorsParameter]]
-=== The `lowercaseOperators` Parameter
+=== The lowercaseOperators Parameter
 
 A Boolean parameter indicating if lowercase "and" and "or" should be treated the same as operators "AND" and "OR".
 
 [[TheExtendedDisMaxQueryParser-ThepsParameter]]
-=== The `ps` Parameter
+=== The ps Parameter
 
 Default amount of slop on phrase queries built with `pf`, `pf2` and/or `pf3` fields (affects boosting).
 
 [[TheExtendedDisMaxQueryParser-Thepf2Parameter]]
-=== The `pf2` Parameter
+=== The pf2 Parameter
 
 A multivalued list of fields with optional weights, based on pairs of word shingles.
 
 [[TheExtendedDisMaxQueryParser-Theps2Parameter]]
-=== The `ps2` Parameter
+=== The ps2 Parameter
 
 This is similar to `ps` but overrides the slop factor used for `pf2`. If not specified, `ps` is used.
 
 [[TheExtendedDisMaxQueryParser-Thepf3Parameter]]
-=== The `pf3` Parameter
+=== The pf3 Parameter
 
 A multivalued list of fields with optional weights, based on triplets of word shingles. Similar to `pf`, except that instead of building a phrase per field out of all the words in the input, it builds a set of phrases for each field out of each triplet of word shingles.
 
 [[TheExtendedDisMaxQueryParser-Theps3Parameter]]
-=== The `ps3` Parameter
+=== The ps3 Parameter
 
 This is similar to `ps` but overrides the slop factor used for `pf3`. If not specified, `ps` is used.
 
 [[TheExtendedDisMaxQueryParser-ThestopwordsParameter]]
-=== The `stopwords` Parameter
+=== The stopwords Parameter
 
 A Boolean parameter indicating if the `StopFilterFactory` configured in the query analyzer should be respected when parsing the query: if it is false, then the `StopFilterFactory` in the query analyzer is ignored.
 
 [[TheExtendedDisMaxQueryParser-TheufParameter]]
-=== The `uf` Parameter
+=== The uf Parameter
 
 Specifies which schema fields the end user is allowed to explicitly query. This parameter supports wildcards. The default is to allow all fields, equivalent to `uf=\*`. To allow only title field, use `uf=title`. To allow title and all fields ending with '_s', use `uf=title,*_s`. To allow all fields except title, use `uf=*,-title`. To disallow all fielded searches, use `uf=-*`.
 
 [[TheExtendedDisMaxQueryParser-Fieldaliasingusingper-fieldqfoverrides]]
-=== Field aliasing using per-field `qf` overrides
+=== Field aliasing using per-field qf overrides
 
 Per-field overrides of the `qf` parameter may be specified to provide 1-to-many aliasing from field names specified in the query string, to field names used in the underlying query. By default, no aliasing is used and field names specified in the query string are treated as literal field names in the index.
 
@@ -223,7 +223,7 @@ Finally, in addition to the phrase fields (`pf`) parameter, `edismax` also suppo
 
 
 [[TheExtendedDisMaxQueryParser-Usingthe_magicfields__val_and_query_]]
-== Using the 'magic fields' `\_val_` and `\_query_`
+== Using the "magic fields" \_val_ and \_query_
 
 The Solr Query Parser's use of `\_val_` and `\_query_` differs from the Lucene Query Parser in the following ways:
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/the-query-elevation-component.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/the-query-elevation-component.adoc b/solr/solr-ref-guide/src/the-query-elevation-component.adoc
index f70ed88..9898a08 100644
--- a/solr/solr-ref-guide/src/the-query-elevation-component.adoc
+++ b/solr/solr-ref-guide/src/the-query-elevation-component.adoc
@@ -74,7 +74,7 @@ The Query Elevation Search Component takes the following arguments:
 |===
 
 [[TheQueryElevationComponent-elevate.xml]]
-=== `elevate.xml`
+=== elevate.xml
 
 Elevated query results are configured in an external XML file specified in the `config-file` argument. An `elevate.xml` file might look like this:
 
@@ -100,7 +100,7 @@ In this example, the query "foo bar" would first return documents 1, 2 and 3, th
 == Using the Query Elevation Component
 
 [[TheQueryElevationComponent-TheenableElevationParameter]]
-=== The `enableElevation` Parameter
+=== The enableElevation Parameter
 
 For debugging it may be useful to see results with and without the elevated docs. To hide results, use `enableElevation=false`:
 
@@ -109,21 +109,21 @@ For debugging it may be useful to see results with and without the elevated docs
 `\http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&debugQuery=true&enableElevation=false`
 
 [[TheQueryElevationComponent-TheforceElevationParameter]]
-=== The `forceElevation` Parameter
+=== The forceElevation Parameter
 
 You can force elevation during runtime by adding `forceElevation=true` to the query URL:
 
 `\http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&debugQuery=true&enableElevation=true&forceElevation=true`
 
 [[TheQueryElevationComponent-TheexclusiveParameter]]
-=== The `exclusive` Parameter
+=== The exclusive Parameter
 
 You can force Solr to return only the results specified in the elevation file by adding `exclusive=true` to the URL:
 
 `\http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&debugQuery=true&exclusive=true`
 
 [[TheQueryElevationComponent-DocumentTransformersandthemarkExcludesParameter]]
-=== Document Transformers and the `markExcludes` Parameter
+=== Document Transformers and the markExcludes Parameter
 
 The `[elevated]` <<transforming-result-documents.adoc#transforming-result-documents,Document Transformer>> can be used to annotate each document with information about whether or not it was elevated:
 
@@ -134,7 +134,7 @@ Likewise, it can be helpful when troubleshooting to see all matching documents 
 `\http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&markExcludes=true&fl=id,[elevated],[excluded]`
 
 [[TheQueryElevationComponent-TheelevateIdsandexcludeIdsParameters]]
-=== The `elevateIds` and `excludeIds` Parameters
+=== The elevateIds and excludeIds Parameters
 
 When the elevation component is in use, the pre-configured list of elevations for a query can be overridden at request time to use the unique keys specified in these request parameters.
 
@@ -149,6 +149,6 @@ For example, in the request below documents IW-02 and F8V7067-APL-KIT will be el
 `\http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&elevateIds=IW-02,F8V7067-APL-KIT`
 
 [[TheQueryElevationComponent-ThefqParameter]]
-=== The `fq` Parameter
+=== The fq Parameter
 
 Query elevation respects the standard filter query (`fq`) parameter. That is, if the query contains the `fq` parameter, all results will be within that filter even if `elevate.xml` adds other documents to the result set.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/the-standard-query-parser.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/the-standard-query-parser.adoc b/solr/solr-ref-guide/src/the-standard-query-parser.adoc
index 94baedf..f389b92 100644
--- a/solr/solr-ref-guide/src/the-standard-query-parser.adoc
+++ b/solr/solr-ref-guide/src/the-standard-query-parser.adoc
@@ -187,7 +187,7 @@ The brackets around a query determine its inclusiveness.
 
 
 [[TheStandardQueryParser-BoostingaTermwith_]]
-=== Boosting a Term with `^`
+=== Boosting a Term with "^"
 
 Lucene/Solr provides the relevance level of matching documents based on the terms found. To boost a term use the caret symbol `^` with a boost factor (a number) at the end of the term you are searching. The higher the boost factor, the more relevant the term will be.
 
@@ -205,7 +205,7 @@ By default, the boost factor is 1. Although the boost factor must be positive, i
 
 
 [[TheStandardQueryParser-ConstantScorewith_]]
-=== Constant Score with `^=`
+=== Constant Score with "^="
 
 Constant score queries are created with `<query_clause>^=<score>`, which sets the entire clause to the specified score for any documents matching that clause. This is desirable when you only care about matches for a particular clause and don't want other relevancy factors such as term frequency (the number of times the term appears in the field) or inverse document frequency (a measure across the whole index for how rare a term is in a field).
 
@@ -279,7 +279,7 @@ or
 
 
 [[TheStandardQueryParser-TheBooleanOperator_]]
-=== The Boolean Operator `+`
+=== The Boolean Operator "+"
 
 The `+` symbol (also known as the "required" operator) requires that the term after the `+` symbol exist somewhere in a field in at least one document in order for the query to return a match.
 
@@ -296,7 +296,7 @@ This operator is supported by both the standard query parser and the DisMax quer
 
 
 [[TheStandardQueryParser-TheBooleanOperatorAND_]]
-=== The Boolean Operator AND (`&&`)
+=== The Boolean Operator AND ("&&")
 
 The AND operator matches documents where both terms exist anywhere in the text of a single document. This is equivalent to an intersection using sets. The symbol `&&` can be used in place of the word AND.
 
@@ -308,7 +308,7 @@ To search for documents that contain "jakarta apache" and "Apache Lucene," use e
 
 
 [[TheStandardQueryParser-TheBooleanOperatorNOT_]]
-=== The Boolean Operator NOT (`!`)
+=== The Boolean Operator NOT ("!")
 
 The NOT operator excludes documents that contain the term after NOT. This is equivalent to a difference using sets. The symbol `!` can be used in place of the word NOT.
 
@@ -319,7 +319,7 @@ The following queries search for documents that contain the phrase "jakarta apac
 `"jakarta apache" ! "Apache Lucene"`
 
 [[TheStandardQueryParser-TheBooleanOperator-]]
-=== The Boolean Operator `-`
+=== The Boolean Operator "-"
 
 The `-` symbol or "prohibit" operator excludes documents that contain the term after the `-` symbol.
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/transforming-result-documents.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/transforming-result-documents.adoc b/solr/solr-ref-guide/src/transforming-result-documents.adoc
index 95d373e..feb6931 100644
--- a/solr/solr-ref-guide/src/transforming-result-documents.adoc
+++ b/solr/solr-ref-guide/src/transforming-result-documents.adoc
@@ -51,7 +51,7 @@ The sections below discuss exactly what these various transformers do.
 
 
 [[TransformingResultDocuments-_value_-ValueAugmenterFactory]]
-=== `[value]` - ValueAugmenterFactory
+=== [value] - ValueAugmenterFactory
 
 Modifies every document to include the exact same value, as if it were a stored field in every document:
 
@@ -95,7 +95,7 @@ The "```value```" option forces an explicit value to always be used, while the "
 
 
 [[TransformingResultDocuments-_explain_-ExplainAugmenterFactory]]
-=== `[explain]` - ExplainAugmenterFactory
+=== [explain] - ExplainAugmenterFactory
 
 Augments each document with an inline explanation of its score exactly like the information available about each document in the debug section:
 
@@ -116,7 +116,7 @@ Supported values for "```style```" are "```text```", and "```html```", and "nl"
           "value":1.052226,
           "description":"weight(features:cache in 2) [DefaultSimilarity], result of:",
           "details":[{
-...
+}]}}]}}
 ----
 
 A default style can be configured by specifying an "args" parameter in your configuration:
@@ -130,7 +130,7 @@ A default style can be configured by specifying an "args" parameter in your conf
 
 
 [[TransformingResultDocuments-_child_-ChildDocTransformerFactory]]
-=== `[child]` - ChildDocTransformerFactory
+=== [child] - ChildDocTransformerFactory
 
 This transformer returns all <<uploading-data-with-index-handlers.adoc#UploadingDatawithIndexHandlers-NestedChildDocuments,descendant documents>> of each parent document matching your query in a flat list nested inside the matching parent document. This is useful when you have indexed nested child documents and want to retrieve the child documents for the relevant parent documents for any type of search query.
 
@@ -148,7 +148,7 @@ When using this transformer, the `parentFilter` parameter must be specified, and
 
 
 [[TransformingResultDocuments-_shard_-ShardAugmenterFactory]]
-=== `[shard]` - ShardAugmenterFactory
+=== [shard] - ShardAugmenterFactory
 
 This transformer adds information about what shard each individual document came from in a distributed request.
 
@@ -156,7 +156,7 @@ ShardAugmenterFactory does not support any request parameters, or configuration
 
 
 [[TransformingResultDocuments-_docid_-DocIdAugmenterFactory]]
-=== `[docid]` - DocIdAugmenterFactory
+=== [docid] - DocIdAugmenterFactory
 
 This transformer adds the internal Lucene document id to each document – this is primarily only useful for debugging purposes.
 
@@ -164,7 +164,7 @@ DocIdAugmenterFactory does not support any request parameters, or configuration
 
 
 [[TransformingResultDocuments-_elevated_and_excluded_]]
-=== `[elevated]` and `[excluded]`
+=== [elevated] and [excluded]
 
 These transformers are available only when using the <<the-query-elevation-component.adoc#the-query-elevation-component,Query Elevation Component>>.
 
@@ -191,12 +191,12 @@ fl=id,[elevated],[excluded]&excludeIds=GB18030TEST&elevateIds=6H500F0&markExclud
         "id":"SP2514N",
         "[elevated]":false,
         "[excluded]":false},
-...
+]}}
 ----
 
 
 [[TransformingResultDocuments-_json_xml_]]
-=== `[json]` / `[xml]`
+=== [json] / [xml]
 
 These transformers replace field value containing a string representation of a valid XML or JSON structure with the actual raw XML or JSON structure rather than just the string value. Each applies only to the specific writer, such that `[json]` only applies to `wt=json` and `[xml]` only applies to `wt=xml`.
 
@@ -207,7 +207,7 @@ fl=id,source_s:[json]&wt=json
 
 
 [[TransformingResultDocuments-_subquery_]]
-=== `[subquery]`
+=== [subquery]
 
 This transformer executes a separate query per transforming document passing document fields as an input for subquery parameters. It's usually used with `{!join}` and `{!parent}` query parsers, and is intended to be an improvement for `[child]`.
 
@@ -246,17 +246,14 @@ Here is how it looks like in various formats:
         "id":1,
         "subject":["parentDocument"],
         "title":["xrxvomgu"],
-        "children":{ 
+        "children":{
            "numFound":1, "start":0,
            "docs":[
               { "id":2,
                 "cat":["childDocument"]
               }
             ]
-      }},
-      {
-         "id":4,
-      ...
+      }}]}}
 ----
 
 [source,java]
@@ -311,7 +308,7 @@ If subquery collection has a different unique key field name (let's say `foo_id`
 
 
 [[TransformingResultDocuments-_geo_-Geospatialformatter]]
-=== `[geo]` - Geospatial formatter
+=== [geo] - Geospatial formatter
 
 Formats spatial data from a spatial field using a designated format type name. Two inner parameters are required: `f` for the field name, and `w` for the format name. Example: `geojson:[geo f=mySpatialField w=GeoJSON]`.
 
@@ -321,7 +318,7 @@ In addition, this feature is very useful with the `RptWithGeometrySpatialField`
 
 
 [[TransformingResultDocuments-_features_-LTRFeatureLoggerTransformerFactory]]
-=== `[features]` - LTRFeatureLoggerTransformerFactory
+=== [features] - LTRFeatureLoggerTransformerFactory
 
 The "LTR" prefix stands for <<learning-to-rank.adoc#learning-to-rank,Learning To Rank>>. This transformer returns the values of features and it can be used for feature extraction and feature logging.
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/updatehandlers-in-solrconfig.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/updatehandlers-in-solrconfig.adoc b/solr/solr-ref-guide/src/updatehandlers-in-solrconfig.adoc
index 7afc2e1..664bd8c 100644
--- a/solr/solr-ref-guide/src/updatehandlers-in-solrconfig.adoc
+++ b/solr/solr-ref-guide/src/updatehandlers-in-solrconfig.adoc
@@ -33,7 +33,7 @@ The settings in this section are configured in the `<updateHandler>` element in
 Data sent to Solr is not searchable until it has been _committed_ to the index. The reason for this is that in some cases commits can be slow and they should be done in isolation from other possible commit requests to avoid overwriting data. So, it's preferable to provide control over when data is committed. Several options are available to control the timing of commits.
 
 [[UpdateHandlersinSolrConfig-commitandsoftCommit]]
-=== `commit` and `softCommit`
+=== commit and softCommit
 
 In Solr, a `commit` is an action which asks Solr to "commit" those changes to the Lucene index files. By default commit actions result in a "hard commit" of all the Lucene index files to stable storage (disk). When a client includes a `commit=true` parameter with an update request, this ensures that all index segments affected by the adds & deletes on an update are written to disk as soon as index updates are completed.
 
@@ -42,7 +42,7 @@ If an additional flag `softCommit=true` is specified, then Solr performs a 'soft
 For more information about Near Real Time operations, see <<near-real-time-searching.adoc#near-real-time-searching,Near Real Time Searching>>.
 
 [[UpdateHandlersinSolrConfig-autoCommit]]
-=== `autoCommit`
+=== autoCommit
 
 These settings control how often pending updates will be automatically pushed to the index. An alternative to `autoCommit` is to use `commitWithin`, which can be defined when making the update request to Solr (i.e., when pushing documents), or in an update RequestHandler.
 
@@ -79,7 +79,7 @@ You can also specify 'soft' autoCommits in the same way that you can specify 'so
 ----
 
 [[UpdateHandlersinSolrConfig-commitWithin]]
-=== `commitWithin`
+=== commitWithin
 
 The `commitWithin` settings allow forcing document commits to happen in a defined time period. This is used most frequently with <<near-real-time-searching.adoc#near-real-time-searching,Near Real Time Searching>>, and for that reason the default is to perform a soft commit. This does not, however, replicate new documents to slave servers in a master/slave environment. If that's a requirement for your implementation, you can force a hard commit by adding a parameter, as in this example:
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/uploading-data-with-index-handlers.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/uploading-data-with-index-handlers.adoc b/solr/solr-ref-guide/src/uploading-data-with-index-handlers.adoc
index 30a2c3a..8bad5f5 100644
--- a/solr/solr-ref-guide/src/uploading-data-with-index-handlers.adoc
+++ b/solr/solr-ref-guide/src/uploading-data-with-index-handlers.adoc
@@ -148,7 +148,7 @@ When using the Join query parser in a Delete By Query, you should use the `score
 The rollback command rolls back all add and deletes made to the index since the last commit. It neither calls any event listeners nor creates a new searcher. Its syntax is simple: `<rollback/>`.
 
 [[UploadingDatawithIndexHandlers-UsingcurltoPerformUpdates]]
-=== Using `curl` to Perform Updates
+=== Using curl to Perform Updates
 
 You can use the `curl` utility to perform any of the above commands, using its `--data-binary` option to append the XML message to the `curl` command, and generating a HTTP POST request. For example:
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/uploading-data-with-solr-cell-using-apache-tika.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/uploading-data-with-solr-cell-using-apache-tika.adoc b/solr/solr-ref-guide/src/uploading-data-with-solr-cell-using-apache-tika.adoc
index e1c8414..670ef2b 100644
--- a/solr/solr-ref-guide/src/uploading-data-with-solr-cell-using-apache-tika.adoc
+++ b/solr/solr-ref-guide/src/uploading-data-with-solr-cell-using-apache-tika.adoc
@@ -48,7 +48,7 @@ While Apache Tika is quite powerful, it is not perfect and fails on some files.
 ====
 
 [[UploadingDatawithSolrCellusingApacheTika-TryingoutTikawiththeSolrtechproductsExample]]
-== Trying out Tika with the Solr `techproducts` Example
+== Trying out Tika with the Solr techproducts Example
 
 You can try out the Tika framework using the `techproducts` example included in Solr.
 
@@ -138,7 +138,7 @@ Here is the order in which the Solr Cell framework, using the Extracting Request
 4.  If `uprefix` is specified, any unknown field names are prefixed with that value, else if `defaultField` is specified, any unknown fields are copied to the default field.
 
 [[UploadingDatawithSolrCellusingApacheTika-ConfiguringtheSolrExtractingRequestHandler]]
-== Configuring the Solr `ExtractingRequestHandler`
+== Configuring the Solr ExtractingRequestHandler
 
 If you are not working with the supplied `sample_techproducts_configs `or` data_driven_schema_configs` <<config-sets.adoc#config-sets,config set>>, you must configure your own `solrconfig.xml` to know about the Jar's containing the `ExtractingRequestHandler` and its dependencies:
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/using-zookeeper-to-manage-configuration-files.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/using-zookeeper-to-manage-configuration-files.adoc b/solr/solr-ref-guide/src/using-zookeeper-to-manage-configuration-files.adoc
index b2dc9d5..a9e0d71 100644
--- a/solr/solr-ref-guide/src/using-zookeeper-to-manage-configuration-files.adoc
+++ b/solr/solr-ref-guide/src/using-zookeeper-to-manage-configuration-files.adoc
@@ -58,7 +58,7 @@ It's a good idea to keep these files under version control.
 
 
 [[UsingZooKeepertoManageConfigurationFiles-UploadingConfigurationFilesusingbin_solrorSolrJ]]
-== Uploading Configuration Files using `bin/solr` or SolrJ
+== Uploading Configuration Files using bin/solr or SolrJ
 
 In production situations, <<config-sets.adoc#config-sets,Config Sets>> can also be uploaded to ZooKeeper independent of collection creation using either Solr's <<solr-control-script-reference.adoc#solr-control-script-reference,Solr Control Script>> or the {solr-javadocs}/solr-solrj/org/apache/solr/client/solrj/impl/CloudSolrClient.html[CloudSolrClient.uploadConfig] java method.
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/working-with-dates.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/working-with-dates.adoc b/solr/solr-ref-guide/src/working-with-dates.adoc
index f0ac242..7d30b66 100644
--- a/solr/solr-ref-guide/src/working-with-dates.adoc
+++ b/solr/solr-ref-guide/src/working-with-dates.adoc
@@ -53,8 +53,8 @@ As you can see, the date format includes colon characters separating the hours,
 
 This is normally an invalid query: `datefield:1972-05-20T17:33:18.772Z`
 
-These are valid queries: + 
-`datefield:1972-05-20T17\:33\:18.772Z` + 
+These are valid queries: +
+`datefield:1972-05-20T17\:33\:18.772Z` +
 `datefield:"1972-05-20T17:33:18.772Z"` +
 `datefield:[1972-05-20T17:33:18.772Z TO *]`
 
@@ -108,7 +108,7 @@ Note that while date math is most commonly used relative to `NOW` it can be appl
 === Request Parameters That Affect Date Math
 
 [[WorkingwithDates-NOW]]
-==== `NOW`
+==== NOW
 
 The `NOW` parameter is used internally by Solr to ensure consistent date math expression parsing across multiple nodes in a distributed request. But it can be specified to instruct Solr to use an arbitrary moment in time (past or future) to override for all situations where the the special value of "```NOW```" would impact date math expressions.
 
@@ -119,7 +119,7 @@ Example:
 `q=solr&fq=start_date:[* TO NOW]&NOW=1384387200000`
 
 [[WorkingwithDates-TZ]]
-==== `TZ`
+==== TZ
 
 By default, all date math expressions are evaluated relative to the UTC TimeZone, but the `TZ` parameter can be specified to override this behaviour, by forcing all date based addition and rounding to be relative to the specified http://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html[time zone].
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/working-with-enum-fields.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/working-with-enum-fields.adoc b/solr/solr-ref-guide/src/working-with-enum-fields.adoc
index c4d49b3..8931543 100644
--- a/solr/solr-ref-guide/src/working-with-enum-fields.adoc
+++ b/solr/solr-ref-guide/src/working-with-enum-fields.adoc
@@ -21,7 +21,7 @@
 The EnumField type allows defining a field whose values are a closed set, and the sort order is pre-determined but is not alphabetic nor numeric. Examples of this are severity lists, or risk definitions.
 
 [[WorkingwithEnumFields-DefininganEnumFieldinschema.xml]]
-== Defining an EnumField in `schema.xml`
+== Defining an EnumField in schema.xml
 
 The EnumField type definition is quite simple, as in this example defining field types for "priorityLevel" and "riskLevel" enumerations:
 
@@ -52,7 +52,7 @@ In this example, there are two value lists defined. Each list is between `enum`
     <value>Low</value>
     <value>Medium</value>
     <value>High</value>
-    <value>Urgent</value>   
+    <value>Urgent</value>
   </enum>
   <enum name="risk">
     <value>Unknown</value>
@@ -60,7 +60,7 @@ In this example, there are two value lists defined. Each list is between `enum`
     <value>Low</value>
     <value>Medium</value>
     <value>High</value>
-    <value>Critical</value> 
+    <value>Critical</value>
   </enum>
 </enumsConfig>
 ----

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0411504d/solr/solr-ref-guide/src/working-with-external-files-and-processes.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/working-with-external-files-and-processes.adoc b/solr/solr-ref-guide/src/working-with-external-files-and-processes.adoc
index 31abc18..3aa0195 100644
--- a/solr/solr-ref-guide/src/working-with-external-files-and-processes.adoc
+++ b/solr/solr-ref-guide/src/working-with-external-files-and-processes.adoc
@@ -19,7 +19,7 @@
 // under the License.
 
 [[WorkingwithExternalFilesandProcesses-TheExternalFileFieldType]]
-== The `ExternalFileField` Type
+== The ExternalFileField Type
 
 The `ExternalFileField` type makes it possible to specify the values for a field in a file outside the Solr index. For such a field, the file contains mappings from a key field to the field value. Another way to think of this is that, instead of specifying the field in documents as they are indexed, Solr finds values for this field in the external file.
 
@@ -74,7 +74,7 @@ It's possible to define an event listener to reload an external file when either
 ----
 
 [[WorkingwithExternalFilesandProcesses-ThePreAnalyzedFieldType]]
-== The `PreAnalyzedField` Type
+== The PreAnalyzedField Type
 
 The `PreAnalyzedField` type provides a way to send to Solr serialized token streams, optionally with independent stored values of a field, and have this information stored and indexed without any additional text processing applied in Solr. This is useful if user wants to submit field content that was already processed by some existing external text processing pipeline (e.g., it has been tokenized, annotated, stemmed, synonyms inserted, etc.), while using all the rich attributes that Lucene's TokenStream provides (per-token attributes).
 


[15/35] lucene-solr:jira/SOLR-10834: SOLR-10835: Add support for point fields in Export Handler

Posted by ho...@apache.org.
SOLR-10835: Add support for point fields in Export Handler


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

Branch: refs/heads/jira/SOLR-10834
Commit: c51f6fae75b7b2de1cbe77a13b76d6e08e9fa35c
Parents: 0411504
Author: Tomas Fernandez Lobbe <tf...@apache.org>
Authored: Mon Jun 12 14:04:16 2017 -0700
Committer: Tomas Fernandez Lobbe <tf...@apache.org>
Committed: Mon Jun 12 14:21:41 2017 -0700

----------------------------------------------------------------------
 solr/CHANGES.txt                                |   2 +
 .../org/apache/solr/handler/ExportWriter.java   | 105 +++++++---
 .../collection1/conf/schema-sortingresponse.xml |  71 ++++++-
 .../apache/solr/response/TestExportWriter.java  | 199 ++++++++++++++++++-
 4 files changed, 328 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c51f6fae/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index e9a22db..9135cfa 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -360,6 +360,8 @@ Bug Fixes
 
 * SOLR-10715: /v2/ should not be an alias for /v2/collections (Cao Manh Dat)
 
+* SOLR-10835: Add support for point fields in Export Handler (Tomás Fernández Löbbe)
+
 Optimizations
 ----------------------
 * SOLR-10634: JSON Facet API: When a field/terms facet will retrieve all buckets (i.e. limit:-1)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c51f6fae/solr/core/src/java/org/apache/solr/handler/ExportWriter.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/ExportWriter.java b/solr/core/src/java/org/apache/solr/handler/ExportWriter.java
index 46ec3a4..61f937c 100644
--- a/solr/core/src/java/org/apache/solr/handler/ExportWriter.java
+++ b/solr/core/src/java/org/apache/solr/handler/ExportWriter.java
@@ -17,6 +17,10 @@
 
 package org.apache.solr.handler;
 
+import static java.util.Collections.singletonList;
+import static java.util.Collections.singletonMap;
+import static org.apache.solr.common.util.Utils.makeMap;
+
 import java.io.Closeable;
 import java.io.IOException;
 import java.io.OutputStream;
@@ -26,6 +30,7 @@ import java.lang.invoke.MethodHandles;
 import java.nio.charset.StandardCharsets;
 import java.util.Date;
 import java.util.List;
+import java.util.function.LongFunction;
 
 import org.apache.lucene.index.DocValues;
 import org.apache.lucene.index.IndexableField;
@@ -34,6 +39,7 @@ import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.MultiDocValues;
 import org.apache.lucene.index.NumericDocValues;
 import org.apache.lucene.index.SortedDocValues;
+import org.apache.lucene.index.SortedNumericDocValues;
 import org.apache.lucene.index.SortedSetDocValues;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.Sort;
@@ -44,6 +50,7 @@ import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.CharsRefBuilder;
 import org.apache.lucene.util.FixedBitSet;
 import org.apache.lucene.util.LongValues;
+import org.apache.lucene.util.NumericUtils;
 import org.apache.solr.client.solrj.impl.BinaryResponseParser;
 import org.apache.solr.common.IteratorWriter;
 import org.apache.solr.common.MapWriter;
@@ -60,25 +67,21 @@ import org.apache.solr.response.JSONResponseWriter;
 import org.apache.solr.response.QueryResponseWriter;
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.solr.schema.BoolField;
+import org.apache.solr.schema.DateValueFieldType;
+import org.apache.solr.schema.DoubleValueFieldType;
 import org.apache.solr.schema.FieldType;
+import org.apache.solr.schema.FloatValueFieldType;
 import org.apache.solr.schema.IndexSchema;
+import org.apache.solr.schema.IntValueFieldType;
+import org.apache.solr.schema.LongValueFieldType;
 import org.apache.solr.schema.SchemaField;
 import org.apache.solr.schema.StrField;
-import org.apache.solr.schema.TrieDateField;
-import org.apache.solr.schema.TrieDoubleField;
-import org.apache.solr.schema.TrieFloatField;
-import org.apache.solr.schema.TrieIntField;
-import org.apache.solr.schema.TrieLongField;
 import org.apache.solr.search.SolrIndexSearcher;
 import org.apache.solr.search.SortSpec;
 import org.apache.solr.search.SyntaxError;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static java.util.Collections.singletonList;
-import static java.util.Collections.singletonMap;
-import static org.apache.solr.common.util.Utils.makeMap;
-
 public class ExportWriter implements SolrCore.RawWriter, Closeable {
   private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
   private OutputStreamWriter respWriter;
@@ -322,25 +325,25 @@ public class ExportWriter implements SolrCore.RawWriter, Closeable {
 
       boolean multiValued = schemaField.multiValued();
       FieldType fieldType = schemaField.getType();
-      if (fieldType instanceof TrieIntField) {
+      if (fieldType instanceof IntValueFieldType) {
         if (multiValued) {
           writers[i] = new MultiFieldWriter(field, fieldType, schemaField, true);
         } else {
           writers[i] = new IntFieldWriter(field);
         }
-      } else if (fieldType instanceof TrieLongField) {
+      } else if (fieldType instanceof LongValueFieldType) {
         if (multiValued) {
           writers[i] = new MultiFieldWriter(field, fieldType, schemaField, true);
         } else {
           writers[i] = new LongFieldWriter(field);
         }
-      } else if (fieldType instanceof TrieFloatField) {
+      } else if (fieldType instanceof FloatValueFieldType) {
         if (multiValued) {
           writers[i] = new MultiFieldWriter(field, fieldType, schemaField, true);
         } else {
           writers[i] = new FloatFieldWriter(field);
         }
-      } else if (fieldType instanceof TrieDoubleField) {
+      } else if (fieldType instanceof DoubleValueFieldType) {
         if (multiValued) {
           writers[i] = new MultiFieldWriter(field, fieldType, schemaField, true);
         } else {
@@ -352,7 +355,7 @@ public class ExportWriter implements SolrCore.RawWriter, Closeable {
         } else {
           writers[i] = new StringFieldWriter(field, fieldType);
         }
-      } else if (fieldType instanceof TrieDateField) {
+      } else if (fieldType instanceof DateValueFieldType) {
         if (multiValued) {
           writers[i] = new MultiFieldWriter(field, fieldType, schemaField, false);
         } else {
@@ -385,25 +388,25 @@ public class ExportWriter implements SolrCore.RawWriter, Closeable {
         throw new IOException(field+" must have DocValues to use this feature.");
       }
 
-      if(ft instanceof TrieIntField) {
+      if(ft instanceof IntValueFieldType) {
         if(reverse) {
           sortValues[i] = new IntValue(field, new IntDesc());
         } else {
           sortValues[i] = new IntValue(field, new IntAsc());
         }
-      } else if(ft instanceof TrieFloatField) {
+      } else if(ft instanceof FloatValueFieldType) {
         if(reverse) {
           sortValues[i] = new FloatValue(field, new FloatDesc());
         } else {
           sortValues[i] = new FloatValue(field, new FloatAsc());
         }
-      } else if(ft instanceof TrieDoubleField) {
+      } else if(ft instanceof DoubleValueFieldType) {
         if(reverse) {
           sortValues[i] = new DoubleValue(field, new DoubleDesc());
         } else {
           sortValues[i] = new DoubleValue(field, new DoubleAsc());
         }
-      } else if(ft instanceof TrieLongField) {
+      } else if(ft instanceof LongValueFieldType) {
         if(reverse) {
           sortValues[i] = new LongValue(field, new LongDesc());
         } else {
@@ -417,7 +420,7 @@ public class ExportWriter implements SolrCore.RawWriter, Closeable {
         } else {
           sortValues[i] = new StringValue(vals, field, new IntAsc());
         }
-      } else if (ft instanceof TrieDateField) {
+      } else if (ft instanceof DateValueFieldType) {
         if (reverse) {
           sortValues[i] = new LongValue(field, new LongDesc());
         } else {
@@ -1352,6 +1355,23 @@ public class ExportWriter implements SolrCore.RawWriter, Closeable {
       return true;
     }
   }
+  
+  static LongFunction<Object> bitsToValue(FieldType fieldType) {
+    switch (fieldType.getNumberType()) {
+      case LONG:
+        return (bits)-> bits;
+      case DATE:
+        return (bits)-> new Date(bits);
+      case INTEGER:
+        return (bits)-> (int)bits;
+      case FLOAT:
+        return (bits)-> NumericUtils.sortableIntToFloat((int)bits);
+      case DOUBLE:
+        return (bits)-> NumericUtils.sortableLongToDouble(bits);
+      default:
+        throw new AssertionError("Unsupported NumberType: " + fieldType.getNumberType());
+    }
+  }
 
   class MultiFieldWriter extends FieldWriter {
     private String field;
@@ -1359,29 +1379,48 @@ public class ExportWriter implements SolrCore.RawWriter, Closeable {
     private SchemaField schemaField;
     private boolean numeric;
     private CharsRefBuilder cref = new CharsRefBuilder();
+    private final LongFunction<Object> bitsToValue;
 
     public MultiFieldWriter(String field, FieldType fieldType, SchemaField schemaField, boolean numeric) {
       this.field = field;
       this.fieldType = fieldType;
       this.schemaField = schemaField;
       this.numeric = numeric;
+      if (this.fieldType.isPointField()) {
+        bitsToValue = bitsToValue(fieldType);
+      } else {
+        bitsToValue = null;
+      }
     }
 
     public boolean write(int docId, LeafReader reader, EntryWriter out, int fieldIndex) throws IOException {
-      SortedSetDocValues vals = DocValues.getSortedSet(reader, this.field);
-      if (vals.advance(docId) != docId) return false;
-      out.put(this.field,
-          (IteratorWriter) w -> {
-            long o;
-            while((o = vals.nextOrd()) != SortedSetDocValues.NO_MORE_ORDS) {
-              BytesRef ref = vals.lookupOrd(o);
-              fieldType.indexedToReadable(ref, cref);
-              IndexableField f = fieldType.createField(schemaField, cref.toString());
-              if (f == null) w.add(cref.toString());
-              else w.add(fieldType.toObject(f));
-            }
-          });
-      return true;
+      if (this.fieldType.isPointField()) {
+        SortedNumericDocValues vals = DocValues.getSortedNumeric(reader, this.field);
+        if (!vals.advanceExact(docId)) return false;
+        out.put(this.field,
+            (IteratorWriter) w -> {
+              for (int i = 0; i < vals.docValueCount(); i++) {
+                w.add(bitsToValue.apply(vals.nextValue()));
+              }
+            });
+        return true;
+      } else {
+        SortedSetDocValues vals = DocValues.getSortedSet(reader, this.field);
+        if (vals.advance(docId) != docId) return false;
+        out.put(this.field,
+            (IteratorWriter) w -> {
+              long o;
+              while((o = vals.nextOrd()) != SortedSetDocValues.NO_MORE_ORDS) {
+                BytesRef ref = vals.lookupOrd(o);
+                fieldType.indexedToReadable(ref, cref);
+                IndexableField f = fieldType.createField(schemaField, cref.toString());
+                if (f == null) w.add(cref.toString());
+                else w.add(fieldType.toObject(f));
+              }
+            });
+        return true;
+      }
+      
     }
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c51f6fae/solr/core/src/test-files/solr/collection1/conf/schema-sortingresponse.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-sortingresponse.xml b/solr/core/src/test-files/solr/collection1/conf/schema-sortingresponse.xml
index ecf0daf..6ec93fa 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-sortingresponse.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-sortingresponse.xml
@@ -26,6 +26,14 @@
        seconds part (.999) is optional.
     -->
   <fieldType name="date" class="solr.TrieDateField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+  
+  <!-- Point Fields -->
+  <fieldType name="pint" class="solr.IntPointField" docValues="true"/>
+  <fieldType name="plong" class="solr.LongPointField" docValues="true"/>
+  <fieldType name="pdouble" class="solr.DoublePointField" docValues="true"/>
+  <fieldType name="pfloat" class="solr.FloatPointField" docValues="true"/>
+  <fieldType name="pdate" class="solr.DatePointField" docValues="true"/>
+  
 
   <fieldType name="boolean" class="solr.BoolField"/>
   <fieldType name="string" class="solr.StrField"/>
@@ -33,20 +41,63 @@
   <fieldType name="uuid" class="solr.UUIDField"/>
 
   <field name="id" type="string" required="true" indexed="true"/>
-  <field name="floatdv_m" type="float" indexed="false" stored="false" docValues="true" multiValued="true"/>
-  <field name="intdv_m" type="int" indexed="false" stored="false" docValues="true" multiValued="true"/>
-  <field name="doubledv_m" type="double" indexed="false" stored="false" docValues="true" multiValued="true"/>
-  <field name="longdv_m" type="long" indexed="false" stored="false" docValues="true" multiValued="true"/>
-  <field name="datedv_m" type="date" indexed="false" stored="false" docValues="true" multiValued="true"/>
+  <field name="floatdv_m" type="${solr.tests.floatClass:pfloat}" indexed="false" stored="false" docValues="true" multiValued="true"/>
+  <field name="intdv_m" type="${solr.tests.intClass:pint}" indexed="false" stored="false" docValues="true" multiValued="true"/>
+  <field name="doubledv_m" type="${solr.tests.doubleClass:pdouble}" indexed="false" stored="false" docValues="true" multiValued="true"/>
+  <field name="longdv_m" type="${solr.tests.longClass:plong}" indexed="false" stored="false" docValues="true" multiValued="true"/>
+  <field name="datedv_m" type="${solr.tests.dateClass:pdate}" indexed="false" stored="false" docValues="true" multiValued="true"/>
   <field name="stringdv_m" type="string" indexed="false" stored="false" docValues="true" multiValued="true"/>
 
-  <field name="floatdv" type="float" indexed="false" stored="false" docValues="true"/>
-  <field name="intdv" type="int" indexed="false" stored="false" docValues="true"/>
-  <field name="doubledv" type="double" indexed="false" stored="false" docValues="true"/>
-  <field name="longdv" type="long" indexed="false" stored="false" docValues="true"/>
-  <field name="datedv" type="date" indexed="false" stored="false" docValues="true"/>
+  <field name="floatdv" type="${solr.tests.floatClass:pfloat}" indexed="false" stored="false" docValues="true"/>
+  <field name="intdv" type="${solr.tests.intClass:pint}" indexed="false" stored="false" docValues="true"/>
+  <field name="doubledv" type="${solr.tests.doubleClass:pdouble}" indexed="false" stored="false" docValues="true"/>
+  <field name="longdv" type="${solr.tests.longClass:plong}" indexed="false" stored="false" docValues="true"/>
+  <field name="datedv" type="${solr.tests.dateClass:pdate}" indexed="false" stored="false" docValues="true"/>
   <field name="stringdv" type="string" indexed="false" stored="false" docValues="true"/>
 
+   <!-- Point fields explicitly -->
+   <dynamicField name="*_i_p"      type="pint"    indexed="true"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_is_p"      type="pint"    indexed="true"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_i_ni_p"   type="pint"    indexed="false"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_is_ni_p"   type="pint"    indexed="false"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_l_p"      type="plong"    indexed="true"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_ls_p"      type="plong"    indexed="true"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_l_ni_p"   type="plong"    indexed="false"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_ls_ni_p"   type="plong"    indexed="false"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_f_p"      type="pfloat"    indexed="true"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_fs_p"      type="pfloat"    indexed="true"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_f_ni_p"   type="pfloat"    indexed="false"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_fs_ni_p"   type="pfloat"    indexed="false"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_d_p"      type="pdouble"    indexed="true"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_ds_p"      type="pdouble"    indexed="true"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_d_ni_p"   type="pdouble"    indexed="false"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_ds_ni_p"   type="pdouble"    indexed="false"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_dt_p"      type="pdate"    indexed="true"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_dts_p"      type="pdate"    indexed="true"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_dt_ni_p"   type="pdate"    indexed="false"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_dts_ni_p"   type="pdate"    indexed="false"  stored="true" docValues="true" multiValued="true"/>
+   
+   <!-- Trie fields explicitly -->
+   <dynamicField name="*_i_t"      type="int"    indexed="true"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_is_t"      type="int"    indexed="true"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_i_ni_t"   type="int"    indexed="false"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_is_ni_t"   type="int"    indexed="false"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_l_t"      type="long"    indexed="true"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_ls_t"      type="long"    indexed="true"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_l_ni_t"   type="long"    indexed="false"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_ls_ni_t"   type="long"    indexed="false"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_f_t"      type="float"    indexed="true"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_fs_t"      type="float"    indexed="true"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_f_ni_t"   type="float"    indexed="false"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_fs_ni_t"   type="float"    indexed="false"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_d_t"      type="double"    indexed="true"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_ds_t"      type="double"    indexed="true"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_d_ni_t"   type="double"    indexed="false"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_ds_ni_t"   type="double"    indexed="false"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_dt_t"      type="date"    indexed="true"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_dts_t"      type="date"    indexed="true"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_dt_ni_t"   type="date"    indexed="false"  stored="true" docValues="true" multiValued="false"/>
+   <dynamicField name="*_dts_ni_t"   type="date"    indexed="false"  stored="true" docValues="true" multiValued="true"/>
 
   <uniqueKey>id</uniqueKey>
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c51f6fae/solr/core/src/test/org/apache/solr/response/TestExportWriter.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/response/TestExportWriter.java b/solr/core/src/test/org/apache/solr/response/TestExportWriter.java
index 5a303e9..c556787 100644
--- a/solr/core/src/test/org/apache/solr/response/TestExportWriter.java
+++ b/solr/core/src/test/org/apache/solr/response/TestExportWriter.java
@@ -16,17 +16,40 @@
  */
 package org.apache.solr.response;
 
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Set;
+
+import org.apache.lucene.index.LeafReader;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.util.SuppressForbidden;
 import org.apache.solr.common.util.Utils;
-import org.junit.*;
-import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
+import org.apache.solr.schema.SchemaField;
+import org.apache.solr.search.SolrIndexSearcher;
+import org.apache.solr.util.RefCounted;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
 
-@SuppressCodecs({"Lucene3x", "Lucene40","Lucene41","Lucene42","Lucene45"})
 public class TestExportWriter extends SolrTestCaseJ4 {
+  
   @BeforeClass
   public static void beforeClass() throws Exception {
     System.setProperty("export.test", "true");
     initCore("solrconfig-sortingresponse.xml","schema-sortingresponse.xml");
+  }
+
+  @Before
+  @Override
+  public void setUp() throws Exception {
+    super.setUp();
+    assertU(delQ("*:*"));
+    assertU(commit());
     createIndex();
   }
 
@@ -47,7 +70,12 @@ public class TestExportWriter extends SolrTestCaseJ4 {
                  "longdv_m", "343332",
                  "stringdv_m", "manchester \"city\"",
                  "stringdv_m", "liverpool",
-                 "stringdv_m", "Everton"));
+                 "stringdv_m", "Everton",
+                 "datedv", "2017-06-16T07:00:00Z",
+                 "datedv_m", "2017-06-16T01:00:00Z",
+                 "datedv_m", "2017-06-16T02:00:00Z",
+                 "datedv_m", "2017-06-16T03:00:00Z",
+                 "datedv_m", "2017-06-16T04:00:00Z"));
 
     assertU(adoc("id","7",
         "floatdv","2.1",
@@ -80,7 +108,11 @@ public class TestExportWriter extends SolrTestCaseJ4 {
         "longdv_m", "343332",
         "stringdv_m", "manchester \"city\"",
         "stringdv_m", "liverpool",
-        "stringdv_m", "everton"));
+        "stringdv_m", "everton",
+        "int_is_t", "1",
+        "int_is_t", "1",
+        "int_is_t", "1",
+        "int_is_t", "1"));
     assertU(commit());
     assertU(adoc("id","8",
         "floatdv","2.1",
@@ -98,7 +130,14 @@ public class TestExportWriter extends SolrTestCaseJ4 {
         "longdv_m", "343332",
         "stringdv_m", "manchester \"city\"",
         "stringdv_m", "liverpool",
-        "stringdv_m", "everton"));
+        "stringdv_m", "everton",
+        "datedv", "2017-01-01T00:00:00Z",
+        "datedv_m", "2017-01-01T01:00:00Z",
+        "datedv_m", "2017-01-01T02:00:00Z",
+        "int_is_p", "1",
+        "int_is_p", "1",
+        "int_is_p", "1",
+        "int_is_p", "1"));
     assertU(commit());
 
 
@@ -192,4 +231,152 @@ public class TestExportWriter extends SolrTestCaseJ4 {
     // Interesting you don't even need to specify a "q" parameter.
     
   }
+  
+  @Test
+  public void testDates() throws Exception {
+    String s =  h.query(req("q", "id:1", "qt", "/export", "fl", "datedv", "sort", "datedv asc"));
+    assertJsonEquals(s, "{\"responseHeader\": {\"status\": 0}, \"response\":{\"numFound\":1, \"docs\":[{\"datedv\":\"2017-06-16T07:00:00Z\"}]}}");
+    s =  h.query(req("q", "id:1", "qt", "/export", "fl", "datedv_m", "sort", "datedv asc"));
+    assertJsonEquals(s, "{\"responseHeader\": {\"status\": 0}, \"response\":{\"numFound\":1, \"docs\":[{\"datedv_m\":[\"2017-06-16T01:00:00Z\",\"2017-06-16T02:00:00Z\",\"2017-06-16T03:00:00Z\",\"2017-06-16T04:00:00Z\"]}]}}");
+  }
+  
+  @Test
+  public void testDuplicates() throws Exception {
+    RefCounted<SolrIndexSearcher> ref = null;
+    try {
+      ref = h.getCore().getSearcher();
+      LeafReader reader = ref.get().getSlowAtomicReader();
+      // MultiValued Trie fields use SortedSet
+      assertNotNull(reader.getSortedSetDocValues("int_is_t"));
+      assertNull(reader.getSortedNumericDocValues("int_is_t"));
+      // MultiValued Point fields use SortedNumerics
+      assertNull(reader.getSortedSetDocValues("int_is_p"));
+      assertNotNull(reader.getSortedNumericDocValues("int_is_p"));
+    } finally {
+      if (ref != null) ref.decref();
+    }
+    String s =  h.query(req("q", "id:3", "qt", "/export", "fl", "int_is_t", "sort", "intdv asc"));
+    assertJsonEquals(s, "{\"responseHeader\": {\"status\": 0}, \"response\":{\"numFound\":1, \"docs\":[{\"int_is_t\":[1]}]}}");
+    s =  h.query(req("q", "id:8", "qt", "/export", "fl", "int_is_p", "sort", "intdv asc"));
+    assertJsonEquals(s, "{\"responseHeader\": {\"status\": 0}, \"response\":{\"numFound\":1, \"docs\":[{\"int_is_p\":[1,1,1,1]}]}}");
+  }
+  
+  /**
+   * This test doesn't validate the correctness of results, it just compares the response of the same request
+   * when asking for Trie fields vs Point fields. Can be removed once Trie fields are no longer supported
+   */
+  @Test
+  @SuppressForbidden(reason="using new Date(time) to create random dates")
+  public void testRandomNumerics() throws Exception {
+    assertU(delQ("*:*"));
+    assertU(commit());
+    List<String> trieFields = new ArrayList<String>();
+    List<String> pointFields = new ArrayList<String>();
+    for (String mv:new String[]{"s", ""}) {
+      for (String indexed:new String[]{"_ni", ""}) {
+        for (String type:new String[]{"i", "l", "f", "d", "dt"}) {
+          String field = "number_" + type + mv + indexed;
+          SchemaField sf = h.getCore().getLatestSchema().getField(field + "_t");
+          assertTrue(sf.hasDocValues());
+          assertTrue(sf.getType().getNumberType() != null);
+          assertFalse(sf.getType().isPointField());
+          
+          sf = h.getCore().getLatestSchema().getField(field + "_p");
+          assertTrue(sf.hasDocValues());
+          assertTrue(sf.getType().getNumberType() != null);
+          assertTrue(sf.getType().isPointField());
+          
+          trieFields.add(field + "_t");
+          pointFields.add(field + "_p");
+        }
+      }
+    }
+    for (int i = 0; i < atLeast(100); i++) {
+      if (random().nextInt(20) == 0) {
+        //have some empty docs
+        assertU(adoc("id", String.valueOf(i)));
+        continue;
+      }
+
+      if (random().nextInt(20) == 0 && i > 0) {
+        //delete some docs
+        assertU(delI(String.valueOf(i - 1)));
+      }
+      
+      SolrInputDocument doc = new SolrInputDocument();
+      doc.addField("id", String.valueOf(i));
+      addInt(doc, random().nextInt(), false);
+      addLong(doc, random().nextLong(), false);
+      addFloat(doc, random().nextFloat() * 3000 * (random().nextBoolean()?1:-1), false);
+      addDouble(doc, random().nextDouble() * 3000 * (random().nextBoolean()?1:-1), false);
+      addDate(doc, new Date(), false);
+
+      // MV need to be unique in order to be the same in Trie vs Points
+      Set<Integer> ints = new HashSet<>();
+      Set<Long> longs = new HashSet<>();
+      Set<Float> floats = new HashSet<>();
+      Set<Double> doubles = new HashSet<>();
+      Set<Date> dates = new HashSet<>();
+      for (int j=0; j < random().nextInt(20); j++) {
+        ints.add(random().nextInt());
+        longs.add(random().nextLong());
+        floats.add(random().nextFloat() * 3000 * (random().nextBoolean()?1:-1));
+        doubles.add(random().nextDouble() * 3000 * (random().nextBoolean()?1:-1));
+        dates.add(new Date(System.currentTimeMillis() + random().nextInt()));
+      }
+      ints.stream().forEach((val)->addInt(doc, val, true));
+      longs.stream().forEach((val)->addLong(doc, val, true));
+      floats.stream().forEach((val)->addFloat(doc, val, true));
+      doubles.stream().forEach((val)->addDouble(doc, val, true));
+      dates.stream().forEach((val)->addDate(doc, val, true));
+      
+      assertU(adoc(doc));
+      if (random().nextInt(20) == 0) {
+        assertU(commit());
+      }
+    }
+    assertU(commit());
+    doTestQuery("id:1", trieFields, pointFields);
+    doTestQuery("*:*", trieFields, pointFields);
+    doTestQuery("id:[0 TO 2]", trieFields, pointFields);// "id" field is really a string, this is not a numeric range query
+    doTestQuery("id:[0 TO 9]", trieFields, pointFields);
+    doTestQuery("id:DOES_NOT_EXIST", trieFields, pointFields);
+  }
+
+  private void doTestQuery(String query, List<String> trieFields, List<String> pointFields) throws Exception {
+    String trieFieldsFl = String.join(",", trieFields);
+    String pointFieldsFl = String.join(",", pointFields);
+    String sort = pickRandom((String)pickRandom(trieFields.toArray()), (String)pickRandom(pointFields.toArray())).replace("s_", "_") + pickRandom(" asc", " desc");
+    String resultPoints =  h.query(req("q", query, "qt", "/export", "fl", pointFieldsFl, "sort", sort));
+    String resultTries =  h.query(req("q", query, "qt", "/export", "fl", trieFieldsFl, "sort", sort));
+    assertJsonEquals(resultPoints.replaceAll("_p", ""), resultTries.replaceAll("_t", ""));
+  }
+
+  private void addFloat(SolrInputDocument doc, float value, boolean mv) {
+    addField(doc, "f", String.valueOf(value), mv);
+  }
+
+  private void addDouble(SolrInputDocument doc, double value, boolean mv) {
+    addField(doc, "d", String.valueOf(value), mv);
+  }
+
+  private void addLong(SolrInputDocument doc, long value, boolean mv) {
+    addField(doc, "l", String.valueOf(value), mv);
+  }
+
+  private void addInt(SolrInputDocument doc, int value, boolean mv) {
+    addField(doc, "i", String.valueOf(value), mv);
+  }
+  
+  private void addDate(SolrInputDocument doc, Date value, boolean mv) {
+    addField(doc, "dt", new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.ROOT).format(value), mv);
+  }
+  
+  private void addField(SolrInputDocument doc, String type, String value, boolean mv) {
+    doc.addField("number_" + type + (mv?"s":"") + "_t", value);
+    doc.addField("number_" + type + (mv?"s":"") + "_p", value);
+    doc.addField("number_" + type + (mv?"s":"") + "_ni_t", value);
+    doc.addField("number_" + type + (mv?"s":"") + "_ni_p", value);
+  }
+
 }


[25/35] lucene-solr:jira/SOLR-10834: SOLR-10830: Solr now correctly enforces that the '_root_' field has the same fieldType as the uniqueKey field

Posted by ho...@apache.org.
SOLR-10830: Solr now correctly enforces that the '_root_' field has the same fieldType as the uniqueKey field


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

Branch: refs/heads/jira/SOLR-10834
Commit: 6396cb759f8c799f381b0730636fa412761030ce
Parents: e503325
Author: Chris Hostetter <ho...@apache.org>
Authored: Tue Jun 13 10:17:32 2017 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Tue Jun 13 10:17:32 2017 -0700

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  4 +
 .../apache/solr/schema/DoublePointField.java    | 10 +--
 .../org/apache/solr/schema/FloatPointField.java | 10 +--
 .../org/apache/solr/schema/IndexSchema.java     | 31 ++++++-
 .../org/apache/solr/schema/IntPointField.java   | 10 +--
 .../org/apache/solr/schema/LongPointField.java  | 10 +--
 .../apache/solr/schema/NumericFieldType.java    | 88 +++++++++++++++++---
 .../java/org/apache/solr/schema/PointField.java |  7 +-
 .../java/org/apache/solr/schema/TrieField.java  | 60 ++++++-------
 .../apache/solr/update/AddUpdateCommand.java    |  8 +-
 .../solr/update/DirectUpdateHandler2.java       |  3 +-
 .../org/apache/solr/update/DocumentBuilder.java |  8 +-
 ...-schema-uniquekey-diff-type-dynamic-root.xml | 36 ++++++++
 .../bad-schema-uniquekey-diff-type-root.xml     | 35 ++++++++
 .../test-files/solr/collection1/conf/schema.xml | 16 +++-
 .../solr/collection1/conf/schema11.xml          |  4 +
 .../solr/collection1/conf/schema12.xml          | 23 ++++-
 .../solr/configsets/cloud-hdfs/conf/schema.xml  |  2 +-
 .../conf/managed-schema                         |  2 +-
 .../cloud-managed-upgrade/conf/schema.xml       |  2 +-
 .../cloud-managed/conf/managed-schema           |  2 +-
 .../cloud-minimal-jmx/conf/schema.xml           |  2 +-
 .../configsets/cloud-minimal/conf/schema.xml    |  2 +-
 .../configsets/cloud-subdirs/conf/schema.xml    |  2 +-
 .../exitable-directory/conf/schema.xml          |  2 +-
 .../org/apache/solr/BasicFunctionalityTest.java | 77 ++++++++++++++++-
 .../apache/solr/schema/BadIndexSchemaTest.java  | 15 ++++
 .../org/apache/solr/search/TestQueryTypes.java  | 46 +++++++++-
 .../apache/solr/search/TestSolrQueryParser.java | 36 ++++++++
 29 files changed, 467 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index d2a26c0..c1c7293 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -156,6 +156,10 @@ Bug Fixes
 
 * SOLR-10223: Allow running examples as root on Linux with -force option (janhoy)
 
+* SOLR-10830: Solr now correctly enforces that the '_root_' field has the same fieldType as the
+  uniqueKey field.  With out this enforcement, child document updating was unreliable. (hossman)
+
+
 Optimizations
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/java/org/apache/solr/schema/DoublePointField.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/DoublePointField.java b/solr/core/src/java/org/apache/solr/schema/DoublePointField.java
index 05a1ce7..d2cf6ed 100644
--- a/solr/core/src/java/org/apache/solr/schema/DoublePointField.java
+++ b/solr/core/src/java/org/apache/solr/schema/DoublePointField.java
@@ -61,7 +61,7 @@ public class DoublePointField extends PointField implements DoubleValueFieldType
     if (min == null) {
       actualMin = Double.NEGATIVE_INFINITY;
     } else {
-      actualMin = Double.parseDouble(min);
+      actualMin = parseDoubleFromUser(field.getName(), min);
       if (!minInclusive) {
         actualMin = DoublePoint.nextUp(actualMin);
       }
@@ -69,7 +69,7 @@ public class DoublePointField extends PointField implements DoubleValueFieldType
     if (max == null) {
       actualMax = Double.POSITIVE_INFINITY;
     } else {
-      actualMax = Double.parseDouble(max);
+      actualMax = parseDoubleFromUser(field.getName(), max);
       if (!maxInclusive) {
         actualMax = DoublePoint.nextDown(actualMax);
       }
@@ -100,7 +100,7 @@ public class DoublePointField extends PointField implements DoubleValueFieldType
 
   @Override
   protected Query getExactQuery(SchemaField field, String externalVal) {
-    return DoublePoint.newExactQuery(field.getName(), Double.parseDouble(externalVal));
+    return DoublePoint.newExactQuery(field.getName(), parseDoubleFromUser(field.getName(), externalVal));
   }
 
   @Override
@@ -112,7 +112,7 @@ public class DoublePointField extends PointField implements DoubleValueFieldType
     double[] values = new double[externalVal.size()];
     int i = 0;
     for (String val:externalVal) {
-      values[i] = Double.parseDouble(val);
+      values[i] = parseDoubleFromUser(field.getName(), val);
       i++;
     }
     return DoublePoint.newSetQuery(field.getName(), values);
@@ -127,7 +127,7 @@ public class DoublePointField extends PointField implements DoubleValueFieldType
   public void readableToIndexed(CharSequence val, BytesRefBuilder result) {
     result.grow(Double.BYTES);
     result.setLength(Double.BYTES);
-    DoublePoint.encodeDimension(Double.parseDouble(val.toString()), result.bytes(), 0);
+    DoublePoint.encodeDimension(parseDoubleFromUser(null, val.toString()), result.bytes(), 0);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/java/org/apache/solr/schema/FloatPointField.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/FloatPointField.java b/solr/core/src/java/org/apache/solr/schema/FloatPointField.java
index fe9c753..e1a9741 100644
--- a/solr/core/src/java/org/apache/solr/schema/FloatPointField.java
+++ b/solr/core/src/java/org/apache/solr/schema/FloatPointField.java
@@ -61,7 +61,7 @@ public class FloatPointField extends PointField implements FloatValueFieldType {
     if (min == null) {
       actualMin = Float.NEGATIVE_INFINITY;
     } else {
-      actualMin = Float.parseFloat(min);
+      actualMin = parseFloatFromUser(field.getName(), min);
       if (!minInclusive) {
         actualMin = FloatPoint.nextUp(actualMin);
       }
@@ -69,7 +69,7 @@ public class FloatPointField extends PointField implements FloatValueFieldType {
     if (max == null) {
       actualMax = Float.POSITIVE_INFINITY;
     } else {
-      actualMax = Float.parseFloat(max);
+      actualMax = parseFloatFromUser(field.getName(), max);
       if (!maxInclusive) {
         actualMax = FloatPoint.nextDown(actualMax);
       }
@@ -100,7 +100,7 @@ public class FloatPointField extends PointField implements FloatValueFieldType {
 
   @Override
   protected Query getExactQuery(SchemaField field, String externalVal) {
-    return FloatPoint.newExactQuery(field.getName(), Float.parseFloat(externalVal));
+    return FloatPoint.newExactQuery(field.getName(), parseFloatFromUser(field.getName(), externalVal));
   }
 
   @Override
@@ -112,7 +112,7 @@ public class FloatPointField extends PointField implements FloatValueFieldType {
     float[] values = new float[externalVal.size()];
     int i = 0;
     for (String val:externalVal) {
-      values[i] = Float.parseFloat(val);
+      values[i] = parseFloatFromUser(field.getName(), val);
       i++;
     }
     return FloatPoint.newSetQuery(field.getName(), values);
@@ -127,7 +127,7 @@ public class FloatPointField extends PointField implements FloatValueFieldType {
   public void readableToIndexed(CharSequence val, BytesRefBuilder result) {
     result.grow(Float.BYTES);
     result.setLength(Float.BYTES);
-    FloatPoint.encodeDimension(Float.parseFloat(val.toString()), result.bytes(), 0);
+    FloatPoint.encodeDimension(parseFloatFromUser(null, val.toString()), result.bytes(), 0);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/IndexSchema.java b/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
index 463df3e..36efbcf 100644
--- a/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
+++ b/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
@@ -113,6 +113,7 @@ public class IndexSchema {
   public static final String SOURCE = "source";
   public static final String TYPE = "type";
   public static final String TYPES = "types";
+  public static final String ROOT_FIELD_NAME = "_root_";
   public static final String UNIQUE_KEY = "uniqueKey";
   public static final String VERSION = "version";
 
@@ -517,6 +518,20 @@ public class IndexSchema {
         log.warn("no " + UNIQUE_KEY + " specified in schema.");
       } else {
         uniqueKeyField=getIndexedField(node.getNodeValue().trim());
+        uniqueKeyFieldName=uniqueKeyField.getName();
+        uniqueKeyFieldType=uniqueKeyField.getType();
+        
+        // we fail on init if the ROOT field is *explicitly* defined as incompatible with uniqueKey
+        // we don't want ot fail if there happens to be a dynamicField matching ROOT, (ie: "*")
+        // because the user may not care about child docs at all.  The run time code
+        // related to child docs can catch that if it happens
+        if (fields.containsKey(ROOT_FIELD_NAME) && ! isUsableForChildDocs()) {
+          String msg = ROOT_FIELD_NAME + " field must be defined using the exact same fieldType as the " +
+            UNIQUE_KEY + " field ("+uniqueKeyFieldName+") uses: " + uniqueKeyFieldType.getTypeName();
+          log.error(msg);
+          throw new SolrException(ErrorCode.SERVER_ERROR, msg);
+        }
+        
         if (null != uniqueKeyField.getDefaultValue()) {
           String msg = UNIQUE_KEY + " field ("+uniqueKeyFieldName+
               ") can not be configured with a default value ("+
@@ -542,9 +557,6 @@ public class IndexSchema {
           throw new SolrException(ErrorCode.SERVER_ERROR, msg);
         }
         
-        uniqueKeyFieldName=uniqueKeyField.getName();
-        uniqueKeyFieldType=uniqueKeyField.getType();
-
         // Unless the uniqueKeyField is marked 'required=false' then make sure it exists
         if( Boolean.FALSE != explicitRequiredProp.get( uniqueKeyFieldName ) ) {
           uniqueKeyField.required = true;
@@ -1914,4 +1926,17 @@ public class IndexSchema {
         + XPATH_OR + stepsToPath(SCHEMA, TYPES, FIELD_TYPE);
     return expression;
   }
+
+  /**
+   * Helper method that returns <code>true</code> if the {@link #ROOT_FIELD_NAME} uses the exact 
+   * same 'type' as the {@link #getUniqueKeyField()}
+   *
+   * @lucene.internal
+   */
+  public boolean isUsableForChildDocs() {
+    FieldType rootType = getFieldType(ROOT_FIELD_NAME);
+    return (null != uniqueKeyFieldType &&
+            null != rootType &&
+            rootType.getTypeName().equals(uniqueKeyFieldType.getTypeName()));
+  }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/java/org/apache/solr/schema/IntPointField.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/IntPointField.java b/solr/core/src/java/org/apache/solr/schema/IntPointField.java
index f47f450..7d36612 100644
--- a/solr/core/src/java/org/apache/solr/schema/IntPointField.java
+++ b/solr/core/src/java/org/apache/solr/schema/IntPointField.java
@@ -64,7 +64,7 @@ public class IntPointField extends PointField implements IntValueFieldType {
     if (min == null) {
       actualMin = Integer.MIN_VALUE;
     } else {
-      actualMin = Integer.parseInt(min);
+      actualMin = parseIntFromUser(field.getName(), min);
       if (!minInclusive) {
         actualMin++;
       }
@@ -72,7 +72,7 @@ public class IntPointField extends PointField implements IntValueFieldType {
     if (max == null) {
       actualMax = Integer.MAX_VALUE;
     } else {
-      actualMax = Integer.parseInt(max);
+      actualMax = parseIntFromUser(field.getName(), max);
       if (!maxInclusive) {
         actualMax--;
       }
@@ -97,7 +97,7 @@ public class IntPointField extends PointField implements IntValueFieldType {
 
   @Override
   protected Query getExactQuery(SchemaField field, String externalVal) {
-    return IntPoint.newExactQuery(field.getName(), Integer.parseInt(externalVal));
+    return IntPoint.newExactQuery(field.getName(), parseIntFromUser(field.getName(), externalVal));
   }
   
   @Override
@@ -109,7 +109,7 @@ public class IntPointField extends PointField implements IntValueFieldType {
     int[] values = new int[externalVal.size()];
     int i = 0;
     for (String val:externalVal) {
-      values[i] = Integer.parseInt(val);
+      values[i] = parseIntFromUser(field.getName(), val);
       i++;
     }
     return IntPoint.newSetQuery(field.getName(), values);
@@ -124,7 +124,7 @@ public class IntPointField extends PointField implements IntValueFieldType {
   public void readableToIndexed(CharSequence val, BytesRefBuilder result) {
     result.grow(Integer.BYTES);
     result.setLength(Integer.BYTES);
-    IntPoint.encodeDimension(Integer.parseInt(val.toString()), result.bytes(), 0);
+    IntPoint.encodeDimension(parseIntFromUser(null, val.toString()), result.bytes(), 0);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/java/org/apache/solr/schema/LongPointField.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/LongPointField.java b/solr/core/src/java/org/apache/solr/schema/LongPointField.java
index bef6c47..b2d8a3a 100644
--- a/solr/core/src/java/org/apache/solr/schema/LongPointField.java
+++ b/solr/core/src/java/org/apache/solr/schema/LongPointField.java
@@ -63,7 +63,7 @@ public class LongPointField extends PointField implements LongValueFieldType {
     if (min == null) {
       actualMin = Long.MIN_VALUE;
     } else {
-      actualMin = Long.parseLong(min);
+      actualMin = parseLongFromUser(field.getName(), min);
       if (!minInclusive) {
         actualMin++;
       }
@@ -71,7 +71,7 @@ public class LongPointField extends PointField implements LongValueFieldType {
     if (max == null) {
       actualMax = Long.MAX_VALUE;
     } else {
-      actualMax = Long.parseLong(max);
+      actualMax = parseLongFromUser(field.getName(), max);
       if (!maxInclusive) {
         actualMax--;
       }
@@ -96,7 +96,7 @@ public class LongPointField extends PointField implements LongValueFieldType {
 
   @Override
   protected Query getExactQuery(SchemaField field, String externalVal) {
-    return LongPoint.newExactQuery(field.getName(), Long.parseLong(externalVal));
+    return LongPoint.newExactQuery(field.getName(), parseLongFromUser(field.getName(), externalVal));
   }
   
   @Override
@@ -108,7 +108,7 @@ public class LongPointField extends PointField implements LongValueFieldType {
     long[] values = new long[externalVal.size()];
     int i = 0;
     for (String val:externalVal) {
-      values[i] = Long.parseLong(val);
+      values[i] = parseLongFromUser(field.getName(), val);
       i++;
     }
     return LongPoint.newSetQuery(field.getName(), values);
@@ -123,7 +123,7 @@ public class LongPointField extends PointField implements LongValueFieldType {
   public void readableToIndexed(CharSequence val, BytesRefBuilder result) {
     result.grow(Long.BYTES);
     result.setLength(Long.BYTES);
-    LongPoint.encodeDimension(Long.parseLong(val.toString()), result.bytes(), 0);
+    LongPoint.encodeDimension(parseLongFromUser(null, val.toString()), result.bytes(), 0);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/java/org/apache/solr/schema/NumericFieldType.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/NumericFieldType.java b/solr/core/src/java/org/apache/solr/schema/NumericFieldType.java
index 6cda9ca..cf17aaf 100644
--- a/solr/core/src/java/org/apache/solr/schema/NumericFieldType.java
+++ b/solr/core/src/java/org/apache/solr/schema/NumericFieldType.java
@@ -56,8 +56,8 @@ public abstract class NumericFieldType extends PrimitiveFieldType {
     switch (getNumberType()) {
       case INTEGER:
         return numericDocValuesRangeQuery(field.getName(),
-              min == null ? null : (long) Integer.parseInt(min),
-              max == null ? null : (long) Integer.parseInt(max),
+              min == null ? null : (long) parseIntFromUser(field.getName(), min),
+              max == null ? null : (long) parseIntFromUser(field.getName(), max),
               minInclusive, maxInclusive, field.multiValued());
       case FLOAT:
         if (field.multiValued()) {
@@ -67,8 +67,8 @@ public abstract class NumericFieldType extends PrimitiveFieldType {
         }
       case LONG:
         return numericDocValuesRangeQuery(field.getName(),
-              min == null ? null : Long.parseLong(min),
-              max == null ? null : Long.parseLong(max),
+              min == null ? null : parseLongFromUser(field.getName(), min),
+              max == null ? null : parseLongFromUser(field.getName(),max),
               minInclusive, maxInclusive, field.multiValued());
       case DOUBLE:
         if (field.multiValued()) { 
@@ -90,8 +90,8 @@ public abstract class NumericFieldType extends PrimitiveFieldType {
     Query query;
     String fieldName = sf.getName();
 
-    Number minVal = min == null ? null : getNumberType() == NumberType.FLOAT ? Float.parseFloat(min): Double.parseDouble(min);
-    Number maxVal = max == null ? null : getNumberType() == NumberType.FLOAT ? Float.parseFloat(max): Double.parseDouble(max);
+    Number minVal = min == null ? null : getNumberType() == NumberType.FLOAT ? parseFloatFromUser(sf.getName(), min): parseDoubleFromUser(sf.getName(), min);
+    Number maxVal = max == null ? null : getNumberType() == NumberType.FLOAT ? parseFloatFromUser(sf.getName(), max): parseDoubleFromUser(sf.getName(), max);
     
     Long minBits = 
         min == null ? null : getNumberType() == NumberType.FLOAT ? (long) Float.floatToIntBits(minVal.floatValue()): Double.doubleToLongBits(minVal.doubleValue());
@@ -124,14 +124,14 @@ public abstract class NumericFieldType extends PrimitiveFieldType {
   }
   
   protected Query getRangeQueryForMultiValuedDoubleDocValues(SchemaField sf, String min, String max, boolean minInclusive, boolean maxInclusive) {
-    Long minBits = min == null ? NumericUtils.doubleToSortableLong(Double.NEGATIVE_INFINITY): NumericUtils.doubleToSortableLong(Double.parseDouble(min));
-    Long maxBits = max == null ? NumericUtils.doubleToSortableLong(Double.POSITIVE_INFINITY): NumericUtils.doubleToSortableLong(Double.parseDouble(max));
+    Long minBits = min == null ? NumericUtils.doubleToSortableLong(Double.NEGATIVE_INFINITY): NumericUtils.doubleToSortableLong(parseDoubleFromUser(sf.getName(), min));
+    Long maxBits = max == null ? NumericUtils.doubleToSortableLong(Double.POSITIVE_INFINITY): NumericUtils.doubleToSortableLong(parseDoubleFromUser(sf.getName(), max));
     return numericDocValuesRangeQuery(sf.getName(), minBits, maxBits, minInclusive, maxInclusive, true);
   }
   
   protected Query getRangeQueryForMultiValuedFloatDocValues(SchemaField sf, String min, String max, boolean minInclusive, boolean maxInclusive) {
-    Long minBits = (long)(min == null ? NumericUtils.floatToSortableInt(Float.NEGATIVE_INFINITY): NumericUtils.floatToSortableInt(Float.parseFloat(min)));
-    Long maxBits = (long)(max == null ? NumericUtils.floatToSortableInt(Float.POSITIVE_INFINITY): NumericUtils.floatToSortableInt(Float.parseFloat(max)));
+    Long minBits = (long)(min == null ? NumericUtils.floatToSortableInt(Float.NEGATIVE_INFINITY): NumericUtils.floatToSortableInt(parseFloatFromUser(sf.getName(), min)));
+    Long maxBits = (long)(max == null ? NumericUtils.floatToSortableInt(Float.POSITIVE_INFINITY): NumericUtils.floatToSortableInt(parseFloatFromUser(sf.getName(), max)));
     return numericDocValuesRangeQuery(sf.getName(), minBits, maxBits, minInclusive, maxInclusive, true);
   }
   
@@ -169,4 +169,72 @@ public abstract class NumericFieldType extends PrimitiveFieldType {
       return NumericDocValuesField.newRangeQuery(field, actualLowerValue, actualUpperValue);
     }
   }
+  
+  /** 
+   * Wrapper for {@link Long#parseLong(String)} that throws a BAD_REQUEST error if the input is not valid 
+   * @param fieldName used in any exception, may be null
+   * @param val string to parse, NPE if null
+   */
+  static long parseLongFromUser(String fieldName, String val) {
+    if (val == null) {
+      throw new NullPointerException("Invalid input" + (null == fieldName ? "" : " for field " + fieldName));
+    }
+    try {
+      return Long.parseLong(val);
+    } catch (NumberFormatException e) {
+      String msg = "Invalid Number: " + val + (null == fieldName ? "" : " for field " + fieldName);
+      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, msg);
+    }
+  }
+  
+  /** 
+   * Wrapper for {@link Integer#parseInt(String)} that throws a BAD_REQUEST error if the input is not valid 
+   * @param fieldName used in any exception, may be null
+   * @param val string to parse, NPE if null
+   */
+  static int parseIntFromUser(String fieldName, String val) {
+    if (val == null) {
+      throw new NullPointerException("Invalid input" + (null == fieldName ? "" : " for field " + fieldName));
+    }
+    try {
+      return Integer.parseInt(val);
+    } catch (NumberFormatException e) {
+      String msg = "Invalid Number: " + val + (null == fieldName ? "" : " for field " + fieldName);
+      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, msg);
+    }
+  }
+  
+  /** 
+   * Wrapper for {@link Double#parseDouble(String)} that throws a BAD_REQUEST error if the input is not valid 
+   * @param fieldName used in any exception, may be null
+   * @param val string to parse, NPE if null
+   */
+  static double parseDoubleFromUser(String fieldName, String val) {
+    if (val == null) {
+      throw new NullPointerException("Invalid input" + (null == fieldName ? "" : " for field " + fieldName));
+    }
+    try {
+      return Double.parseDouble(val);
+    } catch (NumberFormatException e) {
+      String msg = "Invalid Number: " + val + (null == fieldName ? "" : " for field " + fieldName);
+      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, msg);
+    }
+  }
+  
+  /** 
+   * Wrapper for {@link Float#parseFloat(String)} that throws a BAD_REQUEST error if the input is not valid 
+   * @param fieldName used in any exception, may be null
+   * @param val string to parse, NPE if null
+   */
+  static float parseFloatFromUser(String fieldName, String val) {
+    if (val == null) {
+      throw new NullPointerException("Invalid input" + (null == fieldName ? "" : " for field " + fieldName));
+    }
+    try {
+      return Float.parseFloat(val);
+    } catch (NumberFormatException e) {
+      String msg = "Invalid Number: " + val + (null == fieldName ? "" : " for field " + fieldName);
+      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, msg);
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/java/org/apache/solr/schema/PointField.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/PointField.java b/solr/core/src/java/org/apache/solr/schema/PointField.java
index cad3c7e..98105af 100644
--- a/solr/core/src/java/org/apache/solr/schema/PointField.java
+++ b/solr/core/src/java/org/apache/solr/schema/PointField.java
@@ -127,7 +127,7 @@ public abstract class PointField extends NumericFieldType {
       return new IndexOrDocValuesQuery(pointsQuery, dvQuery);
     } else {
       return getExactQuery(field, externalVal);
-    }
+    } 
   }
 
   protected abstract Query getExactQuery(SchemaField field, String externalVal);
@@ -191,6 +191,11 @@ public abstract class PointField extends NumericFieldType {
   
   protected abstract String indexedToReadable(BytesRef indexedForm);
   
+  @Override
+  public Query getPrefixQuery(QParser parser, SchemaField sf, String termStr) {
+    throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Can't run prefix queries on numeric fields");
+  }
+  
   protected boolean isFieldUsed(SchemaField field) {
     boolean indexed = field.indexed();
     boolean stored = field.stored();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/java/org/apache/solr/schema/TrieField.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/TrieField.java b/solr/core/src/java/org/apache/solr/schema/TrieField.java
index f90877c..998583b 100644
--- a/solr/core/src/java/org/apache/solr/schema/TrieField.java
+++ b/solr/core/src/java/org/apache/solr/schema/TrieField.java
@@ -344,7 +344,7 @@ public class TrieField extends NumericFieldType {
     }
     int ps = precisionStep;
     Query query;
-
+    
     if (field.hasDocValues() && !field.indexed()) {
       return getDocValuesRangeQuery(parser, field, min, max, minInclusive, maxInclusive);
     }
@@ -352,26 +352,26 @@ public class TrieField extends NumericFieldType {
     switch (type) {
       case INTEGER:
         query = LegacyNumericRangeQuery.newIntRange(field.getName(), ps,
-            min == null ? null : Integer.parseInt(min),
-            max == null ? null : Integer.parseInt(max),
+            min == null ? null : parseIntFromUser(field.getName(), min),
+            max == null ? null : parseIntFromUser(field.getName(), max),
             minInclusive, maxInclusive);
         break;
       case FLOAT:
         query = LegacyNumericRangeQuery.newFloatRange(field.getName(), ps,
-            min == null ? null : Float.parseFloat(min),
-            max == null ? null : Float.parseFloat(max),
+            min == null ? null : parseFloatFromUser(field.getName(), min),
+            max == null ? null : parseFloatFromUser(field.getName(), max),
             minInclusive, maxInclusive);
         break;
       case LONG:
         query = LegacyNumericRangeQuery.newLongRange(field.getName(), ps,
-            min == null ? null : Long.parseLong(min),
-            max == null ? null : Long.parseLong(max),
+            min == null ? null : parseLongFromUser(field.getName(), min),
+            max == null ? null : parseLongFromUser(field.getName(), max),
             minInclusive, maxInclusive);
         break;
       case DOUBLE:
         query = LegacyNumericRangeQuery.newDoubleRange(field.getName(), ps,
-            min == null ? null : Double.parseDouble(min),
-            max == null ? null : Double.parseDouble(max),
+            min == null ? null : parseDoubleFromUser(field.getName(), min),
+            max == null ? null : parseDoubleFromUser(field.getName(), max),
             minInclusive, maxInclusive);
         break;
       case DATE:
@@ -383,7 +383,6 @@ public class TrieField extends NumericFieldType {
       default:
         throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Unknown type for trie field");
     }
-
     return query;
   }
 
@@ -413,29 +412,24 @@ public class TrieField extends NumericFieldType {
   @Override
   public void readableToIndexed(CharSequence val, BytesRefBuilder result) {
     String s = val.toString();
-    try {
-      switch (type) {
-        case INTEGER:
-          LegacyNumericUtils.intToPrefixCoded(Integer.parseInt(s), 0, result);
-          break;
-        case FLOAT:
-          LegacyNumericUtils.intToPrefixCoded(NumericUtils.floatToSortableInt(Float.parseFloat(s)), 0, result);
-          break;
-        case LONG:
-          LegacyNumericUtils.longToPrefixCoded(Long.parseLong(s), 0, result);
-          break;
-        case DOUBLE:
-          LegacyNumericUtils.longToPrefixCoded(NumericUtils.doubleToSortableLong(Double.parseDouble(s)), 0, result);
-          break;
-        case DATE:
-          LegacyNumericUtils.longToPrefixCoded(DateMathParser.parseMath(null, s).getTime(), 0, result);
-          break;
-        default:
-          throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Unknown type for trie field: " + type);
-      }
-    } catch (NumberFormatException nfe) {
-      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, 
-                              "Invalid Number: " + val);
+    switch (type) {
+      case INTEGER:
+        LegacyNumericUtils.intToPrefixCoded(parseIntFromUser(null, s), 0, result);
+        break;
+      case FLOAT:
+        LegacyNumericUtils.intToPrefixCoded(NumericUtils.floatToSortableInt(parseFloatFromUser(null, s)), 0, result);
+        break;
+      case LONG:
+        LegacyNumericUtils.longToPrefixCoded(parseLongFromUser(null, s), 0, result);
+        break;
+      case DOUBLE:
+        LegacyNumericUtils.longToPrefixCoded(NumericUtils.doubleToSortableLong(parseDoubleFromUser(null, s)), 0, result);
+        break;
+      case DATE:
+        LegacyNumericUtils.longToPrefixCoded(DateMathParser.parseMath(null, s).getTime(), 0, result);
+        break;
+      default:
+        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Unknown type for trie field: " + type);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java b/solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java
index 596ddd3..cb1af9a 100644
--- a/solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java
+++ b/solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java
@@ -191,7 +191,7 @@ public class AddUpdateCommand extends UpdateCommand implements Iterable<Document
         boolean isVersion = version != 0;
 
         for (SolrInputDocument sdoc : all) {
-          sdoc.setField("_root_", idField);      // should this be a string or the same type as the ID?
+          sdoc.setField(IndexSchema.ROOT_FIELD_NAME, idField);
           if(isVersion) sdoc.setField(CommonParams.VERSION_FIELD, version);
           // TODO: if possible concurrent modification exception (if SolrInputDocument not cloned and is being forwarded to replicas)
           // then we could add this field to the generated lucene document instead.
@@ -220,6 +220,12 @@ public class AddUpdateCommand extends UpdateCommand implements Iterable<Document
   private List<SolrInputDocument> flatten(SolrInputDocument root) {
     List<SolrInputDocument> unwrappedDocs = new ArrayList<>();
     recUnwrapp(unwrappedDocs, root);
+    if (1 < unwrappedDocs.size() && ! req.getSchema().isUsableForChildDocs()) {
+      throw new SolrException
+        (SolrException.ErrorCode.BAD_REQUEST, "Unable to index docs with children: the schema must " +
+         "include definitions for both a uniqueKey field and the '" + IndexSchema.ROOT_FIELD_NAME +
+         "' field, using the exact same fieldType");
+    }
     return unwrappedDocs;
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java b/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
index e481109..3efb748 100644
--- a/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
+++ b/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
@@ -55,6 +55,7 @@ import org.apache.solr.request.LocalSolrQueryRequest;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.request.SolrRequestInfo;
 import org.apache.solr.response.SolrQueryResponse;
+import org.apache.solr.schema.IndexSchema;
 import org.apache.solr.schema.SchemaField;
 import org.apache.solr.search.FunctionRangeQuery;
 import org.apache.solr.search.QParser;
@@ -394,7 +395,7 @@ public class DirectUpdateHandler2 extends UpdateHandler implements SolrCoreState
   }
 
   private Term getIdTerm(AddUpdateCommand cmd) {
-    return new Term(cmd.isBlock() ? "_root_" : idField.getName(), cmd.getIndexedId());
+    return new Term(cmd.isBlock() ? IndexSchema.ROOT_FIELD_NAME : idField.getName(), cmd.getIndexedId());
   }
 
   private void updateDeleteTrackers(DeleteUpdateCommand cmd) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java b/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java
index b97af3b..58638ae 100644
--- a/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java
+++ b/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java
@@ -176,8 +176,8 @@ public class DocumentBuilder {
                 // check if the copy field is a multivalued or not
                 if (!destinationField.multiValued() && destHasValues) {
                   throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
-                      "ERROR: "+getID(doc, schema)+"multiple values encountered for non multiValued copy field " +
-                          destinationField.getName() + ": " + v);
+                      "Multiple values encountered for non multiValued copy field " +
+                      destinationField.getName() + ": " + v);
                 }
 
                 used = true;
@@ -198,7 +198,9 @@ public class DocumentBuilder {
         }
       }
       catch( SolrException ex ) {
-        throw ex;
+        throw new SolrException(SolrException.ErrorCode.getErrorCode(ex.code()),
+            "ERROR: "+getID(doc, schema)+"Error adding field '" + 
+              field.getName() + "'='" +field.getValue()+"' msg=" + ex.getMessage(), ex );
       }
       catch( Exception ex ) {
         throw new SolrException( SolrException.ErrorCode.BAD_REQUEST,

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/test-files/solr/collection1/conf/bad-schema-uniquekey-diff-type-dynamic-root.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/bad-schema-uniquekey-diff-type-dynamic-root.xml b/solr/core/src/test-files/solr/collection1/conf/bad-schema-uniquekey-diff-type-dynamic-root.xml
new file mode 100644
index 0000000..4f06bd1
--- /dev/null
+++ b/solr/core/src/test-files/solr/collection1/conf/bad-schema-uniquekey-diff-type-dynamic-root.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<schema name="bad-schema-uniquekey-diff-type-dynamic-root" version="1.4">
+  <!-- NOTE: these fieldTypes are defined with same class, and same props, but schema should
+       still error because the type *names* used not identical.
+       this is risky, because it means the types could diverge over time, and we wnat to
+       protect the user fromthat.
+  -->
+  <fieldType name="string1" class="solr.StrField"/>
+  <fieldType name="string2" class="solr.StrField"/>
+
+  <uniqueKey>id</uniqueKey>
+  <field name="id" type="string1" indexed="true" stored="true" />
+
+  <!-- BEGIN BAD STUFF -->
+  <!-- matches '_root_' -->
+  <dynamicField name="*" type="string2" indexed="true" stored="true" />
+  <!-- END BAD STUFF -->
+
+</schema>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/test-files/solr/collection1/conf/bad-schema-uniquekey-diff-type-root.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/bad-schema-uniquekey-diff-type-root.xml b/solr/core/src/test-files/solr/collection1/conf/bad-schema-uniquekey-diff-type-root.xml
new file mode 100644
index 0000000..377762d
--- /dev/null
+++ b/solr/core/src/test-files/solr/collection1/conf/bad-schema-uniquekey-diff-type-root.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<schema name="bad-schema-uniquekey-diff-type-root" version="1.4">
+  <!-- NOTE: these fieldTypes are defined with same class, and same props, but schema should
+       still error because the type *names* used not identical.
+       this is risky, because it means the types could diverge over time, and we wnat to
+       protect the user fromthat.
+  -->
+  <fieldType name="string1" class="solr.StrField"/>
+  <fieldType name="string2" class="solr.StrField"/>
+
+  <uniqueKey>id</uniqueKey>
+  <field name="id" type="string1" indexed="true" stored="true" />
+
+  <!-- BEGIN BAD STUFF -->
+  <field name="_root_" type="string2" indexed="true" stored="true" />
+  <!-- END BAD STUFF -->
+
+</schema>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/test-files/solr/collection1/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema.xml b/solr/core/src/test-files/solr/collection1/conf/schema.xml
index 05145f9..f0ddae4 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema.xml
@@ -734,11 +734,25 @@
                 useDocValuesAsStored="true"/>
   <dynamicField name="*_s_dvo" multiValued="false" type="string" docValues="true" indexed="false" stored="false"
                 useDocValuesAsStored="true"/>
-
+  <dynamicField name="*_l_dvo" multiValued="false" type="${solr.tests.longClass:plong}" docValues="true" indexed="false" stored="false"
+                useDocValuesAsStored="true"/>
+  <dynamicField name="*_f_dvo" multiValued="false" type="${solr.tests.floatClass:pfloat}" docValues="true" indexed="false" stored="false"
+                useDocValuesAsStored="true"/>
+  <dynamicField name="*_dt_dvo" multiValued="false" type="${solr.tests.dateClass:pdate}" docValues="true" indexed="false" stored="false"
+                useDocValuesAsStored="true"/>
+                
   <dynamicField name="*_ii_dvo" multiValued="true" type="${solr.tests.intClass:pint}" docValues="true" indexed="false" stored="false"
                 useDocValuesAsStored="true"/>
   <dynamicField name="*_dd_dvo" multiValued="true" type="${solr.tests.doubleClass:pdouble}" docValues="true" indexed="false" stored="false"
                 useDocValuesAsStored="true"/>
+                
+                
+  <!-- Only Stored numerics -->
+  <dynamicField name="*_i_os" type="${solr.tests.intClass:pint}" indexed="false" stored="true" docValues="false"/>
+  <dynamicField name="*_l_os" type="${solr.tests.longClass:plong}" indexed="false" stored="true" docValues="false"/>
+  <dynamicField name="*_f_os" type="${solr.tests.floatClass:pfloat}" indexed="false" stored="true" docValues="false"/>
+  <dynamicField name="*_d_os" type="${solr.tests.doubleClass:pdouble}" indexed="false" stored="true" docValues="false"/>
+  <dynamicField name="*_dt_os" type="${solr.tests.dateClass:pdate}" indexed="false" stored="true" docValues="false"/>
 
   <!--  Non-stored, DocValues=true, useDocValuesAsStored=false -->
   <field name="single_i_dvn" multiValued="false" type="${solr.tests.intClass:pint}" indexed="true" stored="true"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/test-files/solr/collection1/conf/schema11.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema11.xml b/solr/core/src/test-files/solr/collection1/conf/schema11.xml
index caa24cc..819b6d1 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema11.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema11.xml
@@ -413,6 +413,10 @@ valued. -->
    <dynamicField name="*_ds_p"      type="pdouble"    indexed="true"  stored="true" docValues="true" multiValued="true"/>
    <dynamicField name="*_d_ni_p"   type="pdouble"    indexed="false"  stored="true" docValues="true"/>
    <dynamicField name="*_ds_ni_p"   type="pdouble"    indexed="false"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_dt_p"      type="pdate"    indexed="true"  stored="true" docValues="true"/>
+   <dynamicField name="*_dts_p"      type="pdate"    indexed="true"  stored="true" docValues="true" multiValued="true"/>
+   <dynamicField name="*_dt_ni_p"   type="pdate"    indexed="false"  stored="true" docValues="true"/>
+   <dynamicField name="*_dts_ni_p"   type="pdate"    indexed="false"  stored="true" docValues="true" multiValued="true"/>
 
    <dynamicField name="*_t"  type="text"    indexed="true"  stored="true"/>
    <dynamicField name="*_b"  type="boolean" indexed="true"  stored="true"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/test-files/solr/collection1/conf/schema12.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema12.xml b/solr/core/src/test-files/solr/collection1/conf/schema12.xml
index 214fc26..2236395 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema12.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema12.xml
@@ -604,16 +604,33 @@
   <dynamicField name="*_is" type="${solr.tests.intClass:pint}" indexed="true" stored="true" multiValued="true"/>
   <dynamicField name="*_i_dv" type="${solr.tests.intClass:pint}" indexed="true" stored="true" docValues="true" multiValued="false"/>
   <dynamicField name="*_is_dv" type="${solr.tests.intClass:pint}" indexed="true" stored="true" docValues="true" multiValued="true"/>
+  <dynamicField name="*_i_dvo" type="${solr.tests.intClass:pint}" indexed="false" stored="true" docValues="true"/>
+  
+  <dynamicField name="*_f" type="${solr.tests.floatClass:pfloat}" indexed="true" stored="true"/>
+  <dynamicField name="*_fs" type="${solr.tests.floatClass:pfloat}" indexed="true" stored="true" multiValued="true"/>
+  <dynamicField name="*_f_dv" type="${solr.tests.floatClass:pfloat}" indexed="true" stored="true" docValues="true" multiValued="false"/>
+  <dynamicField name="*_fs_dv" type="${solr.tests.floatClass:pfloat}" indexed="true" stored="true" docValues="true" multiValued="true"/>
+  <dynamicField name="*_f_dvo" type="${solr.tests.floatClass:pfloat}" indexed="false" stored="true" docValues="true"/>
+  
+  <dynamicField name="*_l" type="${solr.tests.longClass:plong}" indexed="true" stored="true"/>
+  <dynamicField name="*_ls" type="${solr.tests.longClass:plong}" indexed="true" stored="true" multiValued="true"/>
+  <dynamicField name="*_l_dv" type="${solr.tests.longClass:plong}" indexed="true" stored="true" docValues="true" multiValued="false"/>
+  <dynamicField name="*_ls_dv" type="${solr.tests.longClass:plong}" indexed="true" stored="true" docValues="true" multiValued="true"/>
+  <dynamicField name="*_l_dvo" type="${solr.tests.longClass:plong}" indexed="false" stored="true" docValues="true"/>
+  
+  <dynamicField name="*_d" type="${solr.tests.doubleClass:pdouble}" indexed="true" stored="true"/>
+  <dynamicField name="*_ds" type="${solr.tests.doubleClass:pdouble}" indexed="true" stored="true" multiValued="true"/>
+  <dynamicField name="*_d_dv" type="${solr.tests.doubleClass:pdouble}" indexed="true" stored="true" docValues="true" multiValued="false"/>
+  <dynamicField name="*_ds_dv" type="${solr.tests.doubleClass:pdouble}" indexed="true" stored="true" docValues="true" multiValued="true"/>
+  <dynamicField name="*_d_dvo" type="${solr.tests.doubleClass:pdouble}" indexed="false" stored="true" docValues="true"/>
+  
   <dynamicField name="*_s1" type="string" indexed="true" stored="true" multiValued="false"/>
   <!-- :TODO: why are these identical?!?!?! -->
   <dynamicField name="*_s" type="string" indexed="true" stored="true" multiValued="true"/>
   <dynamicField name="*_ss" type="string" indexed="true" stored="true" multiValued="true"/>
-  <dynamicField name="*_l" type="${solr.tests.longClass:plong}" indexed="true" stored="true"/>
   <dynamicField name="*_t" type="text" indexed="true" stored="true"/>
   <dynamicField name="*_tt" type="text" indexed="true" stored="true"/>
   <dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
-  <dynamicField name="*_f" type="${solr.tests.floatClass:pfloat}" indexed="true" stored="true"/>
-  <dynamicField name="*_d" type="${solr.tests.doubleClass:pdouble}" indexed="true" stored="true"/>
   <dynamicField name="*_dt" type="${solr.tests.dateClass:pdate}" indexed="true" stored="true"/>
 
   <dynamicField name="*_pi" type="pint" indexed="true" stored="true" docValues="false" multiValued="false"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/test-files/solr/configsets/cloud-hdfs/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/configsets/cloud-hdfs/conf/schema.xml b/solr/core/src/test-files/solr/configsets/cloud-hdfs/conf/schema.xml
index aab5e81..7b8b690 100644
--- a/solr/core/src/test-files/solr/configsets/cloud-hdfs/conf/schema.xml
+++ b/solr/core/src/test-files/solr/configsets/cloud-hdfs/conf/schema.xml
@@ -22,7 +22,7 @@
   <dynamicField name="*" type="string" indexed="true" stored="true"/>
   <!-- for versioning -->
   <field name="_version_" type="long" indexed="true" stored="true"/>
-  <field name="_root_" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+  <field name="_root_" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
   <field name="id" type="string" indexed="true" stored="true"/>
   <uniqueKey>id</uniqueKey>
 </schema>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/test-files/solr/configsets/cloud-managed-preanalyzed/conf/managed-schema
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/configsets/cloud-managed-preanalyzed/conf/managed-schema b/solr/core/src/test-files/solr/configsets/cloud-managed-preanalyzed/conf/managed-schema
index e70e02b..39e142e 100644
--- a/solr/core/src/test-files/solr/configsets/cloud-managed-preanalyzed/conf/managed-schema
+++ b/solr/core/src/test-files/solr/configsets/cloud-managed-preanalyzed/conf/managed-schema
@@ -35,7 +35,7 @@
 
   <!-- for versioning -->
   <field name="_version_" type="long" indexed="true" stored="true"/>
-  <field name="_root_" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+  <field name="_root_" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
   <field name="id" type="string" indexed="true" stored="true"/>
   <uniqueKey>id</uniqueKey>
 </schema>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/test-files/solr/configsets/cloud-managed-upgrade/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/configsets/cloud-managed-upgrade/conf/schema.xml b/solr/core/src/test-files/solr/configsets/cloud-managed-upgrade/conf/schema.xml
index b9f09f9..1d97a2a 100644
--- a/solr/core/src/test-files/solr/configsets/cloud-managed-upgrade/conf/schema.xml
+++ b/solr/core/src/test-files/solr/configsets/cloud-managed-upgrade/conf/schema.xml
@@ -21,7 +21,7 @@
   <fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
   <!-- for versioning -->
   <field name="_version_" type="long" indexed="true" stored="true"/>
-  <field name="_root_" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+  <field name="_root_" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
   <field name="id" type="string" indexed="true" stored="true"/>
   <uniqueKey>id</uniqueKey>
 </schema>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/test-files/solr/configsets/cloud-managed/conf/managed-schema
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/configsets/cloud-managed/conf/managed-schema b/solr/core/src/test-files/solr/configsets/cloud-managed/conf/managed-schema
index b9f09f9..1d97a2a 100644
--- a/solr/core/src/test-files/solr/configsets/cloud-managed/conf/managed-schema
+++ b/solr/core/src/test-files/solr/configsets/cloud-managed/conf/managed-schema
@@ -21,7 +21,7 @@
   <fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
   <!-- for versioning -->
   <field name="_version_" type="long" indexed="true" stored="true"/>
-  <field name="_root_" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+  <field name="_root_" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
   <field name="id" type="string" indexed="true" stored="true"/>
   <uniqueKey>id</uniqueKey>
 </schema>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/test-files/solr/configsets/cloud-minimal-jmx/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/configsets/cloud-minimal-jmx/conf/schema.xml b/solr/core/src/test-files/solr/configsets/cloud-minimal-jmx/conf/schema.xml
index aab5e81..7b8b690 100644
--- a/solr/core/src/test-files/solr/configsets/cloud-minimal-jmx/conf/schema.xml
+++ b/solr/core/src/test-files/solr/configsets/cloud-minimal-jmx/conf/schema.xml
@@ -22,7 +22,7 @@
   <dynamicField name="*" type="string" indexed="true" stored="true"/>
   <!-- for versioning -->
   <field name="_version_" type="long" indexed="true" stored="true"/>
-  <field name="_root_" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+  <field name="_root_" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
   <field name="id" type="string" indexed="true" stored="true"/>
   <uniqueKey>id</uniqueKey>
 </schema>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/test-files/solr/configsets/cloud-minimal/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/configsets/cloud-minimal/conf/schema.xml b/solr/core/src/test-files/solr/configsets/cloud-minimal/conf/schema.xml
index aab5e81..7b8b690 100644
--- a/solr/core/src/test-files/solr/configsets/cloud-minimal/conf/schema.xml
+++ b/solr/core/src/test-files/solr/configsets/cloud-minimal/conf/schema.xml
@@ -22,7 +22,7 @@
   <dynamicField name="*" type="string" indexed="true" stored="true"/>
   <!-- for versioning -->
   <field name="_version_" type="long" indexed="true" stored="true"/>
-  <field name="_root_" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+  <field name="_root_" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
   <field name="id" type="string" indexed="true" stored="true"/>
   <uniqueKey>id</uniqueKey>
 </schema>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/test-files/solr/configsets/cloud-subdirs/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/configsets/cloud-subdirs/conf/schema.xml b/solr/core/src/test-files/solr/configsets/cloud-subdirs/conf/schema.xml
index aab5e81..7b8b690 100644
--- a/solr/core/src/test-files/solr/configsets/cloud-subdirs/conf/schema.xml
+++ b/solr/core/src/test-files/solr/configsets/cloud-subdirs/conf/schema.xml
@@ -22,7 +22,7 @@
   <dynamicField name="*" type="string" indexed="true" stored="true"/>
   <!-- for versioning -->
   <field name="_version_" type="long" indexed="true" stored="true"/>
-  <field name="_root_" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+  <field name="_root_" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
   <field name="id" type="string" indexed="true" stored="true"/>
   <uniqueKey>id</uniqueKey>
 </schema>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/test-files/solr/configsets/exitable-directory/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/configsets/exitable-directory/conf/schema.xml b/solr/core/src/test-files/solr/configsets/exitable-directory/conf/schema.xml
index aab5e81..7b8b690 100644
--- a/solr/core/src/test-files/solr/configsets/exitable-directory/conf/schema.xml
+++ b/solr/core/src/test-files/solr/configsets/exitable-directory/conf/schema.xml
@@ -22,7 +22,7 @@
   <dynamicField name="*" type="string" indexed="true" stored="true"/>
   <!-- for versioning -->
   <field name="_version_" type="long" indexed="true" stored="true"/>
-  <field name="_root_" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+  <field name="_root_" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
   <field name="id" type="string" indexed="true" stored="true"/>
   <uniqueKey>id</uniqueKey>
 </schema>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java b/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
index 02ae888..b1747fd 100644
--- a/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
+++ b/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
@@ -341,6 +341,59 @@ public class BasicFunctionalityTest extends SolrTestCaseJ4 {
     );
   }
 
+  @Test
+  public void testClientErrorOnMalformedDate() throws Exception {
+    final String BAD_VALUE = "NOT_A_DATE";
+    ignoreException(BAD_VALUE);
+
+    final List<String> FIELDS = new LinkedList<>();
+    for (String type : new String[] {
+        "tdt", "tdt1", "tdtdv", "tdtdv1",
+        "dt_dv", "dt_dvo", "dt", "dt1", "dt_os"
+        }) {
+      FIELDS.add("malformed_" + type);
+    }
+
+    // test that malformed numerics cause client error not server error
+    for (String field : FIELDS) {
+      try {
+        h.update(add( doc("id","100", field, BAD_VALUE)));
+        fail("Didn't encounter an error trying to add a bad date: " + field);
+      } catch (SolrException e) {
+        String msg = e.toString();
+        assertTrue("not an (update) client error on field: " + field +" : "+ msg,
+                   400 <= e.code() && e.code() < 500);
+        assertTrue("(update) client error does not mention bad value: " + msg,
+                   msg.contains(BAD_VALUE));
+        assertTrue("client error does not mention document id: " + msg,
+                   msg.contains("[doc=100]"));
+      }
+      SchemaField sf = h.getCore().getLatestSchema().getField(field); 
+      if (!sf.hasDocValues() && !sf.indexed()) {
+        continue;
+      }
+      try {
+        h.query(req("q",field + ":" + BAD_VALUE));
+        fail("Didn't encounter an error trying to query a bad date: " + field);
+      } catch (SolrException e) {
+        String msg = e.toString();
+        assertTrue("not a (search) client error on field: " + field +" : "+ msg,
+                   400 <= e.code() && e.code() < 500);
+        assertTrue("(search) client error does not mention bad value: " + msg,
+                   msg.contains(BAD_VALUE));
+      }
+      try {
+        h.query(req("q",field + ":[NOW TO " + BAD_VALUE + "]"));
+        fail("Didn't encounter an error trying to query a bad date: " + field);
+      } catch (SolrException e) {
+        String msg = e.toString();
+        assertTrue("not a (search) client error on field: " + field +" : "+ msg,
+                   400 <= e.code() && e.code() < 500);
+        assertTrue("(search) client error does not mention bad value: " + msg,
+                   msg.contains(BAD_VALUE));
+      }
+    }
+  }
 
   @Test
   public void testClientErrorOnMalformedNumbers() throws Exception {
@@ -349,7 +402,13 @@ public class BasicFunctionalityTest extends SolrTestCaseJ4 {
     ignoreException(BAD_VALUE);
 
     final List<String> FIELDS = new LinkedList<>();
-    for (String type : new String[] { "ti", "tf", "td", "tl" }) {
+    for (String type : new String[] {
+        "ti", "tf", "td", "tl",
+        "i", "f", "d", "l",
+        "i_dv", "f_dv", "d_dv", "l_dv",
+        "i_dvo", "f_dvo", "d_dvo", "l_dvo",
+        "i_os", "f_os", "d_os", "l_os"
+        }) {
       FIELDS.add("malformed_" + type);
     }
 
@@ -364,6 +423,12 @@ public class BasicFunctionalityTest extends SolrTestCaseJ4 {
                    400 <= e.code() && e.code() < 500);
         assertTrue("(update) client error does not mention bad value: " + msg,
                    msg.contains(BAD_VALUE));
+        assertTrue("client error does not mention document id",
+                   msg.contains("[doc=100]"));
+      }
+      SchemaField sf = h.getCore().getLatestSchema().getField(field); 
+      if (!sf.hasDocValues() && !sf.indexed()) {
+        continue;
       }
       try {
         h.query(req("q",field + ":" + BAD_VALUE));
@@ -375,6 +440,16 @@ public class BasicFunctionalityTest extends SolrTestCaseJ4 {
         assertTrue("(search) client error does not mention bad value: " + msg,
                    msg.contains(BAD_VALUE));
       }
+      try {
+        h.query(req("q",field + ":[10 TO " + BAD_VALUE + "]"));
+        fail("Didn't encounter an error trying to query a non-number: " + field);
+      } catch (SolrException e) {
+        String msg = e.toString();
+        assertTrue("not a (search) client error on field: " + field +" : "+ msg,
+                   400 <= e.code() && e.code() < 500);
+        assertTrue("(search) client error does not mention bad value: " + msg,
+                   msg.contains(BAD_VALUE));
+      }
     }
   }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/test/org/apache/solr/schema/BadIndexSchemaTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/BadIndexSchemaTest.java b/solr/core/src/test/org/apache/solr/schema/BadIndexSchemaTest.java
index 5545d95..f635436 100644
--- a/solr/core/src/test/org/apache/solr/schema/BadIndexSchemaTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/BadIndexSchemaTest.java
@@ -101,6 +101,21 @@ public class BadIndexSchemaTest extends AbstractBadConfigTestBase {
   public void testDocValuesUnsupported() throws Exception {
     doTest("bad-schema-unsupported-docValues.xml", "does not support doc values");
   }
+  
+  public void testRootTypeMissmatchWithUniqueKey() throws Exception {
+    doTest("bad-schema-uniquekey-diff-type-root.xml",
+           "using the exact same fieldType as the uniqueKey field (id) uses: string1");
+  }
+  
+  public void testRootTypeDynamicMissmatchWithUniqueKey() throws Exception {
+    // in this case, the core should load fine -- but we should get an error adding docs
+    try {
+      initCore("solrconfig.xml","bad-schema-uniquekey-diff-type-dynamic-root.xml");
+      assertFailedU("Unable to index docs with children", adoc(sdocWithChildren("1","-1")));
+    } finally {
+      deleteCore();
+    }
+  }
 
   public void testSweetSpotSimBadConfig() throws Exception {
     doTest("bad-schema-sweetspot-both-tf.xml", "Can not mix");

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/test/org/apache/solr/search/TestQueryTypes.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestQueryTypes.java b/solr/core/src/test/org/apache/solr/search/TestQueryTypes.java
index 3f57ee5..f282c3f 100644
--- a/solr/core/src/test/org/apache/solr/search/TestQueryTypes.java
+++ b/solr/core/src/test/org/apache/solr/search/TestQueryTypes.java
@@ -20,6 +20,7 @@ import org.apache.solr.common.SolrException;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.util.AbstractSolrTestCase;
 import org.junit.BeforeClass;
+import org.junit.Test;
 
 public class TestQueryTypes extends AbstractSolrTestCase {
 
@@ -209,7 +210,6 @@ public class TestQueryTypes extends AbstractSolrTestCase {
            ,"//result[@numFound='2']"
            );
 
-
     //
     // test escapes in quoted strings
     //
@@ -436,5 +436,49 @@ public class TestQueryTypes extends AbstractSolrTestCase {
     assertQ("Test text field with no analysis doesn't NPE with wildcards (SOLR-4318)",
         req("q", "text_no_analyzer:should*"), "//result[@numFound='1']");
 
+    
+  }
+  
+  @Test
+  public void testNumericBadRequests() {
+    String[] suffixes = new String[50];
+    int fieldNum = 0;
+    for (String type:new String[]{"i", "l", "f", "d", "dt"}) {
+      for (String s:new String[]{"", "s"}) {
+        //Trie
+        suffixes[fieldNum++] = "t" + type + s;
+        suffixes[fieldNum++] = "t" + type + s + "_dv";
+        suffixes[fieldNum++] = "t" + type + s + "_ni_dv";
+        
+        //Points
+        suffixes[fieldNum++] = type + s + "_p";
+        suffixes[fieldNum++] = type + s + "_ni_p";
+      }
+    }
+    assertEquals(fieldNum,suffixes.length);
+    
+    String badNumber = "NOT_A_NUMBER";
+    for (String suffix:suffixes) {
+      // Numeric bad requests
+      assertQEx("Expecting exception for suffix: " + suffix, badNumber, req("q","{!term f=foo_" + suffix + "}" + badNumber), SolrException.ErrorCode.BAD_REQUEST);
+      assertQEx("Expecting exception for suffix: " + suffix, badNumber, req("q","{!terms f=foo_" + suffix + "}1 2 3 4 5 " + badNumber), SolrException.ErrorCode.BAD_REQUEST);
+      assertQEx("Expecting exception for suffix: " + suffix, badNumber, req("q","{!lucene}foo_" + suffix + ":" + badNumber), SolrException.ErrorCode.BAD_REQUEST);
+      assertQEx("Expecting exception for suffix: " + suffix, badNumber, req("q","{!field f=foo_" + suffix + "}" + badNumber), SolrException.ErrorCode.BAD_REQUEST);
+      assertQEx("Expecting exception for suffix: " + suffix, badNumber, req("q","{!maxscore}foo_" + suffix + ":" + badNumber), SolrException.ErrorCode.BAD_REQUEST);
+      assertQEx("Expecting exception for suffix: " + suffix, badNumber,
+          req("q","{!xmlparser}<PointRangeQuery fieldName=\"foo_"+ suffix  + "\" lowerTerm=\"1\" upperTerm=\"" + badNumber + "\"/>"), SolrException.ErrorCode.BAD_REQUEST);
+      if (suffix.contains("_p")) {
+        // prefix queries work in Trie fields
+        assertQEx("Expecting exception for suffix: " + suffix, "Can't run prefix queries on numeric fields",
+            req("q","{!prefix f=foo_" + suffix + "}NOT_A_NUMBER"), SolrException.ErrorCode.BAD_REQUEST);
+        assertQEx("Expecting exception for suffix: " + suffix, "Can't run prefix queries on numeric fields",
+            req("q","{!lucene}foo_" + suffix + ":123*"), SolrException.ErrorCode.BAD_REQUEST);
+      }
+      
+      // Skipping: func, boost, raw, nested, frange, spatial*, join, surround, switch, parent, child, collapsing, 
+      // complexphrase, rerank, export, mlt, hash, graph, graphTerms, igain, tlogit, sigificantTerms, payload*
+      // Maybe add: raw, join, parent, child, collapsing, graphTerms, igain, sigificantTerms, simple
+    }
+
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6396cb75/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java b/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
index 1a2e572..4b82e62 100644
--- a/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
+++ b/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
@@ -33,6 +33,7 @@ import org.apache.lucene.search.Query;
 import org.apache.lucene.search.TermInSetQuery;
 import org.apache.lucene.search.TermQuery;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.common.SolrException;
 import org.apache.solr.common.params.MapSolrParams;
 import org.apache.solr.metrics.MetricsMap;
 import org.apache.solr.common.params.ModifiableSolrParams;
@@ -1038,4 +1039,39 @@ public class TestSolrQueryParser extends SolrTestCaseJ4 {
         , "/response/numFound==1"
     );
   }
+  
+  @Test
+  public void testBadRequestInSetQuery() throws SyntaxError {
+    SolrQueryRequest req = req();
+    QParser qParser;
+    String[] fieldSuffix = new String[] {
+        "ti", "tf", "td", "tl",
+        "i", "f", "d", "l",
+        "is", "fs", "ds", "ls",
+        "i_dv", "f_dv", "d_dv", "l_dv",
+        "is_dv", "fs_dv", "ds_dv", "ls_dv",
+        "i_dvo", "f_dvo", "d_dvo", "l_dvo",
+    };
+    
+    for (String suffix:fieldSuffix) {
+      //Good queries
+      qParser = QParser.getParser("foo_" + suffix + ":(1 2 3 4 5 6 7 8 9 10 20 19 18 17 16 15 14 13 12 25)", req);
+      qParser.setIsFilter(true);
+      qParser.getQuery();
+    }
+    
+    for (String suffix:fieldSuffix) {
+      qParser = QParser.getParser("foo_" + suffix + ":(1 2 3 4 5 6 7 8 9 10 20 19 18 17 16 15 14 13 12 NOT_A_NUMBER)", req);
+      qParser.setIsFilter(true); // this may change in the future
+      try {
+        qParser.getQuery();
+        fail("Expecting exception");
+      } catch (SolrException e) {
+        assertEquals(SolrException.ErrorCode.BAD_REQUEST.code, e.code());
+        assertTrue("Unexpected exception: " + e.getMessage(), e.getMessage().contains("Invalid Number: NOT_A_NUMBER"));
+      }
+    }
+    
+    
+  }
 }
\ No newline at end of file


[29/35] lucene-solr:jira/SOLR-10834: fix some tests that were making assumptions about float ids that triggered obvious failures when i added id->id_i copyField

Posted by ho...@apache.org.
fix some tests that were making assumptions about float ids that triggered obvious failures when i added id->id_i copyField


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

Branch: refs/heads/jira/SOLR-10834
Commit: 53f97845caaa8adc25862e4017b94f3091063552
Parents: d5bfb5f
Author: Chris Hostetter <ho...@apache.org>
Authored: Tue Jun 13 12:21:20 2017 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Tue Jun 13 12:21:20 2017 -0700

----------------------------------------------------------------------
 .../org/apache/solr/request/TestFaceting.java   | 14 +++----
 .../org/apache/solr/search/TestQueryTypes.java  |  6 +--
 .../solr/search/function/TestFunctionQuery.java | 41 ++++++++++----------
 3 files changed, 31 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/53f97845/solr/core/src/test/org/apache/solr/request/TestFaceting.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/request/TestFaceting.java b/solr/core/src/test/org/apache/solr/request/TestFaceting.java
index a80669a..8933c19 100644
--- a/solr/core/src/test/org/apache/solr/request/TestFaceting.java
+++ b/solr/core/src/test/org/apache/solr/request/TestFaceting.java
@@ -64,7 +64,7 @@ public class TestFaceting extends SolrTestCaseJ4 {
   void createIndex(int nTerms) {
     assertU(delQ("*:*"));
     for (int i=0; i<nTerms; i++) {
-      assertU(adoc("id", Float.toString(i), proto.field(), t(i) ));
+      assertU(adoc("id", Integer.toString(i), proto.field(), t(i) ));
     }
     assertU(optimize()); // squeeze out any possible deleted docs
   }
@@ -297,9 +297,9 @@ public class TestFaceting extends SolrTestCaseJ4 {
 
   @Test
   public void testFacetSortWithMinCount() {
-    assertU(adoc("id", "1.0", "f_td", "-420.126"));
-    assertU(adoc("id", "2.0", "f_td", "-285.672"));
-    assertU(adoc("id", "3.0", "f_td", "-1.218"));
+    assertU(adoc("id", "1", "f_td", "-420.126"));
+    assertU(adoc("id", "2", "f_td", "-285.672"));
+    assertU(adoc("id", "3", "f_td", "-1.218"));
     assertU(commit());
 
     assertQ(req("q", "*:*", FacetParams.FACET, "true", FacetParams.FACET_FIELD, "f_td", "f.f_td.facet.sort", FacetParams.FACET_SORT_INDEX),
@@ -329,9 +329,9 @@ public class TestFaceting extends SolrTestCaseJ4 {
 
   @Test
   public void testFacetSortWithMinCount0() {
-    assertU(adoc("id", "1.0", "f_td", "-420.126"));
-    assertU(adoc("id", "2.0", "f_td", "-285.672"));
-    assertU(adoc("id", "3.0", "f_td", "-1.218"));
+    assertU(adoc("id", "1", "f_td", "-420.126"));
+    assertU(adoc("id", "2", "f_td", "-285.672"));
+    assertU(adoc("id", "3", "f_td", "-1.218"));
     assertU(commit());
 
     assertQ(req("q", "id:1.0", FacetParams.FACET, "true", FacetParams.FACET_FIELD, "f_td", "f.f_td.facet.sort", FacetParams.FACET_SORT_INDEX, FacetParams.FACET_MINCOUNT, "0", FacetParams.FACET_METHOD, FacetParams.FACET_METHOD_fc),

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/53f97845/solr/core/src/test/org/apache/solr/search/TestQueryTypes.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestQueryTypes.java b/solr/core/src/test/org/apache/solr/search/TestQueryTypes.java
index d043c88..0945ea2 100644
--- a/solr/core/src/test/org/apache/solr/search/TestQueryTypes.java
+++ b/solr/core/src/test/org/apache/solr/search/TestQueryTypes.java
@@ -45,7 +45,7 @@ public class TestQueryTypes extends AbstractSolrTestCase {
     assertU(adoc("id","10","text_no_analyzer","should just work"));
 
     Object[] arr = new Object[] {
-    "id",999.0
+    "id",999
     ,"v_s","wow dude"
     ,"v_t","wow"
     ,"v_ti",-1
@@ -116,7 +116,7 @@ public class TestQueryTypes extends AbstractSolrTestCase {
 
     // frange and function query only work on single valued field types
     Object[] fc_vals = new Object[] {
-      "id",999.0
+      "id_i",999
       ,"v_s","wow dude"
       ,"v_ti",-1
       ,"v_tl",-1234567891234567890L
@@ -154,7 +154,7 @@ public class TestQueryTypes extends AbstractSolrTestCase {
               ,"//result[@numFound='1']"
               );
 
-      if (!"id".equals(f)) {
+      if (!"id_i".equals(f)) {
         assertQ(req( "fq","id:1", "q", "{!frange l=1 u=1}if(exists("+f+"),1,0)" )
             ,"//result[@numFound='0']"
         );

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/53f97845/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java b/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
index 675123c..7c9fa49 100644
--- a/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
+++ b/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
@@ -59,10 +59,10 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
   }
 
 
-  void createIndex(String field, float... values) {
+  void createIndex(String field, int... values) {
     // lrf.args.put("version","2.0");
-    for (float val : values) {
-      String s = Float.toString(val);
+    for (int val : values) {
+      String s = Integer.toString(val);
 
       if (field!=null) assertU(adoc("id", s, field, s));
       else assertU(adoc("id", s));
@@ -98,6 +98,10 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
   }
 
   protected void singleTest(String field, String funcTemplate, List<String> args, float... results) {
+    // NOTE: we're abusing the "results" float[] here ...
+    // - even elements are ids which must be valid 'ints'
+    // - odd elements are the expected score values
+    
     String parseableQuery = func(field, funcTemplate);
 
     List<String> nargs = new ArrayList<>(Arrays.asList("q", parseableQuery
@@ -113,13 +117,12 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
 
     List<String> tests = new ArrayList<>();
 
-    // Construct xpaths like the following:
-    // "//doc[./float[@name='foo_f']='10.0' and ./float[@name='score']='10.0']"
-
     for (int i=0; i<results.length; i+=2) {
-      String xpath = "//doc[./float[@name='" + "id" + "']='"
-              + results[i] + "' and ./float[@name='score']='"
-              + results[i+1] + "']";
+      final int id = (int) results[i];
+      assert ((float) id) == results[i];
+        
+      String xpath = "//doc[./str[@name='id']='" + id + "' " 
+        + " and ./float[@name='score']='" + results[i+1] + "']";
       tests.add(xpath);
     }
 
@@ -134,9 +137,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
 
   void doTest(String field) {
     // lrf.args.put("version","2.0");
-    float[] vals = new float[] {
-      100,-4,0,10,25,5
-    };
+    int[] vals = { 100,-4,0,10,25,5 };
     createIndex(field,vals);
     createIndex(null, 88);  // id with no value
 
@@ -208,7 +209,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
   public void testExternalField() throws Exception {
     String field = "foo_extf";
 
-    float[] ids = {100,-4,0,10,25,5,77,23,55,-78,-45,-24,63,78,94,22,34,54321,261,-627};
+    int[] ids = {100,-4,0,10,25,5,77,23,55,-78,-45,-24,63,78,94,22,34,54321,261,-627};
 
     createIndex(null,ids);
 
@@ -236,7 +237,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
       // shuffle ids
       for (int j=0; j<ids.length; j++) {
         int other=r.nextInt(ids.length);
-        float v=ids[0];
+        int v=ids[0];
         ids[0] = ids[other];
         ids[other] = v;
       }
@@ -391,8 +392,8 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
     // test that sorting by function query weights correctly.  superman should sort higher than batman due to idf of the whole index
 
     assertQ(req("q", "*:*", "fq","id:120 OR id:121", "sort","{!func v=$sortfunc} desc", "sortfunc","query($qq)", "qq","text:(batman OR superman)")
-           ,"*//doc[1]/float[.='120.0']"
-           ,"*//doc[2]/float[.='121.0']"
+           ,"*//doc[1]/str[.='120']"
+           ,"*//doc[2]/str[.='121']"
     );
   }
 
@@ -681,7 +682,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
     String field = "CoMpleX fieldName _extf";
     String fieldAsFunc = "field(\"CoMpleX fieldName _extf\")";
 
-    float[] ids = {100,-4,0,10,25,5,77,23,55,-78,-45,-24,63,78,94,22,34,54321,261,-627};
+    int[] ids = {100,-4,0,10,25,5,77,23,55,-78,-45,-24,63,78,94,22,34,54321,261,-627};
 
     createIndex(null,ids);
 
@@ -716,7 +717,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
     String field = "CoMpleX \" fieldName _f";
     String fieldAsFunc = "field(\"CoMpleX \\\" fieldName _f\")";
 
-    float[] ids = {100,-4,0,10,25,5,77,1};
+    int[] ids = {100,-4,0,10,25,5,77,1};
 
     createIndex(field, ids);
 
@@ -762,8 +763,8 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
 
 
     // def(), the default function that returns the first value that exists
-    assertJQ(req("q", "id:1", "fl", "x:def(id,testfunc(123.0)), y:def(foo_f,234.0)")
-        , "/response/docs/[0]=={'x':1.0, 'y':234.0}");
+    assertJQ(req("q", "id:1", "fl", "x:def(id,testfunc(123)), y:def(foo_f,234.0)")
+        , "/response/docs/[0]=={'x':'1', 'y':234.0}");
     assertJQ(req("q", "id:1", "fl", "x:def(foo_s,'Q'), y:def(missing_s,'W')")
         , "/response/docs/[0]=={'x':'A', 'y':'W'}");
 


[27/35] lucene-solr:jira/SOLR-10834: SOLR-10833: Updated CHANGES to include SOLR-10833

Posted by ho...@apache.org.
SOLR-10833: Updated CHANGES to include SOLR-10833


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

Branch: refs/heads/jira/SOLR-10834
Commit: 061a768d873b9c7c75b635beee3effef6e66bb2f
Parents: 6396cb7
Author: Tomas Fernandez Lobbe <tf...@apache.org>
Authored: Tue Jun 13 10:57:45 2017 -0700
Committer: Tomas Fernandez Lobbe <tf...@apache.org>
Committed: Tue Jun 13 10:57:45 2017 -0700

----------------------------------------------------------------------
 solr/CHANGES.txt | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/061a768d/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index c1c7293..7468fc3 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -370,6 +370,9 @@ Bug Fixes
 
 * SOLR-10704: REPLACENODE may cause data loss when replicationFactor is 1. (ab, shalin)
 
+* SOLR-10833: Point numeric fields should throw SolrException(BAD_REQUEST) for malformed numbers in queries.
+              Trie numeric fields should throw SolrException(BAD_REQUEST) for malformed docValues range queries.
+  (hossman, Tomás Fernández Löbbe)
 
 Optimizations
 ----------------------


[02/35] lucene-solr:jira/SOLR-10834: SOLR-10836: igain, significantTerms, and tlogit assumed existing terms

Posted by ho...@apache.org.
SOLR-10836: igain, significantTerms, and tlogit assumed existing terms


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

Branch: refs/heads/jira/SOLR-10834
Commit: 5c781d5679716dc46a28015c03ef9bcae824e58c
Parents: 566fcfc
Author: David Smiley <ds...@apache.org>
Authored: Fri Jun 9 23:39:23 2017 -0400
Committer: David Smiley <ds...@apache.org>
Committed: Fri Jun 9 23:39:23 2017 -0400

----------------------------------------------------------------------
 solr/CHANGES.txt                                            | 5 +++++
 .../org/apache/solr/search/IGainTermsQParserPlugin.java     | 5 ++---
 .../apache/solr/search/SignificantTermsQParserPlugin.java   | 9 ++++-----
 .../solr/search/TextLogisticRegressionQParserPlugin.java    | 5 ++---
 4 files changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5c781d56/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index d99a075..039a2c4 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -350,6 +350,11 @@ Bug Fixes
 
 * SOLR-10829: Fixed IndexSchema to enforce that uniqueKey can not be Points based for correctness (hossman)
 
+* SOLR-10836: The query parsers igain, significantTerms, and tlogit (used by streaming expressions by
+  the same name) might throw a NullPointerException if the referenced field had no indexed data in some
+  shards. The fix included an optimization to use Solr's cached AtomicReader instead of re-calculating.
+  (David Smiley)
+
 Optimizations
 ----------------------
 * SOLR-10634: JSON Facet API: When a field/terms facet will retrieve all buckets (i.e. limit:-1)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5c781d56/solr/core/src/java/org/apache/solr/search/IGainTermsQParserPlugin.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/IGainTermsQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/IGainTermsQParserPlugin.java
index bccbe06..053f50f 100644
--- a/solr/core/src/java/org/apache/solr/search/IGainTermsQParserPlugin.java
+++ b/solr/core/src/java/org/apache/solr/search/IGainTermsQParserPlugin.java
@@ -23,7 +23,6 @@ import java.util.TreeSet;
 
 import org.apache.lucene.index.LeafReader;
 import org.apache.lucene.index.LeafReaderContext;
-import org.apache.lucene.index.MultiFields;
 import org.apache.lucene.index.NumericDocValues;
 import org.apache.lucene.index.PostingsEnum;
 import org.apache.lucene.index.Terms;
@@ -162,8 +161,8 @@ public class IGainTermsQParserPlugin extends QParserPlugin {
       double pc = numPositiveDocs / numDocs;
       double entropyC = binaryEntropy(pc);
 
-      Terms terms = MultiFields.getFields(searcher.getIndexReader()).terms(field);
-      TermsEnum termsEnum = terms.iterator();
+      Terms terms = ((SolrIndexSearcher)searcher).getSlowAtomicReader().terms(field);
+      TermsEnum termsEnum = terms == null ? TermsEnum.EMPTY : terms.iterator();
       BytesRef term;
       PostingsEnum postingsEnum = null;
       while ((term = termsEnum.next()) != null) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5c781d56/solr/core/src/java/org/apache/solr/search/SignificantTermsQParserPlugin.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/SignificantTermsQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/SignificantTermsQParserPlugin.java
index 9b9a46b..8346316 100644
--- a/solr/core/src/java/org/apache/solr/search/SignificantTermsQParserPlugin.java
+++ b/solr/core/src/java/org/apache/solr/search/SignificantTermsQParserPlugin.java
@@ -19,12 +19,11 @@ package org.apache.solr.search;
 
 
 import java.io.IOException;
-import java.util.TreeSet;
-import java.util.List;
 import java.util.ArrayList;
+import java.util.List;
+import java.util.TreeSet;
 
 import org.apache.lucene.index.LeafReaderContext;
-import org.apache.lucene.index.MultiFields;
 import org.apache.lucene.index.PostingsEnum;
 import org.apache.lucene.index.Terms;
 import org.apache.lucene.index.TermsEnum;
@@ -146,8 +145,8 @@ public class SignificantTermsQParserPlugin extends QParserPlugin {
       //TODO: Use a priority queue
       TreeSet<TermWithScore> topTerms = new TreeSet<>();
 
-      Terms terms = MultiFields.getFields(searcher.getIndexReader()).terms(field);
-      TermsEnum termsEnum = terms.iterator();
+      Terms terms = ((SolrIndexSearcher)searcher).getSlowAtomicReader().terms(field);
+      TermsEnum termsEnum = terms == null ? TermsEnum.EMPTY : terms.iterator();
       BytesRef term;
       PostingsEnum postingsEnum = null;
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5c781d56/solr/core/src/java/org/apache/solr/search/TextLogisticRegressionQParserPlugin.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/TextLogisticRegressionQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/TextLogisticRegressionQParserPlugin.java
index c1b8906..842f746 100644
--- a/solr/core/src/java/org/apache/solr/search/TextLogisticRegressionQParserPlugin.java
+++ b/solr/core/src/java/org/apache/solr/search/TextLogisticRegressionQParserPlugin.java
@@ -26,7 +26,6 @@ import java.util.Map;
 
 import org.apache.lucene.index.LeafReader;
 import org.apache.lucene.index.LeafReaderContext;
-import org.apache.lucene.index.MultiFields;
 import org.apache.lucene.index.NumericDocValues;
 import org.apache.lucene.index.PostingsEnum;
 import org.apache.lucene.index.Terms;
@@ -173,8 +172,8 @@ public class TextLogisticRegressionQParserPlugin extends QParserPlugin {
     public void finish() throws IOException {
 
       Map<Integer, double[]> docVectors = new HashMap<>();
-      Terms terms = MultiFields.getFields(searcher.getIndexReader()).terms(trainingParams.feature);
-      TermsEnum termsEnum = terms.iterator();
+      Terms terms = ((SolrIndexSearcher)searcher).getSlowAtomicReader().terms(trainingParams.feature);
+      TermsEnum termsEnum = terms == null ? TermsEnum.EMPTY : terms.iterator();
       PostingsEnum postingsEnum = null;
       int termIndex = 0;
       for (String termStr : trainingParams.terms) {


[08/35] lucene-solr:jira/SOLR-10834: SOLR-10715: Welcome message should work for _introspect

Posted by ho...@apache.org.
SOLR-10715: Welcome message should work for _introspect


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

Branch: refs/heads/jira/SOLR-10834
Commit: 41d12df6d247b678b1a24c26567a08c2135b68ce
Parents: 6075956
Author: Cao Manh Dat <da...@apache.org>
Authored: Mon Jun 12 10:46:38 2017 +0700
Committer: Cao Manh Dat <da...@apache.org>
Committed: Mon Jun 12 10:46:38 2017 +0700

----------------------------------------------------------------------
 solr/CHANGES.txt                                                 | 2 ++
 solr/core/src/java/org/apache/solr/api/V2HttpCall.java           | 2 +-
 .../src/test/org/apache/solr/handler/V2ApiIntegrationTest.java   | 4 ++++
 solr/core/src/test/org/apache/solr/handler/V2StandaloneTest.java | 4 ++++
 4 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/41d12df6/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 275710d..6eb2152 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -156,6 +156,8 @@ Bug Fixes
 
 * SOLR-10223: Allow running examples as root on Linux with -force option (janhoy)
 
+* SOLR-10715: /v2/ should not be an alias for /v2/collections (Cao Manh Dat)
+
 Optimizations
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/41d12df6/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/api/V2HttpCall.java b/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
index da2781e..5e7c0b1 100644
--- a/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
+++ b/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
@@ -79,7 +79,7 @@ public class V2HttpCall extends HttpSolrCall {
     String fullPath = path = path.substring(7);//strip off '/____v2'
     try {
       pieces = getPathSegments(path);
-      if (pieces.size() == 0) {
+      if (pieces.size() == 0 || (pieces.size() == 1 && path.endsWith(CommonParams.INTROSPECT))) {
         api = new Api(null) {
           @Override
           public void call(SolrQueryRequest req, SolrQueryResponse rsp) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/41d12df6/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
index 4741ef4..66f5dbe 100644
--- a/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
@@ -57,6 +57,10 @@ public class V2ApiIntegrationTest extends SolrCloudTestCase {
         new V2Request.Builder("").build());
     NamedList header = (NamedList) res.get("responseHeader");
     assertEquals(0, header.get("status"));
+
+    res = cluster.getSolrClient().request(new V2Request.Builder("/_introspect").build());
+    header = (NamedList) res.get("responseHeader");
+    assertEquals(0, header.get("status"));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/41d12df6/solr/core/src/test/org/apache/solr/handler/V2StandaloneTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/V2StandaloneTest.java b/solr/core/src/test/org/apache/solr/handler/V2StandaloneTest.java
index 2d5b2a9..ccf2a58 100644
--- a/solr/core/src/test/org/apache/solr/handler/V2StandaloneTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/V2StandaloneTest.java
@@ -42,6 +42,10 @@ public class V2StandaloneTest extends SolrTestCaseJ4{
       NamedList res = client.request(new V2Request.Builder("/").build());
       NamedList header = (NamedList) res.get("responseHeader");
       assertEquals(0, header.get("status"));
+
+      res = client.request(new V2Request.Builder("/_introspect").build());
+      header = (NamedList) res.get("responseHeader");
+      assertEquals(0, header.get("status"));
     }
 
     jetty.stop();


[09/35] lucene-solr:jira/SOLR-10834: SOLR-10870: SolrRequestParsers does unnecessary check for /config prefix

Posted by ho...@apache.org.
SOLR-10870: SolrRequestParsers does unnecessary check for /config prefix


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

Branch: refs/heads/jira/SOLR-10834
Commit: e11eb63f60acf78278ba88cb777b17bb1daba314
Parents: 41d12df
Author: Noble Paul <no...@apache.org>
Authored: Mon Jun 12 18:01:09 2017 +0930
Committer: Noble Paul <no...@apache.org>
Committed: Mon Jun 12 18:01:09 2017 +0930

----------------------------------------------------------------------
 .../org/apache/solr/servlet/SolrRequestParsers.java    | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e11eb63f/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java b/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java
index 9aae8e9..1300bd9 100644
--- a/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java
+++ b/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java
@@ -16,8 +16,7 @@
  */
 package org.apache.solr.servlet;
 
-import static org.apache.solr.common.params.CommonParams.PATH;
-
+import javax.servlet.http.HttpServletRequest;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
@@ -39,8 +38,6 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
-import javax.servlet.http.HttpServletRequest;
-
 import org.apache.commons.fileupload.FileItem;
 import org.apache.commons.fileupload.disk.DiskFileItemFactory;
 import org.apache.commons.fileupload.servlet.ServletFileUpload;
@@ -53,6 +50,7 @@ import org.apache.solr.common.SolrException.ErrorCode;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.MultiMapSolrParams;
 import org.apache.solr.common.params.SolrParams;
+import org.apache.solr.common.util.CommandOperation;
 import org.apache.solr.common.util.ContentStream;
 import org.apache.solr.common.util.ContentStreamBase;
 import org.apache.solr.common.util.FastInputStream;
@@ -61,10 +59,11 @@ import org.apache.solr.core.SolrConfig;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.request.SolrQueryRequestBase;
-import org.apache.solr.common.util.CommandOperation;
 import org.apache.solr.util.RTimerTree;
 import org.apache.solr.util.SolrFileCleaningTracker;
 
+import static org.apache.solr.common.params.CommonParams.PATH;
+
 
 public class SolrRequestParsers 
 {
@@ -746,10 +745,6 @@ public class SolrRequestParsers
         if (idx >= 0 && uri.endsWith("/schema") || uri.contains("/schema/")) {
           restletPath = true;
         }
-        idx = uri.indexOf("/config");
-        if (idx >= 0 && uri.endsWith("/config") || uri.contains("/config/")) {
-          restletPath = true;
-        }
 
         if (restletPath) {
           return parseQueryString(req.getQueryString());


[35/35] lucene-solr:jira/SOLR-10834: Merge branch 'master' into jira/SOLR-10834

Posted by ho...@apache.org.
Merge branch 'master' into jira/SOLR-10834


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

Branch: refs/heads/jira/SOLR-10834
Commit: fcf98132410ed247e451bb449a8337a09bd857ce
Parents: 05e8e22 a18a4ce
Author: Chris Hostetter <ho...@apache.org>
Authored: Tue Jun 13 16:25:06 2017 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Tue Jun 13 16:25:06 2017 -0700

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  8 +++--
 solr/bin/solr                                   | 17 +++++++--
 solr/bin/solr.cmd                               | 22 ++++++++++--
 .../org/apache/solr/handler/SchemaHandler.java  |  6 +++-
 .../org/apache/solr/rest/BaseSolrResource.java  |  6 ++--
 .../solr/search/facet/FacetFieldProcessor.java  |  1 +
 .../apache/solr/search/facet/FacetRange.java    |  6 +++-
 .../search/facet/TestJsonFacetRefinement.java   | 36 +++++++++++++-------
 .../solr/search/facet/TestJsonFacets.java       |  6 ++++
 .../client/solrj/io/stream/FacetStream.java     |  3 ++
 .../solr/common/params/MapSolrParams.java       | 17 ++++++---
 11 files changed, 101 insertions(+), 27 deletions(-)
----------------------------------------------------------------------



[17/35] lucene-solr:jira/SOLR-10834: SOLR-10851: SolrClients should clarify expectations for solrServerUrl parameter

Posted by ho...@apache.org.
SOLR-10851: SolrClients should clarify expectations for solrServerUrl parameter


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

Branch: refs/heads/jira/SOLR-10834
Commit: 833a6f3ffbed729869dafeebe5a3c4aa14c113f8
Parents: 94220a0
Author: Tomas Fernandez Lobbe <tf...@apache.org>
Authored: Mon Jun 12 15:46:13 2017 -0700
Committer: Tomas Fernandez Lobbe <tf...@apache.org>
Committed: Mon Jun 12 15:47:46 2017 -0700

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  3 +
 solr/solr-ref-guide/src/using-solrj.adoc        |  8 ++
 .../solr/client/solrj/impl/CloudSolrClient.java | 10 ++-
 .../solrj/impl/ConcurrentUpdateSolrClient.java  | 18 ++++-
 .../solr/client/solrj/impl/HttpSolrClient.java  | 80 +++++++++++++++-----
 .../client/solrj/impl/LBHttpSolrClient.java     | 38 +++++++++-
 6 files changed, 133 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/833a6f3f/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 51d2d53..153ed82 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -406,6 +406,9 @@ Other Changes
 * SOLR-10761: Switch trie numeric/date fields to points in data-driven-enabled example and test schemas.
   (Steve Rowe)
 
+* SOLR-10851: SolrClients should clarify expectations for solrServerUrl parameter (Jason Gerlowski 
+  via Tomás Fernández Löbbe)
+
 ==================  6.6.1 ==================
 
 Bug Fixes

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/833a6f3f/solr/solr-ref-guide/src/using-solrj.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/using-solrj.adoc b/solr/solr-ref-guide/src/using-solrj.adoc
index fb92bd9..b619aed 100644
--- a/solr/solr-ref-guide/src/using-solrj.adoc
+++ b/solr/solr-ref-guide/src/using-solrj.adoc
@@ -69,6 +69,14 @@ You can sidestep a lot of the messing around with the JAR files by using Maven i
 
 If you are worried about the SolrJ libraries expanding the size of your client application, you can use a code obfuscator like http://proguard.sourceforge.net/[ProGuard] to remove APIs that you are not using.
 
+[[UsingSolrJ-SpecifyingSolrUrl]]
+== Specifying Solr Base URLs
+
+Most `SolrClient` implementations (with the notable exception of `CloudSolrClient`) require users to specify one or more Solr base URLs, which the client then uses to send HTTP requests to Solr.  The path users include on the base URL they provide has an effect on the behavior of the created client from that point on.
+
+. A URL with a path pointing to a specific core or collection (e.g. `http://hostname:8983/solr/core1`).  When a core or collection is specified in the base URL, subsequent requests made with that client are not required to re-specify the affected collection.  However, the client is limited to sending requests to  that core/collection, and can not send requests to any others.
+. A URL with a generic path pointing to the root Solr path (e.g. `http://hostname:8983/solr`).  When no core or collection is specified in the base URL, requests can be made to any core/collection, but the affected core/collection must be specified on all requests.
+
 [[UsingSolrJ-SettingXMLResponseParser]]
 == Setting XMLResponseParser
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/833a6f3f/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
index 11f6b26..10ea590 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
@@ -250,8 +250,8 @@ public class CloudSolrClient extends SolrClient {
    *          chroot is required, use null.
    * @param solrUrls
    *          A list of Solr URLs to configure the underlying {@link HttpClusterStateProvider}, which will
-   *          use of the these URLs to fetch the list of live nodes for this Solr cluster. Provide only
-   *          one of solrUrls or zkHosts.
+   *          use of the these URLs to fetch the list of live nodes for this Solr cluster.  URL's must point to the
+   *          root Solr path ("/solr"). Provide only one of solrUrls or zkHosts.
    * @param httpClient
    *          the {@link HttpClient} instance to be used for all requests. The provided httpClient should use a
    *          multi-threaded connection manager.  If null, a default HttpClient will be used.
@@ -1403,6 +1403,9 @@ public class CloudSolrClient extends SolrClient {
      *
      * Method may be called multiple times. One of the provided values will be used to fetch
      * the list of live Solr nodes that the underlying {@link HttpClusterStateProvider} would be maintaining.
+     * 
+     * Provided Solr URL is expected to point to the root Solr path ("http://hostname:8983/solr"); it should not
+     * include any collections, cores, or other path components.
      */
     public Builder withSolrUrl(String solrUrl) {
       this.solrUrls.add(solrUrl);
@@ -1413,6 +1416,9 @@ public class CloudSolrClient extends SolrClient {
      * Provide a list of Solr URL to be used when configuring {@link CloudSolrClient} instances.
      * One of the provided values will be used to fetch the list of live Solr
      * nodes that the underlying {@link HttpClusterStateProvider} would be maintaining.
+     * 
+     * Provided Solr URLs are expected to point to the root Solr path ("http://hostname:8983/solr"); they should not
+     * include any collections, cores, or other path components.
      */
     public Builder withSolrUrl(Collection<String> solrUrls) {
       this.solrUrls.addAll(solrUrls);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/833a6f3f/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java
index d6675f2..f169a60 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java
@@ -753,7 +753,23 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
     /**
      * Create a Builder object, based on the provided Solr URL.
      * 
-     * @param baseSolrUrl the base URL of the Solr server that will be targeted by any created clients.
+     * Two different paths can be specified as a part of this URL:
+     * 
+     * 1) A path pointing directly at a particular core
+     * <pre>
+     *   SolrClient client = new ConcurrentUpdateSolrClient.Builder("http://my-solr-server:8983/solr/core1").build();
+     *   QueryResponse resp = client.query(new SolrQuery("*:*"));
+     * </pre>
+     * Note that when a core is provided in the base URL, queries and other requests can be made without mentioning the
+     * core explicitly.  However, the client can only send requests to that core.
+     * 
+     * 2) The path of the root Solr path ("/solr")
+     * <pre>
+     *   SolrClient client = new ConcurrentUpdateSolrClient.Builder("http://my-solr-server:8983/solr").build();
+     *   QueryResponse resp = client.query("core1", new SolrQuery("*:*"));
+     * </pre>
+     * In this case the client is more flexible and can be used to send requests to any cores.  This flexibility though
+     * requires that the core be specified on all requests. 
      */
     public Builder(String baseSolrUrl) {
       this.baseSolrUrl = baseSolrUrl;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/833a6f3f/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java
index c1e9576..1ba08bf 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java
@@ -83,24 +83,6 @@ import org.slf4j.MDC;
 
 /**
  * A SolrClient implementation that talks directly to a Solr server via HTTP
- *
- * There are two ways to use an HttpSolrClient:
- *
- * 1) Pass a URL to the constructor that points directly at a particular core
- * <pre>
- *   SolrClient client = new HttpSolrClient("http://my-solr-server:8983/solr/core1");
- *   QueryResponse resp = client.query(new SolrQuery("*:*"));
- * </pre>
- * In this case, you can query the given core directly, but you cannot query any other
- * cores or issue CoreAdmin requests with this client.
- *
- * 2) Pass the base URL of the node to the constructor
- * <pre>
- *   SolrClient client = new HttpSolrClient("http://my-solr-server:8983/solr");
- *   QueryResponse resp = client.query("core1", new SolrQuery("*:*"));
- * </pre>
- * In this case, you must pass the name of the required core for all queries and updates,
- * but you may use the same client for all cores, and for CoreAdmin requests.
  */
 public class HttpSolrClient extends SolrClient {
 
@@ -646,6 +628,27 @@ public class HttpSolrClient extends SolrClient {
     return baseUrl;
   }
   
+  /**
+   * Change the base-url used when sending requests to Solr.
+   * 
+   * Two different paths can be specified as a part of this URL:
+   * 
+   * 1) A path pointing directly at a particular core
+   * <pre>
+   *   httpSolrClient.setBaseURL("http://my-solr-server:8983/solr/core1");
+   *   QueryResponse resp = httpSolrClient.query(new SolrQuery("*:*"));
+   * </pre>
+   * Note that when a core is provided in the base URL, queries and other requests can be made without mentioning the
+   * core explicitly.  However, the client can only send requests to that core.
+   * 
+   * 2) The path of the root Solr path ("/solr")
+   * <pre>
+   *   httpSolrClient.setBaseURL("http://my-solr-server:8983/solr");
+   *   QueryResponse resp = httpSolrClient.query("core1", new SolrQuery("*:*"));
+   * </pre>
+   * In this case the client is more flexible and can be used to send requests to any cores.  The cost of this is that
+   * the core must be specified on each request.
+   */
   public void setBaseURL(String baseURL) {
     this.baseUrl = baseURL;
   }
@@ -762,6 +765,27 @@ public class HttpSolrClient extends SolrClient {
       this.responseParser = new BinaryResponseParser();
     }
 
+    /**
+     * Specify the base-url for the created client to use when sending requests to Solr.
+     * 
+     * Two different paths can be specified as a part of this URL:
+     * 
+     * 1) A path pointing directly at a particular core
+     * <pre>
+     *   SolrClient client = builder.withBaseSolrUrl("http://my-solr-server:8983/solr/core1").build();
+     *   QueryResponse resp = client.query(new SolrQuery("*:*"));
+     * </pre>
+     * Note that when a core is provided in the base URL, queries and other requests can be made without mentioning the
+     * core explicitly.  However, the client can only send requests to that core.
+     * 
+     * 2) The path of the root Solr path ("/solr")
+     * <pre>
+     *   SolrClient client = builder.withBaseSolrUrl("http://my-solr-server:8983/solr").build();
+     *   QueryResponse resp = client.query("core1", new SolrQuery("*:*"));
+     * </pre>
+     * In this case the client is more flexible and can be used to send requests to any cores.  This flexibility though
+     * requires that the core is specified on all requests.
+     */
     public Builder withBaseSolrUrl(String baseSolrUrl) {
       this.baseSolrUrl = baseSolrUrl;
       return this;
@@ -770,9 +794,25 @@ public class HttpSolrClient extends SolrClient {
     /**
      * Create a Builder object, based on the provided Solr URL.
      * 
-     * By default, compression is not enabled in created HttpSolrClient objects.
+     * Two different paths can be specified as a part of this URL:
+     * 
+     * 1) A path pointing directly at a particular core
+     * <pre>
+     *   SolrClient client = new HttpSolrClient.Builder("http://my-solr-server:8983/solr/core1").build();
+     *   QueryResponse resp = client.query(new SolrQuery("*:*"));
+     * </pre>
+     * Note that when a core is provided in the base URL, queries and other requests can be made without mentioning the
+     * core explicitly.  However, the client can only send requests to that core.
+     * 
+     * 2) The path of the root Solr path ("/solr")
+     * <pre>
+     *   SolrClient client = new HttpSolrClient.Builder("http://my-solr-server:8983/solr").build();
+     *   QueryResponse resp = client.query("core1", new SolrQuery("*:*"));
+     * </pre>
+     * In this case the client is more flexible and can be used to send requests to any cores.  This flexibility though
+     * requires that the core be specified on all requests.
      * 
-     * @param baseSolrUrl the base URL of the Solr server that will be targeted by any created clients.
+     * By default, compression is not enabled on created HttpSolrClient objects.
      */
     public Builder(String baseSolrUrl) {
       this.baseSolrUrl = baseSolrUrl;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/833a6f3f/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.java
index 7706bf6..21816bb 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.java
@@ -867,16 +867,52 @@ public class LBHttpSolrClient extends SolrClient {
      * Provide a Solr endpoint to be used when configuring {@link LBHttpSolrClient} instances.
      * 
      * Method may be called multiple times.  All provided values will be used.
+     * 
+     * Two different paths can be specified as a part of the URL:
+     * 
+     * 1) A path pointing directly at a particular core
+     * <pre>
+     *   SolrClient client = builder.withBaseSolrUrl("http://my-solr-server:8983/solr/core1").build();
+     *   QueryResponse resp = client.query(new SolrQuery("*:*"));
+     * </pre>
+     * Note that when a core is provided in the base URL, queries and other requests can be made without mentioning the
+     * core explicitly.  However, the client can only send requests to that core.
+     * 
+     * 2) The path of the root Solr path ("/solr")
+     * <pre>
+     *   SolrClient client = builder.withBaseSolrUrl("http://my-solr-server:8983/solr").build();
+     *   QueryResponse resp = client.query("core1", new SolrQuery("*:*"));
+     * </pre>
+     * In this case the client is more flexible and can be used to send requests to any cores.  This flexibility though
+     * requires that the core is specified on all requests.
      */
     public Builder withBaseSolrUrl(String baseSolrUrl) {
       this.baseSolrUrls.add(baseSolrUrl);
       return this;
     }
-    
+ 
     /**
      * Provide Solr endpoints to be used when configuring {@link LBHttpSolrClient} instances.
      * 
      * Method may be called multiple times.  All provided values will be used.
+     * 
+     * Two different paths can be specified as a part of each URL:
+     * 
+     * 1) A path pointing directly at a particular core
+     * <pre>
+     *   SolrClient client = builder.withBaseSolrUrls("http://my-solr-server:8983/solr/core1").build();
+     *   QueryResponse resp = client.query(new SolrQuery("*:*"));
+     * </pre>
+     * Note that when a core is provided in the base URL, queries and other requests can be made without mentioning the
+     * core explicitly.  However, the client can only send requests to that core.
+     * 
+     * 2) The path of the root Solr path ("/solr")
+     * <pre>
+     *   SolrClient client = builder.withBaseSolrUrls("http://my-solr-server:8983/solr").build();
+     *   QueryResponse resp = client.query("core1", new SolrQuery("*:*"));
+     * </pre>
+     * In this case the client is more flexible and can be used to send requests to any cores.  This flexibility though
+     * requires that the core is specified on all requests.
      */
     public Builder withBaseSolrUrls(String... solrUrls) {
       for (String baseSolrUrl : solrUrls) {


[03/35] lucene-solr:jira/SOLR-10834: LUCENE-7866: Exclude DelimitedTermFrequencyTokenFilter from random data tests in random chains and factory tests

Posted by ho...@apache.org.
LUCENE-7866: Exclude DelimitedTermFrequencyTokenFilter from random data tests in random chains and factory tests


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

Branch: refs/heads/jira/SOLR-10834
Commit: 1b9f060e25f09445e6f60956793d049dfca7a774
Parents: 5c781d5
Author: Uwe Schindler <us...@apache.org>
Authored: Sat Jun 10 10:30:54 2017 +0200
Committer: Uwe Schindler <us...@apache.org>
Committed: Sat Jun 10 10:30:54 2017 +0200

----------------------------------------------------------------------
 .../lucene/analysis/core/TestFactories.java     | 46 +++++++++++++-------
 .../lucene/analysis/core/TestRandomChains.java  |  3 ++
 2 files changed, 34 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1b9f060e/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestFactories.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestFactories.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestFactories.java
index 956a394..499774e 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestFactories.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestFactories.java
@@ -21,13 +21,17 @@ import java.io.IOException;
 import java.io.Reader;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
+import java.util.Arrays;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.BaseTokenStreamTestCase;
 import org.apache.lucene.analysis.MockTokenizer;
 import org.apache.lucene.analysis.Tokenizer;
+import org.apache.lucene.analysis.miscellaneous.DelimitedTermFrequencyTokenFilterFactory;
 import org.apache.lucene.analysis.util.AbstractAnalysisFactory;
 import org.apache.lucene.analysis.util.CharFilterFactory;
 import org.apache.lucene.analysis.util.MultiTermAwareComponent;
@@ -49,6 +53,12 @@ import org.apache.lucene.util.Version;
 
 // TODO: fix this to use CustomAnalyzer instead of its own FactoryAnalyzer
 public class TestFactories extends BaseTokenStreamTestCase {
+  
+  /** Factories that are excluded from testing it with random data */
+  private static final Set<Class<? extends AbstractAnalysisFactory>> EXCLUDE_FACTORIES_RANDOM_DATA = new HashSet<>(Arrays.asList(
+      DelimitedTermFrequencyTokenFilterFactory.class
+  ));
+  
   public void test() throws IOException {
     for (String tokenizer : TokenizerFactory.availableTokenizers()) {
       doTestTokenizer(tokenizer);
@@ -77,11 +87,13 @@ public class TestFactories extends BaseTokenStreamTestCase {
         assertFalse(mtc instanceof CharFilterFactory);
       }
       
-      // beast it just a little, it shouldnt throw exceptions:
-      // (it should have thrown them in initialize)
-      Analyzer a = new FactoryAnalyzer(factory, null, null);
-      checkRandomData(random(), a, 20, 20, false, false);
-      a.close();
+      if (!EXCLUDE_FACTORIES_RANDOM_DATA.contains(factory.getClass())) {
+        // beast it just a little, it shouldnt throw exceptions:
+        // (it should have thrown them in initialize)
+        Analyzer a = new FactoryAnalyzer(factory, null, null);
+        checkRandomData(random(), a, 20, 20, false, false);
+        a.close();
+      }
     }
   }
   
@@ -99,11 +111,13 @@ public class TestFactories extends BaseTokenStreamTestCase {
         assertTrue(mtc instanceof TokenFilterFactory);
       }
       
-      // beast it just a little, it shouldnt throw exceptions:
-      // (it should have thrown them in initialize)
-      Analyzer a = new FactoryAnalyzer(assertingTokenizer, factory, null);
-      checkRandomData(random(), a, 20, 20, false, false);
-      a.close();
+      if (!EXCLUDE_FACTORIES_RANDOM_DATA.contains(factory.getClass())) {
+        // beast it just a little, it shouldnt throw exceptions:
+        // (it should have thrown them in initialize)
+        Analyzer a = new FactoryAnalyzer(assertingTokenizer, factory, null);
+        checkRandomData(random(), a, 20, 20, false, false);
+        a.close();
+      }
     }
   }
   
@@ -121,11 +135,13 @@ public class TestFactories extends BaseTokenStreamTestCase {
         assertTrue(mtc instanceof CharFilterFactory);
       }
       
-      // beast it just a little, it shouldnt throw exceptions:
-      // (it should have thrown them in initialize)
-      Analyzer a = new FactoryAnalyzer(assertingTokenizer, null, factory);
-      checkRandomData(random(), a, 20, 20, false, false);
-      a.close();
+      if (!EXCLUDE_FACTORIES_RANDOM_DATA.contains(factory.getClass())) {
+        // beast it just a little, it shouldnt throw exceptions:
+        // (it should have thrown them in initialize)
+        Analyzer a = new FactoryAnalyzer(assertingTokenizer, null, factory);
+        checkRandomData(random(), a, 20, 20, false, false);
+        a.close();
+      }
     }
   }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1b9f060e/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java
index 34c31d2..0162ac7 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java
@@ -73,6 +73,7 @@ import org.apache.lucene.analysis.compound.TestCompoundWordTokenFilter;
 import org.apache.lucene.analysis.compound.hyphenation.HyphenationTree;
 import org.apache.lucene.analysis.hunspell.Dictionary;
 import org.apache.lucene.analysis.hunspell.TestHunspellStemFilter;
+import org.apache.lucene.analysis.miscellaneous.DelimitedTermFrequencyTokenFilter;
 import org.apache.lucene.analysis.miscellaneous.HyphenatedWordsFilter;
 import org.apache.lucene.analysis.miscellaneous.LimitTokenCountFilter;
 import org.apache.lucene.analysis.miscellaneous.LimitTokenOffsetFilter;
@@ -159,6 +160,8 @@ public class TestRandomChains extends BaseTokenStreamTestCase {
           WordDelimiterFilter.class,
           // Cannot correct offsets when a char filter had changed them:
           WordDelimiterGraphFilter.class,
+          // requires a special encoded token value, so it may fail with random data:
+          DelimitedTermFrequencyTokenFilter.class,
           // clones of core's filters:
           org.apache.lucene.analysis.core.StopFilter.class,
           org.apache.lucene.analysis.core.LowerCaseFilter.class)) {


[04/35] lucene-solr:jira/SOLR-10834: SOLR-10868: add solrj resource dir to module paths

Posted by ho...@apache.org.
SOLR-10868: add solrj resource dir to module paths


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

Branch: refs/heads/jira/SOLR-10834
Commit: f43f89ee6ca276644f4cfcd751f81cd14c92e02a
Parents: 1b9f060
Author: Noble Paul <no...@apache.org>
Authored: Sun Jun 11 09:42:28 2017 +0930
Committer: Noble Paul <no...@apache.org>
Committed: Sun Jun 11 09:42:28 2017 +0930

----------------------------------------------------------------------
 dev-tools/idea/solr/solrj/src/java/solrj.iml | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f43f89ee/dev-tools/idea/solr/solrj/src/java/solrj.iml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/solr/solrj/src/java/solrj.iml b/dev-tools/idea/solr/solrj/src/java/solrj.iml
index bf81913..e5dde1d 100644
--- a/dev-tools/idea/solr/solrj/src/java/solrj.iml
+++ b/dev-tools/idea/solr/solrj/src/java/solrj.iml
@@ -6,6 +6,9 @@
     <content url="file://$MODULE_DIR$">
       <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
     </content>
+    <content url="file://$MODULE_DIR$/../resources">
+      <sourceFolder url="file://$MODULE_DIR$/../resources" type="java-resource" />
+    </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="library" name="Solrj library" level="project" />


[24/35] lucene-solr:jira/SOLR-10834: fix precommit by removing unused imports

Posted by ho...@apache.org.
fix precommit by removing unused imports


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

Branch: refs/heads/jira/SOLR-10834
Commit: e50332507a6ea3a9589b8919a803200ac144933e
Parents: cdccbfb
Author: Chris Hostetter <ho...@fucit.org>
Authored: Tue Jun 13 09:53:41 2017 -0700
Committer: Chris Hostetter <ho...@fucit.org>
Committed: Tue Jun 13 09:54:09 2017 -0700

----------------------------------------------------------------------
 .../src/test/org/apache/solr/handler/V2ApiIntegrationTest.java    | 3 ---
 1 file changed, 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e5033250/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
index 881e68b..fa6d4e3 100644
--- a/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
@@ -18,9 +18,7 @@
 package org.apache.solr.handler;
 
 
-import java.io.File;
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -33,7 +31,6 @@ import org.apache.solr.cloud.SolrCloudTestCase;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.Utils;
-import org.apache.solr.util.RestTestHarness;
 import org.junit.BeforeClass;
 import org.junit.Test;
 


[20/35] lucene-solr:jira/SOLR-10834: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/lucene-solr

Posted by ho...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/lucene-solr


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

Branch: refs/heads/jira/SOLR-10834
Commit: f29e2d1c7c9ae8c2086aed7a86ef9cdb3cdd8ca6
Parents: b73dffd 6d97305
Author: Cao Manh Dat <da...@apache.org>
Authored: Tue Jun 13 19:38:56 2017 +0700
Committer: Cao Manh Dat <da...@apache.org>
Committed: Tue Jun 13 19:38:56 2017 +0700

----------------------------------------------------------------------
 solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[28/35] lucene-solr:jira/SOLR-10834: fix schemas where '_root_' didn't have a string type

Posted by ho...@apache.org.
fix schemas where '_root_' didn't have a string type


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

Branch: refs/heads/jira/SOLR-10834
Commit: d5bfb5f57016341fbeaf73b5e4c9ed10dc3816d0
Parents: d333f7b
Author: Chris Hostetter <ho...@apache.org>
Authored: Tue Jun 13 11:41:31 2017 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Tue Jun 13 11:41:31 2017 -0700

----------------------------------------------------------------------
 .../solr/collection1/conf/schema-blockjoinfacetcomponent.xml       | 2 +-
 solr/core/src/test-files/solr/collection1/conf/schema.xml          | 2 +-
 .../src/test-files/solr/configsets/configset-2/conf/schema.xml     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d5bfb5f5/solr/core/src/test-files/solr/collection1/conf/schema-blockjoinfacetcomponent.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-blockjoinfacetcomponent.xml b/solr/core/src/test-files/solr/collection1/conf/schema-blockjoinfacetcomponent.xml
index e8c985f..dc23b84 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-blockjoinfacetcomponent.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-blockjoinfacetcomponent.xml
@@ -24,7 +24,7 @@
 
   <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
   <field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/>
-  <field name="_root_" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+  <field name="_root_" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
 
   <field name="name" type="string" indexed="true" stored="true"/>
   <dynamicField name="*_s" type="string" indexed="true" stored="true" multiValued="false"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d5bfb5f5/solr/core/src/test-files/solr/collection1/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema.xml b/solr/core/src/test-files/solr/collection1/conf/schema.xml
index 4c5f872..685ee68 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema.xml
@@ -498,7 +498,7 @@
   <fieldType name="severityType" class="solr.EnumField" enumsConfig="enumsConfig.xml" enumName="severity"/>
 
   <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
-  <field name="_root_" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+  <field name="_root_" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
 
   <field name="signatureField" type="string" indexed="true" stored="false"/>
   <field name="uuid" type="uuid" stored="true"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d5bfb5f5/solr/core/src/test-files/solr/configsets/configset-2/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/configsets/configset-2/conf/schema.xml b/solr/core/src/test-files/solr/configsets/configset-2/conf/schema.xml
index cb4b0e7..73f59c8 100644
--- a/solr/core/src/test-files/solr/configsets/configset-2/conf/schema.xml
+++ b/solr/core/src/test-files/solr/configsets/configset-2/conf/schema.xml
@@ -19,7 +19,7 @@
   <fieldType name="string" class="solr.StrField"/>
   <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
   <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
-  <field name="_root_" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+  <field name="_root_" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
   <dynamicField name="*" type="string" indexed="true" stored="true"/>
   <uniqueKey>id</uniqueKey>
 </schema>


[12/35] lucene-solr:jira/SOLR-10834: SOLR-10857: Solr loads UNLOADed core on request, cleaned up printStackTrace

Posted by ho...@apache.org.
SOLR-10857: Solr loads UNLOADed core on request, cleaned up printStackTrace


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

Branch: refs/heads/jira/SOLR-10834
Commit: 5a737a3aab969b120a84dbc7cd7ed351796576b3
Parents: b2ea95c
Author: Erick Erickson <er...@apache.org>
Authored: Mon Jun 12 09:40:34 2017 -0700
Committer: Erick Erickson <er...@apache.org>
Committed: Mon Jun 12 09:40:34 2017 -0700

----------------------------------------------------------------------
 .../handler/admin/CoreAdminHandlerTest.java     | 22 +++++++++-----------
 1 file changed, 10 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5a737a3a/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java
index f1770f8..06c30e6 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java
@@ -320,18 +320,16 @@ public class CoreAdminHandlerTest extends SolrTestCaseJ4 {
       req.process(client);
     }
 
-    try (HttpSolrClient client = getHttpSolrClient(runner.getBaseUrl() + "/corex")) {
-      client.setConnectionTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT);
-      client.setSoTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT*1000);
-      QueryResponse result = client.query(new SolrQuery("id:*"));
-      //assertEquals(1,result.getResults().getNumFound());
-      fail("expect 404");
-    }catch(Exception e){
-      e.printStackTrace();
-    }
-    finally{
-      runner.stop();
-    }
+    HttpSolrClient.RemoteSolrException rse = expectThrows(HttpSolrClient.RemoteSolrException.class, () -> {
+      try (HttpSolrClient client = getHttpSolrClient(runner.getBaseUrl() + "/corex")) {
+        client.setConnectionTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT);
+        client.setSoTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT * 1000);
+        client.query(new SolrQuery("id:*"));
+      } finally {
+        runner.stop();
+      }
+    });
+    assertTrue(rse.getMessage().contains("Can not find: /solr/corex/select"));
   }
   
   @Test


[34/35] lucene-solr:jira/SOLR-10834: more manual cleanup of tests that had implicit/explicit assumptions that id field was numeric

Posted by ho...@apache.org.
more manual cleanup of tests that had implicit/explicit assumptions that id field was numeric


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

Branch: refs/heads/jira/SOLR-10834
Commit: 05e8e226de359a6d7bc99219eaec161a32268f17
Parents: 6dce948
Author: Chris Hostetter <ho...@apache.org>
Authored: Tue Jun 13 16:24:49 2017 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Tue Jun 13 16:24:49 2017 -0700

----------------------------------------------------------------------
 .../solr/collection1/conf/schema-docValues.xml  |  3 +
 .../apache/solr/TestDistributedGrouping.java    | 18 +++---
 .../org/apache/solr/TestDistributedSearch.java  | 20 +++---
 .../solr/cloud/BasicDistributedZk2Test.java     |  8 +--
 .../solr/cloud/BasicDistributedZkTest.java      | 10 +--
 .../test/org/apache/solr/core/SOLR749Test.java  | 12 ++--
 .../org/apache/solr/handler/TestSQLHandler.java | 32 ++++-----
 .../DistributedExpandComponentTest.java         | 40 ++++++------
 .../component/DistributedMLTComponentTest.java  | 12 ++--
 .../DistributedQueryElevationComponentTest.java |  4 +-
 .../org/apache/solr/schema/DocValuesTest.java   | 68 ++++++++++----------
 .../solr/search/TestCollapseQParserPlugin.java  | 62 +++++++++---------
 .../org/apache/solr/search/TestRangeQuery.java  |  4 +-
 .../solr/search/TestReRankQParserPlugin.java    |  2 +-
 14 files changed, 149 insertions(+), 146 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/05e8e226/solr/core/src/test-files/solr/collection1/conf/schema-docValues.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-docValues.xml b/solr/core/src/test-files/solr/collection1/conf/schema-docValues.xml
index b7e24c7..0216791 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-docValues.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-docValues.xml
@@ -54,6 +54,9 @@
 
 
   <field name="id" type="string" required="true"/>
+  <!-- int varient of id, adding this here simplifies some indexing to do numeric sorting -->
+  <field name="id_i" type="int" indexed="true" stored="true" multiValued="false" />
+  <copyField source="id" dest="id_i" />
 
   <field name="floatdv" type="float" indexed="false" stored="false" docValues="true" default="1"/>
   <field name="intdv" type="int" indexed="false" stored="false" docValues="true" default="2"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/05e8e226/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java b/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java
index ca7f9ee..d187da8 100644
--- a/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java
+++ b/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java
@@ -264,23 +264,23 @@ public class TestDistributedGrouping extends BaseDistributedSearchTestCase {
     // We validate distributed grouping with scoring as first sort.
     // note: this 'q' matches all docs and returns the 'id' as the score, which is unique and so our results should be deterministic.
     handle.put("maxScore", SKIP);// TODO see SOLR-6612
-    query("q", "{!func}id", "rows", 100, "fl", "score,id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", i1 + " desc", "group.sort", "score desc"); // SOLR-2955
-    query("q", "{!func}id", "rows", 100, "fl", "score,id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", "score desc, _docid_ asc, id asc");
-    query("q", "{!func}id", "rows", 100, "fl", "score,id," + i1, "group", "true", "group.field", i1, "group.limit", -1);
+    query("q", "{!func}id_i1", "rows", 100, "fl", "score,id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", i1 + " desc", "group.sort", "score desc"); // SOLR-2955
+    query("q", "{!func}id_i1", "rows", 100, "fl", "score,id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", "score desc, _docid_ asc, id asc");
+    query("q", "{!func}id_i1", "rows", 100, "fl", "score,id," + i1, "group", "true", "group.field", i1, "group.limit", -1);
 
     // some explicit checks of non default sorting, and sort/group.sort with diff clauses
-    query("q", "{!func}id", "rows", 100, "fl", tlong + ",id," + i1, "group", "true",
+    query("q", "{!func}id_i1", "rows", 100, "fl", tlong + ",id," + i1, "group", "true",
           "group.field", i1, "group.limit", -1,
           "sort", tlong+" asc, id desc");
-    query("q", "{!func}id", "rows", 100, "fl", tlong + ",id," + i1, "group", "true",
+    query("q", "{!func}id_i1", "rows", 100, "fl", tlong + ",id," + i1, "group", "true",
           "group.field", i1, "group.limit", -1,
           "sort", "id asc",
           "group.sort", tlong+" asc, id desc");
-    query("q", "{!func}id", "rows", 100, "fl", tlong + ",id," + i1, "group", "true",
+    query("q", "{!func}id_i1", "rows", 100, "fl", tlong + ",id," + i1, "group", "true",
           "group.field", i1, "group.limit", -1,
           "sort", tlong+" asc, id desc",
           "group.sort", "id asc");
-    rsp = query("q", "{!func}id", "fq", oddField+":[* TO *]",
+    rsp = query("q", "{!func}id_i1", "fq", oddField+":[* TO *]",
                 "rows", 100, "fl", tlong + ",id," + i1, "group", "true",
                 "group.field", i1, "group.limit", -1,
                 "sort", tlong+" asc",
@@ -293,8 +293,8 @@ public class TestDistributedGrouping extends BaseDistributedSearchTestCase {
     assertEquals(rsp.toString(), 232, nl.get("groupValue"));
     SolrDocumentList docs = (SolrDocumentList) nl.get("doclist");
     assertEquals(docs.toString(), 5, docs.getNumFound());
-    assertEquals(docs.toString(), 22, docs.get(0).getFirstValue("id"));
-    assertEquals(docs.toString(), 21, docs.get(4).getFirstValue("id"));
+    assertEquals(docs.toString(), "22", docs.get(0).getFirstValue("id"));
+    assertEquals(docs.toString(), "21", docs.get(4).getFirstValue("id"));
 
     
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/05e8e226/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/TestDistributedSearch.java b/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
index fc48847..cde3296 100644
--- a/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
+++ b/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
@@ -242,7 +242,7 @@ public class TestDistributedSearch extends BaseDistributedSearchTestCase {
                 "facet.field", tdate_b, "facet.field", tdate_a);
     assertEquals(2, rsp.getFacetFields().size());
     
-    String facetQuery = "id:[1 TO 15]";
+    String facetQuery = "id_i1:[1 TO 15]";
 
     // simple range facet on one field
     query("q",facetQuery, "rows",100, "facet","true", 
@@ -390,7 +390,7 @@ public class TestDistributedSearch extends BaseDistributedSearchTestCase {
 
       // we want a random query and not just *:* so we'll get zero counts in facets also
       // TODO: do a better random query
-      String q = random().nextBoolean() ? "*:*" : "id:(1 3 5 7 9 11 13) OR id:[100 TO " + random().nextInt(50) + "]";
+      String q = random().nextBoolean() ? "*:*" : "id:(1 3 5 7 9 11 13) OR id_i1:[100 TO " + random().nextInt(50) + "]";
 
       int nolimit = random().nextBoolean() ? -1 : 10000;  // these should be equivalent
 
@@ -412,7 +412,7 @@ public class TestDistributedSearch extends BaseDistributedSearchTestCase {
     ,"facet.field","{!key=other ex=b}"+t1
     ,"facet.field","{!key=again ex=a,b}"+t1
     ,"facet.field",t1
-    ,"fq","{!tag=a}id:[1 TO 7]", "fq","{!tag=b}id:[3 TO 9]"
+    ,"fq","{!tag=a}id_i1:[1 TO 7]", "fq","{!tag=b}id_i1:[3 TO 9]"
     );
     queryAndCompareUIF("q", "*:*", "facet", "true", "facet.field", "{!ex=t1}SubjectTerms_mfacet", "fq", "{!tag=t1}SubjectTerms_mfacet:(test 1)", "facet.limit", "10", "facet.mincount", "1");
 
@@ -522,7 +522,7 @@ public class TestDistributedSearch extends BaseDistributedSearchTestCase {
           "stats.field", "{!key=special_key}stats_dt");
     query("q","*:*", "sort",i1+" desc", "stats", "true", 
           "f.stats_dt.stats.calcdistinct", "true",
-          "fq", "{!tag=xxx}id:[3 TO 9]",
+          "fq", "{!tag=xxx}id_i1:[3 TO 9]",
           "stats.field", "{!key=special_key}stats_dt",
           "stats.field", "{!ex=xxx}stats_dt");
 
@@ -920,20 +920,20 @@ public class TestDistributedSearch extends BaseDistributedSearchTestCase {
     handle.put("time", SKIPVAL);
     handle.put("track", SKIP); //track is not included in single node search
     query("q","now their fox sat had put","fl","*,score",CommonParams.DEBUG_QUERY, "true");
-    query("q", "id:[1 TO 5]", CommonParams.DEBUG_QUERY, "true");
-    query("q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.TIMING);
-    query("q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.RESULTS);
-    query("q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.QUERY);
+    query("q", "id_i1:[1 TO 5]", CommonParams.DEBUG_QUERY, "true");
+    query("q", "id_i1:[1 TO 5]", CommonParams.DEBUG, CommonParams.TIMING);
+    query("q", "id_i1:[1 TO 5]", CommonParams.DEBUG, CommonParams.RESULTS);
+    query("q", "id_i1:[1 TO 5]", CommonParams.DEBUG, CommonParams.QUERY);
 
     // SOLR-6545, wild card field list
     indexr(id, "19", "text", "d", "cat_a_sS", "1" ,t1, "2");
     commit();
 
     rsp = query("q", "id:19", "fl", "id", "fl", "*a_sS");
-    assertFieldValues(rsp.getResults(), "id", 19);
+    assertFieldValues(rsp.getResults(), "id", "19");
 
     rsp = query("q", "id:19", "fl", "id," + t1 + ",cat*");
-    assertFieldValues(rsp.getResults(), "id", 19);
+    assertFieldValues(rsp.getResults(), "id", "19");
 
     // Check Info is added to for each shard
     ModifiableSolrParams q = new ModifiableSolrParams();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/05e8e226/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java
index c8e92fc..02692a0 100644
--- a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java
+++ b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java
@@ -463,10 +463,10 @@ public class BasicDistributedZk2Test extends AbstractFullDistribZkTestBase {
     handle.put("track", SKIP);
     query("q", "now their fox sat had put", "fl", "*,score",
         CommonParams.DEBUG_QUERY, "true");
-    query("q", "id:[1 TO 5]", CommonParams.DEBUG_QUERY, "true");
-    query("q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.TIMING);
-    query("q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.RESULTS);
-    query("q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.QUERY);
+    query("q", "id_i1:[1 TO 5]", CommonParams.DEBUG_QUERY, "true");
+    query("q", "id_i1:[1 TO 5]", CommonParams.DEBUG, CommonParams.TIMING);
+    query("q", "id_i1:[1 TO 5]", CommonParams.DEBUG, CommonParams.RESULTS);
+    query("q", "id_i1:[1 TO 5]", CommonParams.DEBUG, CommonParams.QUERY);
   }
   
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/05e8e226/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
index 18caa58..3ed6f74 100644
--- a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
@@ -271,7 +271,7 @@ public class BasicDistributedZkTest extends AbstractFullDistribZkTestBase {
     ,"facet.field","{!key=other ex=b}"+t1
     ,"facet.field","{!key=again ex=a,b}"+t1
     ,"facet.field",t1
-    ,"fq","{!tag=a}id:[1 TO 7]", "fq","{!tag=b}id:[3 TO 9]"}
+    ,"fq","{!tag=a}id_i1:[1 TO 7]", "fq","{!tag=b}id_i1:[3 TO 9]"}
     );
     query(false, new Object[] {"q", "*:*", "facet", "true", "facet.field", "{!ex=t1}SubjectTerms_mfacet", "fq", "{!tag=t1}SubjectTerms_mfacet:(test 1)", "facet.limit", "10", "facet.mincount", "1"});
 
@@ -321,10 +321,10 @@ public class BasicDistributedZkTest extends AbstractFullDistribZkTestBase {
     handle.put("time", SKIPVAL);
     handle.put("track", SKIP);
     query(false, new Object[] {"q","now their fox sat had put","fl","*,score",CommonParams.DEBUG_QUERY, "true"});
-    query(false, new Object[] {"q", "id:[1 TO 5]", CommonParams.DEBUG_QUERY, "true"});
-    query(false, new Object[] {"q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.TIMING});
-    query(false, new Object[] {"q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.RESULTS});
-    query(false, new Object[] {"q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.QUERY});
+    query(false, new Object[] {"q", "id_i1:[1 TO 5]", CommonParams.DEBUG_QUERY, "true"});
+    query(false, new Object[] {"q", "id_i1:[1 TO 5]", CommonParams.DEBUG, CommonParams.TIMING});
+    query(false, new Object[] {"q", "id_i1:[1 TO 5]", CommonParams.DEBUG, CommonParams.RESULTS});
+    query(false, new Object[] {"q", "id_i1:[1 TO 5]", CommonParams.DEBUG, CommonParams.QUERY});
 
     // try add commitWithin
     long before = cloudClient.query(new SolrQuery("*:*")).getResults().getNumFound();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/05e8e226/solr/core/src/test/org/apache/solr/core/SOLR749Test.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/SOLR749Test.java b/solr/core/src/test/org/apache/solr/core/SOLR749Test.java
index 446c506..2eda77d 100644
--- a/solr/core/src/test/org/apache/solr/core/SOLR749Test.java
+++ b/solr/core/src/test/org/apache/solr/core/SOLR749Test.java
@@ -52,29 +52,29 @@ public class SOLR749Test extends SolrTestCaseJ4 {
 
     // NOTE: we can't rely on the default lucene syntax because "FooQParser" is registered as "lucene"
     assertQ(req("q","{!notfoo}*:*"), "//result[@numFound=100]");
-    assertQ(req("q","{!notfoo}id:[* TO 49]"), "//result[@numFound=50]");
+    assertQ(req("q","{!notfoo}id_i1:[* TO 49]"), "//result[@numFound=50]");
     try {
       assertQ("query wrapped in boost func should only eval func for query matches",
-              req("q","{!boost b=$boostFunc defType=notfoo}id:[* TO 49]",
+              req("q","{!boost b=$boostFunc defType=notfoo}id_i1:[* TO 49]",
                   "boostFunc", "countUsage('boost_func',3.4)"),
               "//result[@numFound=50]");
       assertEquals(50, CountUsageValueSourceParser.getAndClearCount("boost_func"));
 
       assertQ("func query that is filtered should be evaled only for filtered docs",
-              req("q","{!func}product(id,countUsage('func_q',4.5))",
-                  "fq", "{!notfoo}id:[30 TO 59]"),
+              req("q","{!func}product(id_i1,countUsage('func_q',4.5))",
+                  "fq", "{!notfoo}id_i1:[30 TO 59]"),
               "//result[@numFound=30]");
       assertEquals(30, CountUsageValueSourceParser.getAndClearCount("func_q"));
 
       assertQ("func query that wraps a query which is also used as a should be evaled only for filtered docs",
               req("q","{!func}product(query($qq),countUsage('func_q_wrapping_fq',4.5))",
-                  "qq", "{!notfoo}id:[20 TO 39]",
+                  "qq", "{!notfoo}id_i1:[20 TO 39]",
                   "fq", "{!query v=$qq}"),
               "//result[@numFound=20]");
       assertEquals(20, CountUsageValueSourceParser.getAndClearCount("func_q_wrapping_fq"));
 
       assertQ("frange in complex bq w/ other mandatory clauses to check skipping",
-              req("q","{!notfoo}(+id:[20 TO 39] -id:25 +{!frange l=4.5 u=4.5 v='countUsage(frange_in_bq,4.5)'})"),
+              req("q","{!notfoo}(+id_i1:[20 TO 39] -id:25 +{!frange l=4.5 u=4.5 v='countUsage(frange_in_bq,4.5)'})"),
               "//result[@numFound=19]");
 
       // don't assume specific clause evaluation ordering.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/05e8e226/solr/core/src/test/org/apache/solr/handler/TestSQLHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/TestSQLHandler.java b/solr/core/src/test/org/apache/solr/handler/TestSQLHandler.java
index 4889c90..78bdbe0 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestSQLHandler.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestSQLHandler.java
@@ -172,7 +172,7 @@ public class TestSQLHandler extends AbstractFullDistribZkTestBase {
       assert(tuple.get("str_s").equals("a"));
 
       //Assert field order
-      assertResponseContains(clients.get(0), sParams, "{\"docs\":[{\"id\":8,\"field_i\":60,\"str_s\":\"c\"}");
+      assertResponseContains(clients.get(0), sParams, "{\"docs\":[{\"id\":\"8\",\"field_i\":60,\"str_s\":\"c\"}");
 
       //Test unlimited unsorted result. Should sort on _version_ desc
       sParams = mapParams(CommonParams.QT, "/sql", "stmt", "select id, field_i, str_s from collection1 where text='XXXX'");
@@ -375,7 +375,7 @@ public class TestSQLHandler extends AbstractFullDistribZkTestBase {
       assertEquals(1, tuples.size());
 
       Tuple tuple = tuples.get(0);
-      assertEquals(1L, tuple.get("id"));
+      assertEquals("1", tuple.get("id"));
 
       // Not Equals <>
       sParams = mapParams(CommonParams.QT, "/sql",
@@ -387,19 +387,19 @@ public class TestSQLHandler extends AbstractFullDistribZkTestBase {
       assertEquals(7, tuples.size());
 
       tuple = tuples.get(0);
-      assertEquals(2L, tuple.get("id"));
+      assertEquals("2", tuple.get("id"));
       tuple = tuples.get(1);
-      assertEquals(3L, tuple.get("id"));
+      assertEquals("3", tuple.get("id"));
       tuple = tuples.get(2);
-      assertEquals(4L, tuple.get("id"));
+      assertEquals("4", tuple.get("id"));
       tuple = tuples.get(3);
-      assertEquals(5L, tuple.get("id"));
+      assertEquals("5", tuple.get("id"));
       tuple = tuples.get(4);
-      assertEquals(6L, tuple.get("id"));
+      assertEquals("6", tuple.get("id"));
       tuple = tuples.get(5);
-      assertEquals(7L, tuple.get("id"));
+      assertEquals("7", tuple.get("id"));
       tuple = tuples.get(6);
-      assertEquals(8L, tuple.get("id"));
+      assertEquals("8", tuple.get("id"));
 
       // TODO requires different Calcite SQL conformance level
       // Not Equals !=
@@ -436,7 +436,7 @@ public class TestSQLHandler extends AbstractFullDistribZkTestBase {
       assertEquals(1, tuples.size());
 
       tuple = tuples.get(0);
-      assertEquals(1L, tuple.get("id"));
+      assertEquals("1", tuple.get("id"));
 
       // Less than equal
       sParams = mapParams(CommonParams.QT, "/sql",
@@ -448,9 +448,9 @@ public class TestSQLHandler extends AbstractFullDistribZkTestBase {
       assertEquals(2, tuples.size());
 
       tuple = tuples.get(0);
-      assertEquals(1L, tuple.get("id"));
+      assertEquals("1", tuple.get("id"));
       tuple = tuples.get(1);
-      assertEquals(2L, tuple.get("id"));
+      assertEquals("2", tuple.get("id"));
 
       // Greater than
       sParams = mapParams(CommonParams.QT, "/sql",
@@ -462,7 +462,7 @@ public class TestSQLHandler extends AbstractFullDistribZkTestBase {
       assertEquals(1, tuples.size());
 
       tuple = tuples.get(0);
-      assertEquals(8L, tuple.get("id"));
+      assertEquals("8", tuple.get("id"));
 
       // Greater than equal
       sParams = mapParams(CommonParams.QT, "/sql",
@@ -474,9 +474,9 @@ public class TestSQLHandler extends AbstractFullDistribZkTestBase {
       assertEquals(2, tuples.size());
 
       tuple = tuples.get(0);
-      assertEquals(7L, tuple.get("id"));
+      assertEquals("7", tuple.get("id"));
       tuple = tuples.get(1);
-      assertEquals(8L, tuple.get("id"));
+      assertEquals("8", tuple.get("id"));
 
     } finally {
       delete();
@@ -511,7 +511,7 @@ public class TestSQLHandler extends AbstractFullDistribZkTestBase {
       assert(tuples.size() == 8);
 
       Tuple tuple;
-
+      
       tuple = tuples.get(0);
       assert(tuple.getLong("id") == 8);
       assert(tuple.getLong("Field_i") == 60);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/05e8e226/solr/core/src/test/org/apache/solr/handler/component/DistributedExpandComponentTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedExpandComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedExpandComponentTest.java
index 5ca527f..5633c46 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedExpandComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedExpandComponentTest.java
@@ -102,10 +102,10 @@ public class DistributedExpandComponentTest extends BaseDistributedSearchTestCas
     QueryResponse rsp = queryServer(params);
     Map<String, SolrDocumentList> results = rsp.getExpandedResults();
     assertExpandGroups(results, "group1","group2", "group3", "group4");
-    assertExpandGroupCountAndOrder("group1", 2, results, "1.0", "7.0");
-    assertExpandGroupCountAndOrder("group2", 2, results, "5.0", "8.0");
-    assertExpandGroupCountAndOrder("group3", 2, results, "11.0", "9.0");
-    assertExpandGroupCountAndOrder("group4", 2, results, "12.0", "14.0");
+    assertExpandGroupCountAndOrder("group1", 2, results, "1", "7");
+    assertExpandGroupCountAndOrder("group2", 2, results, "5", "8");
+    assertExpandGroupCountAndOrder("group3", 2, results, "11", "9");
+    assertExpandGroupCountAndOrder("group4", 2, results, "12", "14");
 
 
     //Test expand.sort
@@ -121,10 +121,10 @@ public class DistributedExpandComponentTest extends BaseDistributedSearchTestCas
     rsp = queryServer(params);
     results = rsp.getExpandedResults();
     assertExpandGroups(results, "group1","group2", "group3", "group4");
-    assertExpandGroupCountAndOrder("group1", 2, results, "7.0", "1.0");
-    assertExpandGroupCountAndOrder("group2", 2, results, "8.0", "5.0");
-    assertExpandGroupCountAndOrder("group3", 2, results, "9.0", "11.0");
-    assertExpandGroupCountAndOrder("group4", 2, results, "14.0", "12.0");
+    assertExpandGroupCountAndOrder("group1", 2, results, "7", "1");
+    assertExpandGroupCountAndOrder("group2", 2, results, "8", "5");
+    assertExpandGroupCountAndOrder("group3", 2, results, "9", "11");
+    assertExpandGroupCountAndOrder("group4", 2, results, "14", "12");
 
 
     //Test expand.rows
@@ -141,10 +141,10 @@ public class DistributedExpandComponentTest extends BaseDistributedSearchTestCas
     rsp = queryServer(params);
     results = rsp.getExpandedResults();
     assertExpandGroups(results, "group1","group2", "group3", "group4");
-    assertExpandGroupCountAndOrder("group1", 1, results, "7.0");
-    assertExpandGroupCountAndOrder("group2", 1, results, "8.0");
-    assertExpandGroupCountAndOrder("group3", 1, results, "9.0");
-    assertExpandGroupCountAndOrder("group4", 1, results, "14.0");
+    assertExpandGroupCountAndOrder("group1", 1, results, "7");
+    assertExpandGroupCountAndOrder("group2", 1, results, "8");
+    assertExpandGroupCountAndOrder("group3", 1, results, "9");
+    assertExpandGroupCountAndOrder("group4", 1, results, "14");
 
 
     //Test key-only fl
@@ -161,10 +161,10 @@ public class DistributedExpandComponentTest extends BaseDistributedSearchTestCas
     rsp = queryServer(params);
     results = rsp.getExpandedResults();
     assertExpandGroups(results, "group1","group2", "group3", "group4");
-    assertExpandGroupCountAndOrder("group1", 2, results, "1.0", "7.0");
-    assertExpandGroupCountAndOrder("group2", 2, results, "5.0", "8.0");
-    assertExpandGroupCountAndOrder("group3", 2, results, "11.0", "9.0");
-    assertExpandGroupCountAndOrder("group4", 2, results, "12.0", "14.0");
+    assertExpandGroupCountAndOrder("group1", 2, results, "1", "7");
+    assertExpandGroupCountAndOrder("group2", 2, results, "5", "8");
+    assertExpandGroupCountAndOrder("group3", 2, results, "11", "9");
+    assertExpandGroupCountAndOrder("group4", 2, results, "12", "14");
 
     //Test distrib.singlePass true
 
@@ -180,10 +180,10 @@ public class DistributedExpandComponentTest extends BaseDistributedSearchTestCas
     rsp = queryServer(params);
     results = rsp.getExpandedResults();
     assertExpandGroups(results, "group1","group2", "group3", "group4");
-    assertExpandGroupCountAndOrder("group1", 2, results, "1.0", "7.0");
-    assertExpandGroupCountAndOrder("group2", 2, results, "5.0", "8.0");
-    assertExpandGroupCountAndOrder("group3", 2, results, "11.0", "9.0");
-    assertExpandGroupCountAndOrder("group4", 2, results, "12.0", "14.0");
+    assertExpandGroupCountAndOrder("group1", 2, results, "1", "7");
+    assertExpandGroupCountAndOrder("group2", 2, results, "5", "8");
+    assertExpandGroupCountAndOrder("group3", 2, results, "11", "9");
+    assertExpandGroupCountAndOrder("group4", 2, results, "12", "14");
 
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/05e8e226/solr/core/src/test/org/apache/solr/handler/component/DistributedMLTComponentTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedMLTComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedMLTComponentTest.java
index 10116b9..157d6a7 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedMLTComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedMLTComponentTest.java
@@ -140,28 +140,28 @@ public class DistributedMLTComponentTest extends BaseDistributedSearchTestCase {
     // we ask for an mlt.count of 20 to ensure both include all results
     
     query("q", "lowerfilt:moon", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 2,
-        MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
+        MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id_i1 desc", "mlt", "true",
         "mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
         requestHandlerName, "mlt.count", "20");
     
     query("q", "lowerfilt:fox", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 1,
-        MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
+        MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id_i1 desc", "mlt", "true",
         "mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
         requestHandlerName, "mlt.count", "20");
 
     query("q", "lowerfilt:the red fox", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 1,
-        MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
+        MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id_i1 desc", "mlt", "true",
         "mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
         requestHandlerName, "mlt.count", "20");
     
     query("q", "lowerfilt:blue moon", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 1,
-        MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
+        MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id_i1 desc", "mlt", "true",
         "mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
         requestHandlerName, "mlt.count", "20");
 
     // let's query by specifying multiple mlt.fl as comma-separated values
     QueryResponse response = query("q", "lowerfilt:moon", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 2,
-        MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
+        MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id_i1 desc", "mlt", "true",
         "mlt.fl", "lowerfilt1,lowerfilt", "qt", requestHandlerName, "shards.qt",
         requestHandlerName, "mlt.count", "20");
     NamedList<Object> moreLikeThis = (NamedList<Object>) response.getResponse().get("moreLikeThis");
@@ -173,7 +173,7 @@ public class DistributedMLTComponentTest extends BaseDistributedSearchTestCase {
 
     // let's query by specifying multiple mlt.fl as multiple request parameters
     response = query("q", "lowerfilt:moon", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 2,
-        MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
+        MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id_i1 desc", "mlt", "true",
         "mlt.fl", "lowerfilt1", "mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
         requestHandlerName, "mlt.count", "20");
     moreLikeThis = (NamedList<Object>) response.getResponse().get("moreLikeThis");

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/05e8e226/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java
index fb90e83..c211548 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java
@@ -105,7 +105,7 @@ public class DistributedQueryElevationComponentTest extends BaseDistributedSearc
 
     assertTrue(response.getResults().getNumFound() > 0);
     SolrDocument document = response.getResults().get(0);
-    assertEquals(6.0f, document.getFieldValue("id"));
+    assertEquals("6", document.getFieldValue("id"));
     assertEquals(true, document.getFieldValue("[elevated]"));
 
     // Force javabin format
@@ -121,7 +121,7 @@ public class DistributedQueryElevationComponentTest extends BaseDistributedSearc
 
     assertTrue(response.getResults().getNumFound() > 0);
     document = response.getResults().get(0);
-    assertEquals(6.0f, document.getFieldValue("id"));
+    assertEquals("6", document.getFieldValue("id"));
     assertEquals(true, document.getFieldValue("[elevated]"));
   }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/05e8e226/solr/core/src/test/org/apache/solr/schema/DocValuesTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/DocValuesTest.java b/solr/core/src/test/org/apache/solr/schema/DocValuesTest.java
index 43d07c5..43c0006 100644
--- a/solr/core/src/test/org/apache/solr/schema/DocValuesTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/DocValuesTest.java
@@ -366,13 +366,13 @@ public class DocValuesTest extends SolrTestCaseJ4 {
     assertU(commit());
 
     // string: termquery
-    assertQ(req("q", "stringdv:car", "sort", "id asc"),
+    assertQ(req("q", "stringdv:car", "sort", "id_i asc"),
         "//*[@numFound='1']",
         "//result/doc[1]/str[@name='id'][.=4]"
     );
     
     // string: range query
-    assertQ(req("q", "stringdv:[b TO d]", "sort", "id asc"),
+    assertQ(req("q", "stringdv:[b TO d]", "sort", "id_i asc"),
         "//*[@numFound='3']",
         "//result/doc[1]/str[@name='id'][.=1]",
         "//result/doc[2]/str[@name='id'][.=3]",
@@ -380,33 +380,33 @@ public class DocValuesTest extends SolrTestCaseJ4 {
     );
     
     // string: prefix query
-    assertQ(req("q", "stringdv:c*", "sort", "id asc"),
+    assertQ(req("q", "stringdv:c*", "sort", "id_i asc"),
         "//*[@numFound='2']",
         "//result/doc[1]/str[@name='id'][.=3]",
         "//result/doc[2]/str[@name='id'][.=4]"
     );
     
     // string: wildcard query
-    assertQ(req("q", "stringdv:c?r", "sort", "id asc"),
+    assertQ(req("q", "stringdv:c?r", "sort", "id_i asc"),
         "//*[@numFound='1']",
         "//result/doc[1]/str[@name='id'][.=4]"
     );
     
     // string: regexp query
-    assertQ(req("q", "stringdv:/c[a-b]r/", "sort", "id asc"),
+    assertQ(req("q", "stringdv:/c[a-b]r/", "sort", "id_i asc"),
         "//*[@numFound='1']",
         "//result/doc[1]/str[@name='id'][.=4]"
     );
     
     // float: termquery
-    assertQ(req("q", "floatdv:3", "sort", "id asc"),
+    assertQ(req("q", "floatdv:3", "sort", "id_i asc"),
         "//*[@numFound='2']",
         "//result/doc[1]/str[@name='id'][.=3]",
         "//result/doc[2]/str[@name='id'][.=4]"
     );
     
     // float: rangequery
-    assertQ(req("q", "floatdv:[2 TO 3]", "sort", "id asc"),
+    assertQ(req("q", "floatdv:[2 TO 3]", "sort", "id_i asc"),
         "//*[@numFound='3']",
         "//result/doc[1]/str[@name='id'][.=1]",
         "//result/doc[2]/str[@name='id'][.=3]",
@@ -414,59 +414,59 @@ public class DocValuesTest extends SolrTestCaseJ4 {
     );
     
     // (neg) float: termquery
-    assertQ(req("q", "floatdv:\"-5\"", "sort", "id asc"),
+    assertQ(req("q", "floatdv:\"-5\"", "sort", "id_i asc"),
             "//*[@numFound='1']",
             "//result/doc[1]/str[@name='id'][.=2]"
             );
 
     // (neg) float: rangequery
-    assertQ(req("q", "floatdv:[-6 TO -4]", "sort", "id asc"),
+    assertQ(req("q", "floatdv:[-6 TO -4]", "sort", "id_i asc"),
             "//*[@numFound='1']",
             "//result/doc[1]/str[@name='id'][.=2]"
             );
     
     // (cross zero bounds) float: rangequery
-    assertQ(req("q", "floatdv:[-6 TO 2.1]", "sort", "id asc"),
+    assertQ(req("q", "floatdv:[-6 TO 2.1]", "sort", "id_i asc"),
             "//*[@numFound='2']",
             "//result/doc[1]/str[@name='id'][.=1]",
             "//result/doc[2]/str[@name='id'][.=2]"
             );
     
     // int: termquery
-    assertQ(req("q", "intdv:1", "sort", "id asc"),
+    assertQ(req("q", "intdv:1", "sort", "id_i asc"),
             "//*[@numFound='1']",
             "//result/doc[1]/str[@name='id'][.=3]"
             );
     
     // int: rangequery
-    assertQ(req("q", "intdv:[3 TO 4]", "sort", "id asc"),
+    assertQ(req("q", "intdv:[3 TO 4]", "sort", "id_i asc"),
             "//*[@numFound='2']",
             "//result/doc[1]/str[@name='id'][.=1]",
             "//result/doc[2]/str[@name='id'][.=2]"
             );
     
     // (neg) int: termquery
-    assertQ(req("q", "intdv:\"-1\"", "sort", "id asc"),
+    assertQ(req("q", "intdv:\"-1\"", "sort", "id_i asc"),
             "//*[@numFound='1']",
             "//result/doc[1]/str[@name='id'][.=4]"
             );
     
     // (neg) int: rangequery
-    assertQ(req("q", "intdv:[-1 TO 1]", "sort", "id asc"),
+    assertQ(req("q", "intdv:[-1 TO 1]", "sort", "id_i asc"),
             "//*[@numFound='2']",
             "//result/doc[1]/str[@name='id'][.=3]",
             "//result/doc[2]/str[@name='id'][.=4]"
             );
 
     // long: termquery
-    assertQ(req("q", "longdv:1", "sort", "id asc"),
+    assertQ(req("q", "longdv:1", "sort", "id_i asc"),
         "//*[@numFound='2']",
         "//result/doc[1]/str[@name='id'][.=3]",
         "//result/doc[2]/str[@name='id'][.=4]"
     );
     
     // long: rangequery
-    assertQ(req("q", "longdv:[1 TO 2]", "sort", "id asc"),
+    assertQ(req("q", "longdv:[1 TO 2]", "sort", "id_i asc"),
         "//*[@numFound='3']",
         "//result/doc[1]/str[@name='id'][.=2]",
         "//result/doc[2]/str[@name='id'][.=3]",
@@ -474,45 +474,45 @@ public class DocValuesTest extends SolrTestCaseJ4 {
     );
     
     // double: termquery
-    assertQ(req("q", "doubledv:3.1", "sort", "id asc"),
+    assertQ(req("q", "doubledv:3.1", "sort", "id_i asc"),
             "//*[@numFound='1']",
             "//result/doc[1]/str[@name='id'][.=1]"
             );
     
     // double: rangequery
-    assertQ(req("q", "doubledv:[2 TO 3.3]", "sort", "id asc"),
+    assertQ(req("q", "doubledv:[2 TO 3.3]", "sort", "id_i asc"),
             "//*[@numFound='2']",
             "//result/doc[1]/str[@name='id'][.=1]",
             "//result/doc[2]/str[@name='id'][.=3]"
             );
     
     // (neg) double: termquery
-    assertQ(req("q", "doubledv:\"-4.3\"", "sort", "id asc"),
+    assertQ(req("q", "doubledv:\"-4.3\"", "sort", "id_i asc"),
             "//*[@numFound='1']",
             "//result/doc[1]/str[@name='id'][.=2]"
             );
     
     // (neg) double: rangequery
-    assertQ(req("q", "doubledv:[-6 TO -4]", "sort", "id asc"),
+    assertQ(req("q", "doubledv:[-6 TO -4]", "sort", "id_i asc"),
             "//*[@numFound='1']",
             "//result/doc[1]/str[@name='id'][.=2]"
             );
     
     // (cross zero bounds) double: rangequery
-    assertQ(req("q", "doubledv:[-6 TO 2.0]", "sort", "id asc"),
+    assertQ(req("q", "doubledv:[-6 TO 2.0]", "sort", "id_i asc"),
             "//*[@numFound='2']",
             "//result/doc[1]/str[@name='id'][.=2]",
             "//result/doc[2]/str[@name='id'][.=4]"
             );
     // boolean basic queries:
 
-    assertQ(req("q", "booldv:false", "sort", "id asc"),
+    assertQ(req("q", "booldv:false", "sort", "id_i asc"),
         "//*[@numFound='2']",
         "//result/doc[1]/str[@name='id'][.=1]",
         "//result/doc[2]/str[@name='id'][.=3]"
     );
 
-    assertQ(req("q", "booldv:true", "sort", "id asc"),
+    assertQ(req("q", "booldv:true", "sort", "id_i asc"),
         "//*[@numFound='2']",
         "//result/doc[1]/str[@name='id'][.=2]",
         "//result/doc[2]/str[@name='id'][.=4]"
@@ -630,7 +630,7 @@ public class DocValuesTest extends SolrTestCaseJ4 {
         }
         log.info("Expected: "+tests);
         assertQ(req("q", fieldName[i] + ":" + (minInclusive? '[': '{') + min + " TO " + max + (maxInclusive? ']': '}'),
-                         "sort", "id asc", "fl", "id,"+fieldName[i]+",score"),
+                         "sort", "id_i asc", "fl", "id,"+fieldName[i]+",score"),
             testsArr);
       }
     }
@@ -654,20 +654,20 @@ public class DocValuesTest extends SolrTestCaseJ4 {
       assertU(commit());
 
       // Negative Zero to Positive
-      assertQ(req("q", fieldName[i]+":[-0.0 TO 2.5]", "sort", "id asc", "fl", "id,"+fieldName[i]+",score"),
+      assertQ(req("q", fieldName[i]+":[-0.0 TO 2.5]", "sort", "id_i asc", "fl", "id,"+fieldName[i]+",score"),
           "//*[@numFound='1']",
           "//result/doc[1]/str[@name='id'][.=1]"
           );
 
       // Negative to Positive Zero
-      assertQ(req("q", fieldName[i]+":[-6 TO 0]", "sort", "id asc", "fl", "id,"+fieldName[i]+",score"),
+      assertQ(req("q", fieldName[i]+":[-6 TO 0]", "sort", "id_i asc", "fl", "id,"+fieldName[i]+",score"),
           "//*[@numFound='2']",
           "//result/doc[1]/str[@name='id'][.=2]",
           "//result/doc[2]/str[@name='id'][.=5]"
           );
 
       // Negative to Positive
-      assertQ(req("q", fieldName[i]+":[-6 TO 2.5]", "sort", "id asc", "fl", "id,"+fieldName[i]+",score"),
+      assertQ(req("q", fieldName[i]+":[-6 TO 2.5]", "sort", "id_i asc", "fl", "id,"+fieldName[i]+",score"),
           "//*[@numFound='3']",
           "//result/doc[1]/str[@name='id'][.=1]",
           "//result/doc[2]/str[@name='id'][.=2]",
@@ -675,7 +675,7 @@ public class DocValuesTest extends SolrTestCaseJ4 {
           );
 
       // Positive to Positive
-      assertQ(req("q", fieldName[i]+":[2 TO 3]", "sort", "id asc", "fl", "id,"+fieldName[i]+",score"),
+      assertQ(req("q", fieldName[i]+":[2 TO 3]", "sort", "id_i asc", "fl", "id,"+fieldName[i]+",score"),
           "//*[@numFound='3']",
           "//result/doc[1]/str[@name='id'][.=1]",
           "//result/doc[2]/str[@name='id'][.=3]",
@@ -683,7 +683,7 @@ public class DocValuesTest extends SolrTestCaseJ4 {
           );
 
       // Positive to POSITIVE_INF
-      assertQ(req("q", fieldName[i]+":[2 TO *]", "sort", "id asc", "fl", "id,"+fieldName[i]+",score"),
+      assertQ(req("q", fieldName[i]+":[2 TO *]", "sort", "id_i asc", "fl", "id,"+fieldName[i]+",score"),
           "//*[@numFound='4']",
           "//result/doc[1]/str[@name='id'][.=1]",
           "//result/doc[2]/str[@name='id'][.=3]",
@@ -692,14 +692,14 @@ public class DocValuesTest extends SolrTestCaseJ4 {
           );
 
       // NEGATIVE_INF to Negative
-      assertQ(req("q", fieldName[i]+":[* TO -1]", "sort", "id asc", "fl", "id,"+fieldName[i]+",score"),
+      assertQ(req("q", fieldName[i]+":[* TO -1]", "sort", "id_i asc", "fl", "id,"+fieldName[i]+",score"),
           "//*[@numFound='2']",
           "//result/doc[1]/str[@name='id'][.=2]",
           "//result/doc[2]/str[@name='id'][.=6]"
           );
 
       // NEGATIVE_INF to Positive
-      assertQ(req("q", fieldName[i]+":[* TO 2]", "sort", "id asc", "fl", "id,"+fieldName[i]),
+      assertQ(req("q", fieldName[i]+":[* TO 2]", "sort", "id_i asc", "fl", "id,"+fieldName[i]),
           "//*[@numFound='4']",
           "//result/doc[1]/str[@name='id'][.=1]",
           "//result/doc[2]/str[@name='id'][.=2]",
@@ -708,7 +708,7 @@ public class DocValuesTest extends SolrTestCaseJ4 {
           );
 
       // NEGATIVE_INF to Positive (non-inclusive)
-      assertQ(req("q", fieldName[i]+":[* TO 2}", "sort", "id asc", "fl", "id,"+fieldName[i]),
+      assertQ(req("q", fieldName[i]+":[* TO 2}", "sort", "id_i asc", "fl", "id,"+fieldName[i]),
           "//*[@numFound='3']",
           "//result/doc[1]/str[@name='id'][.=2]",
           "//result/doc[2]/str[@name='id'][.=5]",
@@ -716,7 +716,7 @@ public class DocValuesTest extends SolrTestCaseJ4 {
           );
 
       // Negative to POSITIVE_INF
-      assertQ(req("q", fieldName[i]+":[-6 TO *]", "sort", "id asc", "fl", "id,"+fieldName[i]),
+      assertQ(req("q", fieldName[i]+":[-6 TO *]", "sort", "id_i asc", "fl", "id,"+fieldName[i]),
           "//*[@numFound='6']",
           "//result/doc[1]/str[@name='id'][.=1]",
           "//result/doc[2]/str[@name='id'][.=2]",
@@ -727,7 +727,7 @@ public class DocValuesTest extends SolrTestCaseJ4 {
           );
 
       // NEGATIVE_INF to POSITIVE_INF
-      assertQ(req("q", fieldName[i]+":[* TO *]", "sort", "id asc", "fl", "id,"+fieldName[i]+",score"),
+      assertQ(req("q", fieldName[i]+":[* TO *]", "sort", "id_i asc", "fl", "id,"+fieldName[i]+",score"),
           "//*[@numFound='7']",
           "//result/doc[1]/str[@name='id'][.=1]",
           "//result/doc[2]/str[@name='id'][.=2]",

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/05e8e226/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java
index 9b98dba..087c7e1 100644
--- a/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java
@@ -70,7 +70,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     params = new ModifiableSolrParams();
     params.add("q", "*:*");
     params.add("fq", "{!collapse field=group_s sort=$sort}");
-    params.add("sort", "test_i asc, test_l desc, id desc");
+    params.add("sort", "test_i asc, test_l desc, id_i desc");
     assertQ(req(params)
             , "*[count(//doc)=2]"
             ,"//result/doc[1]/str[@name='id'][.='7']"
@@ -80,8 +80,8 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     // group heads are selected using a complex sort, simpler sort used for final groups
     params = new ModifiableSolrParams();
     params.add("q", "*:*");
-    params.add("fq", "{!collapse field=group_s sort='test_i asc, test_l desc, id desc'}");
-    params.add("sort", "id asc");
+    params.add("fq", "{!collapse field=group_s sort='test_i asc, test_l desc, id_i desc'}");
+    params.add("sort", "id_i asc");
     assertQ(req(params)
             , "*[count(//doc)=2]"
             ,"//result/doc[1]/str[@name='id'][.='3']"
@@ -91,8 +91,8 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     // diff up the sort directions, only first clause matters with our data
     params = new ModifiableSolrParams();
     params.add("q", "*:*");
-    params.add("fq", "{!collapse field=group_s sort='test_i desc, test_l asc, id asc'}");
-    params.add("sort", "id desc");
+    params.add("fq", "{!collapse field=group_s sort='test_i desc, test_l asc, id_i asc'}");
+    params.add("sort", "id_i desc");
     assertQ(req(params)
             , "*[count(//doc)=2]"
             ,"//result/doc[1]/str[@name='id'][.='8']"
@@ -103,7 +103,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     params = new ModifiableSolrParams();
     params.add("q", "*:*");
     params.add("fq", "{!collapse field=group_s sort='test_l desc'}");
-    params.add("sort", "id desc");
+    params.add("sort", "id_i desc");
     assertQ(req(params)
             , "*[count(//doc)=2]"
             ,"//result/doc[1]/str[@name='id'][.='6']"
@@ -113,7 +113,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     // score, then tiebreakers; note top level sort by score ASCENDING (just for weirdness)
     params = new ModifiableSolrParams();
     params.add("q", "*:* term_s:YYYY");
-    params.add("fq", "{!collapse field=group_s sort='score desc, test_l desc, test_i asc, id asc'}");
+    params.add("fq", "{!collapse field=group_s sort='score desc, test_l desc, test_i asc, id_i asc'}");
     params.add("sort", "score asc");
     assertQ(req(params)
             , "*[count(//doc)=2]"
@@ -124,8 +124,8 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     // score, then tiebreakers; note no score in top level sort/fl to check needsScores logic
     params = new ModifiableSolrParams();
     params.add("q", "*:* term_s:YYYY");
-    params.add("fq", "{!collapse field=group_s sort='score desc, test_l desc, test_i asc, id asc'}");
-    params.add("sort", "id desc");
+    params.add("fq", "{!collapse field=group_s sort='score desc, test_l desc, test_i asc, id_i asc'}");
+    params.add("sort", "id_i desc");
     assertQ(req(params)
             , "*[count(//doc)=2]"
             ,"//result/doc[1]/str[@name='id'][.='5']"
@@ -136,7 +136,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     params = new ModifiableSolrParams();
     params.add("q", "*:*");
     params.add("fq", "{!collapse field=group_s sort='term_s desc, test_l asc'}");
-    params.add("sort", "id asc");
+    params.add("sort", "id_i asc");
     assertQ(req(params)
             , "*[count(//doc)=2]"
             ,"//result/doc[1]/str[@name='id'][.='1']"
@@ -147,7 +147,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     params = new ModifiableSolrParams();
     params.add("q", "*:*");
     params.add("fq", "{!collapse field=group_s sort='term_s asc, test_l asc'}");
-    params.add("sort", "id asc");
+    params.add("sort", "id_i asc");
     assertQ(req(params)
             , "*[count(//doc)=2]"
             ,"//result/doc[1]/str[@name='id'][.='1']"
@@ -158,7 +158,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     params = new ModifiableSolrParams();
     params.add("q", "*:*");
     params.add("fq", "{!collapse field=test_i sort='term_s asc, group_s asc'}");
-    params.add("sort", "id asc");
+    params.add("sort", "id_i asc");
     assertQ(req(params)
             , "*[count(//doc)=2]"
             ,"//result/doc[1]/str[@name='id'][.='4']"
@@ -168,8 +168,8 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     // collapse on term_s (very sparse) with nullPolicy=collapse
     params = new ModifiableSolrParams();
     params.add("q", "*:*");
-    params.add("fq", "{!collapse field=term_s nullPolicy=collapse sort='test_i asc, test_l desc, id asc'}");
-    params.add("sort", "test_l asc, id asc");
+    params.add("fq", "{!collapse field=term_s nullPolicy=collapse sort='test_i asc, test_l desc, id_i asc'}");
+    params.add("sort", "test_l asc, id_i asc");
     assertQ(req(params)
             , "*[count(//doc)=3]"
             ,"//result/doc[1]/str[@name='id'][.='5']"
@@ -184,7 +184,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     params.add("sort", "test_l asc");
     params.add("qt", "/elevate");
     params.add("forceElevation", "true");
-    params.add("elevateIds", "4.0");
+    params.add("elevateIds", "4");
     assertQ(req(params),
             "*[count(//doc)=2]",
             "//result/doc[1]/str[@name='id'][.='4']",
@@ -196,7 +196,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     params.add("sort", "test_l asc");
     params.add("qt", "/elevate");
     params.add("forceElevation", "true");
-    params.add("elevateIds", "7.0");
+    params.add("elevateIds", "7");
     assertQ(req(params),
             "*[count(//doc)=2]",
             "//result/doc[1]/str[@name='id'][.='7']",
@@ -427,7 +427,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     params.add("defType", "edismax");
     params.add("bf", "field(test_i)");
     params.add("fl", "id");
-    params.add("sort", "id desc");
+    params.add("sort", "id_i desc");
     assertQ(req(params), "*[count(//doc)=3]",
         "//result/doc[1]/str[@name='id'][.='5']",
         "//result/doc[2]/str[@name='id'][.='4']",
@@ -532,7 +532,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     params = new ModifiableSolrParams();
     params.add("q", "*:*");
     params.add("fq", "{!collapse field="+group+" nullPolicy=collapse sort='term_s asc, test_i asc' "+hint+"}");
-    params.add("sort", "id desc");
+    params.add("sort", "id_i desc");
     assertQ(req(params),
             "*[count(//doc)=3]",
             "//result/doc[1]/str[@name='id'][.='5']",
@@ -543,7 +543,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     params = new ModifiableSolrParams();
     params.add("q", "*:*");
     params.add("fq", "{!collapse field="+group+" nullPolicy=collapse sort='term_s asc, test_i desc' "+hint+"}");
-    params.add("sort", "id desc");
+    params.add("sort", "id_i desc");
     assertQ(req(params),
             "*[count(//doc)=3]",
             "//result/doc[1]/str[@name='id'][.='6']",
@@ -559,7 +559,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
       params = new ModifiableSolrParams();
       params.add("q", "*:*");
       params.add("fq", "{!collapse field="+group + min + hint+"}");
-      params.add("sort", "id desc");
+      params.add("sort", "id_i desc");
       assertQ(req(params),
               "*[count(//doc)=2]",
               "//result/doc[1]/str[@name='id'][.='5']",
@@ -568,7 +568,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
       params = new ModifiableSolrParams();
       params.add("q", "*:*");
       params.add("fq", "{!collapse field="+group + min + hint+"}");
-      params.add("sort", "id asc");
+      params.add("sort", "id_i asc");
       assertQ(req(params),
               "*[count(//doc)=2]",
               "//result/doc[1]/str[@name='id'][.='1']",
@@ -577,7 +577,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
       params = new ModifiableSolrParams();
       params.add("q", "*:*");
       params.add("fq", "{!collapse field="+group + min + hint+"}");
-      params.add("sort", "test_l asc,id desc");
+      params.add("sort", "test_l asc,id_i desc");
       assertQ(req(params),
               "*[count(//doc)=2]",
               "//result/doc[1]/str[@name='id'][.='5']",
@@ -586,9 +586,9 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
       params = new ModifiableSolrParams();
       params.add("q", "*:*");
       params.add("fq", "{!collapse field="+group + min + hint+"}");
-      params.add("sort", "score desc,id asc");
+      params.add("sort", "score desc,id_i asc");
       params.add("defType", "edismax");
-      params.add("bf", "field(id)");
+      params.add("bf", "field(id_i)");
       assertQ(req(params),
               "*[count(//doc)=2]",
               "//result/doc[1]/str[@name='id'][.='5']",
@@ -655,7 +655,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     params.add("q", "*:*");
     params.add("fq", "{!collapse field="+group+" max=test_f"+hint+"}");
     params.add("defType", "edismax");
-    params.add("bf", "field(id)");
+    params.add("bf", "field(id_i)");
     params.add("fl", "score, id");
     params.add("facet","true");
     params.add("fq", "{!tag=test}term_s:YYYY");
@@ -690,8 +690,8 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     
     // attempting to use cscore() in sort local param should fail
     assertQEx("expected error trying to sort on a function that includes cscore()",
-              req(params("q", "{!func}sub(sub(test_l,1000),id)",
-                         "fq", "{!collapse field="+group+" sort='abs(cscore()) asc, id asc'}",
+              req(params("q", "{!func}sub(sub(test_l,1000),id_i)",
+                         "fq", "{!collapse field="+group+" sort='abs(cscore()) asc, id_i asc'}",
                          "sort", "score asc")),
               SolrException.ErrorCode.BAD_REQUEST);
     
@@ -728,7 +728,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     params = new ModifiableSolrParams();
     params.add("q", "*:*");
     params.add("fq", "{!collapse field="+group+" max=test_f nullPolicy=expand"+hint+"}");
-    params.add("sort", "id desc");
+    params.add("sort", "id_i desc");
     assertQ(req(params), "*[count(//doc)=4]",
         "//result/doc[1]/str[@name='id'][.='5']",
         "//result/doc[2]/str[@name='id'][.='4']",
@@ -739,7 +739,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
     params = new ModifiableSolrParams();
     params.add("q", "*:*");
     params.add("fq", "{!collapse field="+group+" max=test_f nullPolicy=collapse"+hint+"}");
-    params.add("sort", "id desc");
+    params.add("sort", "id_i desc");
     assertQ(req(params), "*[count(//doc)=3]",
         "//result/doc[1]/str[@name='id'][.='5']",
         "//result/doc[2]/str[@name='id'][.='4']",
@@ -850,14 +850,14 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
         // w/default nullPolicy, no groups found
         params = new ModifiableSolrParams();
         params.add("q", "*:*");
-        params.add("sort", "id desc");
+        params.add("sort", "id_i desc");
         params.add("fq", "{!collapse "+group+" "+selector+"}");
         assertQ(req(params), "*[count(//doc)=0]");
 
         // w/nullPolicy=expand, every doc found
         params = new ModifiableSolrParams();
         params.add("q", "*:*");
-        params.add("sort", "id desc");
+        params.add("sort", "id_i desc");
         params.add("fq", "{!collapse field="+group+" nullPolicy=expand "+selector+"}");
         assertQ(req(params)
                 , "*[count(//doc)=8]"

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/05e8e226/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java b/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java
index 0ba716d..959386a 100644
--- a/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java
+++ b/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java
@@ -135,8 +135,8 @@ public class TestRangeQuery extends SolrTestCaseJ4 {
 
     // simple test of a function rather than just the field
     assertQ(req("{!frange l=0 u=2}id"), "*[count(//doc)=3]");
-    assertQ(req("{!frange l=0 u=2}product(id,2)"), "*[count(//doc)=2]");
-    assertQ(req("{!frange l=100 u=102}sum(id,100)"), "*[count(//doc)=3]");
+    assertQ(req("{!frange l=0 u=2}product(id_i,2)"), "*[count(//doc)=2]");
+    assertQ(req("{!frange l=100 u=102}sum(id_i,100)"), "*[count(//doc)=3]");
 
 
     for (Map.Entry<String,String[]> entry : norm_fields.entrySet()) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/05e8e226/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java
index 9b038ca..0fd1a4a 100644
--- a/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java
@@ -441,7 +441,7 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
     params = new ModifiableSolrParams();
     params.add("rq", "{!"+ReRankQParserPlugin.NAME+" "+ReRankQParserPlugin.RERANK_QUERY+"=$rqq "+ReRankQParserPlugin.RERANK_DOCS+"=6}");
     // function query for predictible scores (relative to id) independent of similarity
-    params.add("q", "{!func}id");
+    params.add("q", "{!func}id_i");
     // constant score for each clause (unique per doc) for predictible scores independent of similarity
     // NOTE: biased in favor of doc id == 2
     params.add("rqq", "id:1^=10 id:2^=40 id:3^=30 id:4^=40 id:5^=50 id:6^=60");


[05/35] lucene-solr:jira/SOLR-10834: LUCENE-7866: Apply changes also to cloned test (TODO: fix this!)

Posted by ho...@apache.org.
LUCENE-7866: Apply changes also to cloned test (TODO: fix this!)


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

Branch: refs/heads/jira/SOLR-10834
Commit: d7808ebc6029a51c6f80e6700ca53f7c9a6523f0
Parents: f43f89e
Author: Uwe Schindler <us...@apache.org>
Authored: Sun Jun 11 14:25:03 2017 +0200
Committer: Uwe Schindler <us...@apache.org>
Committed: Sun Jun 11 14:25:03 2017 +0200

----------------------------------------------------------------------
 .../lucene/analysis/ja/TestFactories.java       | 46 +++++++++++++-------
 1 file changed, 31 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d7808ebc/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestFactories.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestFactories.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestFactories.java
index bae8ffc..0a467a7 100644
--- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestFactories.java
+++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestFactories.java
@@ -21,13 +21,17 @@ import java.io.IOException;
 import java.io.Reader;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
+import java.util.Arrays;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.BaseTokenStreamTestCase;
 import org.apache.lucene.analysis.MockTokenizer;
 import org.apache.lucene.analysis.Tokenizer;
+import org.apache.lucene.analysis.miscellaneous.DelimitedTermFrequencyTokenFilterFactory;
 import org.apache.lucene.analysis.util.AbstractAnalysisFactory;
 import org.apache.lucene.analysis.util.CharFilterFactory;
 import org.apache.lucene.analysis.util.MultiTermAwareComponent;
@@ -46,6 +50,12 @@ import org.apache.lucene.util.Version;
 
 // TODO: fix this to use CustomAnalyzer instead of its own FactoryAnalyzer
 public class TestFactories extends BaseTokenStreamTestCase {
+  
+  /** Factories that are excluded from testing it with random data */
+  private static final Set<Class<? extends AbstractAnalysisFactory>> EXCLUDE_FACTORIES_RANDOM_DATA = new HashSet<>(Arrays.asList(
+      DelimitedTermFrequencyTokenFilterFactory.class
+  ));
+  
   public void test() throws IOException {
     for (String tokenizer : TokenizerFactory.availableTokenizers()) {
       doTestTokenizer(tokenizer);
@@ -74,11 +84,13 @@ public class TestFactories extends BaseTokenStreamTestCase {
         assertFalse(mtc instanceof CharFilterFactory);
       }
       
-      // beast it just a little, it shouldnt throw exceptions:
-      // (it should have thrown them in initialize)
-      Analyzer a = new FactoryAnalyzer(factory, null, null);
-      checkRandomData(random(), a, 20, 20, false, false);
-      a.close();
+      if (!EXCLUDE_FACTORIES_RANDOM_DATA.contains(factory.getClass())) {
+        // beast it just a little, it shouldnt throw exceptions:
+        // (it should have thrown them in initialize)
+        Analyzer a = new FactoryAnalyzer(factory, null, null);
+        checkRandomData(random(), a, 20, 20, false, false);
+        a.close();
+      }
     }
   }
   
@@ -96,11 +108,13 @@ public class TestFactories extends BaseTokenStreamTestCase {
         assertTrue(mtc instanceof TokenFilterFactory);
       }
       
-      // beast it just a little, it shouldnt throw exceptions:
-      // (it should have thrown them in initialize)
-      Analyzer a = new FactoryAnalyzer(assertingTokenizer, factory, null);
-      checkRandomData(random(), a, 20, 20, false, false);
-      a.close();
+      if (!EXCLUDE_FACTORIES_RANDOM_DATA.contains(factory.getClass())) {
+        // beast it just a little, it shouldnt throw exceptions:
+        // (it should have thrown them in initialize)
+        Analyzer a = new FactoryAnalyzer(assertingTokenizer, factory, null);
+        checkRandomData(random(), a, 20, 20, false, false);
+        a.close();
+      }
     }
   }
   
@@ -118,11 +132,13 @@ public class TestFactories extends BaseTokenStreamTestCase {
         assertTrue(mtc instanceof CharFilterFactory);
       }
       
-      // beast it just a little, it shouldnt throw exceptions:
-      // (it should have thrown them in initialize)
-      Analyzer a = new FactoryAnalyzer(assertingTokenizer, null, factory);
-      checkRandomData(random(), a, 20, 20, false, false);
-      a.close();
+      if (!EXCLUDE_FACTORIES_RANDOM_DATA.contains(factory.getClass())) {
+        // beast it just a little, it shouldnt throw exceptions:
+        // (it should have thrown them in initialize)
+        Analyzer a = new FactoryAnalyzer(assertingTokenizer, null, factory);
+        checkRandomData(random(), a, 20, 20, false, false);
+        a.close();
+      }
     }
   }
   


[33/35] lucene-solr:jira/SOLR-10834: More tests that were asserting bogus sorts uselessly

Posted by ho...@apache.org.
More tests that were asserting bogus sorts uselessly


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

Branch: refs/heads/jira/SOLR-10834
Commit: 6dce948294351560948a32b64679b1879657af79
Parents: 53f9784
Author: Chris Hostetter <ho...@apache.org>
Authored: Tue Jun 13 14:58:25 2017 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Tue Jun 13 14:58:25 2017 -0700

----------------------------------------------------------------------
 .../src/test/org/apache/solr/schema/TestCollationField.java    | 6 +++---
 .../org/apache/solr/schema/TestCollationFieldDocValues.java    | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6dce9482/solr/core/src/test/org/apache/solr/schema/TestCollationField.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/TestCollationField.java b/solr/core/src/test/org/apache/solr/schema/TestCollationField.java
index 7a26d4d..f33a902 100644
--- a/solr/core/src/test/org/apache/solr/schema/TestCollationField.java
+++ b/solr/core/src/test/org/apache/solr/schema/TestCollationField.java
@@ -186,10 +186,10 @@ public class TestCollationField extends SolrTestCaseJ4 {
    */
   public void testCustomCollation() {
     assertQ("Collated TQ: ",
-        req("fl", "id", "q", "sort_custom:toene", "sort", "id asc" ),
+        req("fl", "id", "q", "sort_custom:toene" ),
                "//*[@numFound='2']",
-               "//result/doc[1]/str[@name='id'][.=4]",
-               "//result/doc[2]/str[@name='id'][.=10]"
+               "//result/doc/str[@name='id'][.=4]",
+               "//result/doc/str[@name='id'][.=10]"
      );
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6dce9482/solr/core/src/test/org/apache/solr/schema/TestCollationFieldDocValues.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/TestCollationFieldDocValues.java b/solr/core/src/test/org/apache/solr/schema/TestCollationFieldDocValues.java
index 676dd65..c950f67 100644
--- a/solr/core/src/test/org/apache/solr/schema/TestCollationFieldDocValues.java
+++ b/solr/core/src/test/org/apache/solr/schema/TestCollationFieldDocValues.java
@@ -185,10 +185,10 @@ public class TestCollationFieldDocValues extends SolrTestCaseJ4 {
    */
   public void testCustomCollation() {
     assertQ("Collated TQ: ",
-        req("fl", "id", "q", "sort_custom:toene", "sort", "id asc" ),
+        req("fl", "id", "q", "sort_custom:toene" ),
                "//*[@numFound='2']",
-               "//result/doc[1]/str[@name='id'][.=4]",
-               "//result/doc[2]/str[@name='id'][.=10]"
+               "//result/doc/str[@name='id'][.=4]",
+               "//result/doc/str[@name='id'][.=10]"
      );
   }
 }


[18/35] lucene-solr:jira/SOLR-10834: randomize v1 and v2

Posted by ho...@apache.org.
randomize v1 and v2


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

Branch: refs/heads/jira/SOLR-10834
Commit: 6d97305c635683afab1d1bbd07024f1c8f173bc0
Parents: 833a6f3
Author: Noble Paul <no...@apache.org>
Authored: Tue Jun 13 19:23:38 2017 +0930
Committer: Noble Paul <no...@apache.org>
Committed: Tue Jun 13 19:23:38 2017 +0930

----------------------------------------------------------------------
 solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d97305c/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java b/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java
index de4a27a..db04486 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java
@@ -50,7 +50,7 @@ public class TestReqParamsAPI extends SolrCloudTestCase {
   private void setupHarnesses() {
     for (final JettySolrRunner jettySolrRunner : cluster.getJettySolrRunners()) {
       RestTestHarness harness = new RestTestHarness(() -> jettySolrRunner.getBaseUrl().toString() + "/" + COLL_NAME);
-      if (true) {
+      if (random().nextBoolean()) {
         harness.setServerProvider(() -> jettySolrRunner.getBaseUrl().toString() + "/____v2/c/" + COLL_NAME);
       }
       restTestHarnesses.add(harness);


[11/35] lucene-solr:jira/SOLR-10834: SOLR-10849: MoreLikeThisComponent should expose setMaxDocFreqPct (maxDoc frequency percentage).

Posted by ho...@apache.org.
SOLR-10849: MoreLikeThisComponent should expose setMaxDocFreqPct (maxDoc frequency percentage).


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

Branch: refs/heads/jira/SOLR-10834
Commit: b2ea95c9ecbf68c35ff485b0f16ed756a6105487
Parents: 661a3c4
Author: Dawid Weiss <dw...@apache.org>
Authored: Mon Jun 12 11:48:21 2017 +0200
Committer: Dawid Weiss <dw...@apache.org>
Committed: Mon Jun 12 14:44:06 2017 +0200

----------------------------------------------------------------------
 solr/CHANGES.txt                                              | 3 +++
 .../src/java/org/apache/solr/handler/MoreLikeThisHandler.java | 7 +++++++
 .../org/apache/solr/common/params/MoreLikeThisParams.java     | 1 +
 3 files changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b2ea95c9/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 9ba932f..e9a22db 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -284,6 +284,9 @@ Upgrade Notes
 New Features
 ----------------------
 
+* SOLR-10849: MoreLikeThisComponent should expose setMaxDocFreqPct (maxDoc 
+  frequency percentage). (Dawid Weiss)
+
 * SOLR-10307: Allow Passing SSL passwords through environment variables. (Mano Kovacs via Mark Miller)
 
 * SOLR-10721: Provide a way to know when Core Discovery is finished and when all async cores are done loading

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b2ea95c9/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java b/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java
index 50ea711..0d12136 100644
--- a/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java
@@ -335,6 +335,13 @@ public class MoreLikeThisHandler extends RequestHandlerBase
       mlt.setMaxQueryTerms(     params.getInt(MoreLikeThisParams.MAX_QUERY_TERMS,       MoreLikeThis.DEFAULT_MAX_QUERY_TERMS));
       mlt.setMaxNumTokensParsed(params.getInt(MoreLikeThisParams.MAX_NUM_TOKENS_PARSED, MoreLikeThis.DEFAULT_MAX_NUM_TOKENS_PARSED));
       mlt.setBoost(            params.getBool(MoreLikeThisParams.BOOST, false ) );
+      
+      // There is no default for maxDocFreqPct. Also, it's a bit oddly expressed as an integer value 
+      // (percentage of the collection's documents count). We keep Lucene's convention here. 
+      if (params.getInt(MoreLikeThisParams.MAX_DOC_FREQ_PCT) != null) {
+        mlt.setMaxDocFreqPct(params.getInt(MoreLikeThisParams.MAX_DOC_FREQ_PCT));
+      }
+
       boostFields = SolrPluginUtils.parseFieldBoosts(params.getParams(MoreLikeThisParams.QF));
     }
     

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b2ea95c9/solr/solrj/src/java/org/apache/solr/common/params/MoreLikeThisParams.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/params/MoreLikeThisParams.java b/solr/solrj/src/java/org/apache/solr/common/params/MoreLikeThisParams.java
index c898fdb..919f786 100644
--- a/solr/solrj/src/java/org/apache/solr/common/params/MoreLikeThisParams.java
+++ b/solr/solrj/src/java/org/apache/solr/common/params/MoreLikeThisParams.java
@@ -31,6 +31,7 @@ public interface MoreLikeThisParams
   public final static String SIMILARITY_FIELDS     = PREFIX + "fl";
   public final static String MIN_TERM_FREQ         = PREFIX + "mintf";
   public final static String MAX_DOC_FREQ          = PREFIX + "maxdf";
+  public final static String MAX_DOC_FREQ_PCT      = PREFIX + "maxdfpct";
   public final static String MIN_DOC_FREQ          = PREFIX + "mindf";
   public final static String MIN_WORD_LEN          = PREFIX + "minwl";
   public final static String MAX_WORD_LEN          = PREFIX + "maxwl";


[19/35] lucene-solr:jira/SOLR-10834: SOLR-10818: Adding test for v2 backup-collection request

Posted by ho...@apache.org.
SOLR-10818: Adding test for v2 backup-collection request


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

Branch: refs/heads/jira/SOLR-10834
Commit: b73dffd928af2a34afdf1554a62d417e024b593c
Parents: 833a6f3
Author: Cao Manh Dat <da...@apache.org>
Authored: Tue Jun 13 19:38:43 2017 +0700
Committer: Cao Manh Dat <da...@apache.org>
Committed: Tue Jun 13 19:38:43 2017 +0700

----------------------------------------------------------------------
 .../test/org/apache/solr/handler/V2ApiIntegrationTest.java   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b73dffd9/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
index 66f5dbe..881e68b 100644
--- a/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
@@ -18,6 +18,7 @@
 package org.apache.solr.handler;
 
 
+import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
@@ -37,8 +38,6 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class V2ApiIntegrationTest extends SolrCloudTestCase {
-  private List<RestTestHarness> restTestHarnesses = new ArrayList<>();
-
   private static String COLL_NAME = "collection1";
 
   @BeforeClass
@@ -99,6 +98,11 @@ public class V2ApiIntegrationTest extends SolrCloudTestCase {
     assertEquals("/c/collection1/get", Utils.getObjectByPath(result, true, "/spec[0]/url/paths[0]"));
     result = resAsMap(client, new V2Request.Builder("/collections/"+COLL_NAME+"/get/_introspect").build());
     assertEquals("/collections/collection1/get", Utils.getObjectByPath(result, true, "/spec[0]/url/paths[0]"));
+    String tempDir = createTempDir().toFile().getPath();
+    client.request(new V2Request.Builder("/c")
+        .withMethod(SolrRequest.METHOD.POST)
+        .withPayload("{backup-collection:{name: backup_test, collection: "+COLL_NAME+" , location: '"+tempDir+"' }}")
+        .build());
   }
 
   private Map resAsMap(CloudSolrClient client, V2Request request) throws SolrServerException, IOException {


[07/35] lucene-solr:jira/SOLR-10834: SOLR-10715: /v2/ should not be an alias for /v2/collections

Posted by ho...@apache.org.
SOLR-10715: /v2/ should not be an alias for /v2/collections


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

Branch: refs/heads/jira/SOLR-10834
Commit: 6075956b65ab378f67c3c7c2d3116ec8d43a312e
Parents: 95841d9
Author: Cao Manh Dat <da...@apache.org>
Authored: Mon Jun 12 10:32:45 2017 +0700
Committer: Cao Manh Dat <da...@apache.org>
Committed: Mon Jun 12 10:32:45 2017 +0700

----------------------------------------------------------------------
 .../java/org/apache/solr/api/V2HttpCall.java    | 11 ++++-
 .../solr/handler/V2ApiIntegrationTest.java      |  8 ++++
 .../apache/solr/handler/V2StandaloneTest.java   | 49 ++++++++++++++++++++
 3 files changed, 66 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6075956b/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/api/V2HttpCall.java b/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
index baf4abc..da2781e 100644
--- a/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
+++ b/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
@@ -80,8 +80,15 @@ public class V2HttpCall extends HttpSolrCall {
     try {
       pieces = getPathSegments(path);
       if (pieces.size() == 0) {
-        prefix = "c";
-        path = "/c";
+        api = new Api(null) {
+          @Override
+          public void call(SolrQueryRequest req, SolrQueryResponse rsp) {
+            rsp.add("documentation", "https://cwiki.apache.org/confluence/display/solr/v2+API");
+            rsp.add("description", "V2 API root path");
+          }
+        };
+        initAdminRequest(path);
+        return;
       } else {
         prefix = pieces.get(0);
       }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6075956b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
index 70b7f8a..4741ef4 100644
--- a/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
@@ -52,6 +52,14 @@ public class V2ApiIntegrationTest extends SolrCloudTestCase {
   }
 
   @Test
+  public void testWelcomeMessage() throws Exception {
+    NamedList res = cluster.getSolrClient().request(
+        new V2Request.Builder("").build());
+    NamedList header = (NamedList) res.get("responseHeader");
+    assertEquals(0, header.get("status"));
+  }
+
+  @Test
   public void testIntrospect() throws Exception {
     ModifiableSolrParams params = new ModifiableSolrParams();
     params.set("command","XXXX");

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6075956b/solr/core/src/test/org/apache/solr/handler/V2StandaloneTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/V2StandaloneTest.java b/solr/core/src/test/org/apache/solr/handler/V2StandaloneTest.java
new file mode 100644
index 0000000..2d5b2a9
--- /dev/null
+++ b/solr/core/src/test/org/apache/solr/handler/V2StandaloneTest.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.handler;
+
+import java.io.File;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.client.solrj.embedded.JettySolrRunner;
+import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.request.V2Request;
+import org.apache.solr.common.util.NamedList;
+import org.junit.Test;
+
+public class V2StandaloneTest extends SolrTestCaseJ4{
+
+  @Test
+  public void testWelcomeMessage() throws Exception {
+    File solrHomeTmp = createTempDir().toFile().getAbsoluteFile();
+    FileUtils.copyDirectory(new File(TEST_HOME(), "configsets/minimal/conf"), new File(solrHomeTmp,"/conf"));
+    FileUtils.copyFile(new File(TEST_HOME(), "solr.xml"), new File(solrHomeTmp, "solr.xml"));
+
+    JettySolrRunner jetty = new JettySolrRunner(solrHomeTmp.getAbsolutePath(), buildJettyConfig("/solr"));
+    jetty.start();
+
+    try (HttpSolrClient client = getHttpSolrClient(buildUrl(jetty.getLocalPort(),"/solr/"))) {
+      NamedList res = client.request(new V2Request.Builder("/").build());
+      NamedList header = (NamedList) res.get("responseHeader");
+      assertEquals(0, header.get("status"));
+    }
+
+    jetty.stop();
+  }
+}