You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ep...@apache.org on 2022/03/21 15:08:51 UTC

[solr] branch branch_9x updated: SOLR-9529: Make multivalued dates dynamic field use dates field type (#484)

This is an automated email from the ASF dual-hosted git repository.

epugh pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 8190b50  SOLR-9529: Make multivalued dates dynamic field use dates field type (#484)
8190b50 is described below

commit 8190b507272ade3cd2f3df3e642de468d2018f3a
Author: Eric Pugh <ep...@opensourceconnections.com>
AuthorDate: Mon Jan 17 12:01:24 2022 -0500

    SOLR-9529: Make multivalued dates dynamic field use dates field type (#484)
    
    * be consist about the fieldType to use for multivalue fields
    * use same definitions for the dynamic fields in both schemas
---
 .../configsets/_default/conf/managed-schema.xml    | 36 +++++++-------
 .../conf/managed-schema                            | 57 +++++++++++-----------
 2 files changed, 47 insertions(+), 46 deletions(-)

diff --git a/solr/server/solr/configsets/_default/conf/managed-schema.xml b/solr/server/solr/configsets/_default/conf/managed-schema.xml
index 8bd61ed..b70a348 100644
--- a/solr/server/solr/configsets/_default/conf/managed-schema.xml
+++ b/solr/server/solr/configsets/_default/conf/managed-schema.xml
@@ -129,30 +129,32 @@
     <!-- Dynamic field definitions allow using convention over configuration
        for fields via the specification of patterns to match field names.
        EXAMPLE:  name="*_i" will match any field ending in _i (like myid_i, z_i)
-       RESTRICTION: the glob-like pattern in the name attribute must have a "*" only at the start or the end.  -->
-
-    <dynamicField name="*_i"  type="pint"    indexed="true"  stored="true"/>
-    <dynamicField name="*_is" type="pints"    indexed="true"  stored="true"/>
-    <dynamicField name="*_s"  type="string"  indexed="true"  stored="true" />
-    <dynamicField name="*_ss" type="strings"  indexed="true"  stored="true"/>
-    <dynamicField name="*_l"  type="plong"   indexed="true"  stored="true"/>
-    <dynamicField name="*_ls" type="plongs"   indexed="true"  stored="true"/>
-    <dynamicField name="*_t" type="text_general" indexed="true" stored="true" multiValued="false"/>
+       RESTRICTION: the glob-like pattern in the name attribute must have a "*"
+       only at the start or the end.  -->
+
+    <dynamicField name="*_i"   type="pint"     indexed="true"  stored="true"/>
+    <dynamicField name="*_is"  type="pints"    indexed="true"  stored="true"/>
+    <dynamicField name="*_s"   type="string"   indexed="true"  stored="true" />
+    <dynamicField name="*_ss"  type="strings"  indexed="true"  stored="true"/>
+    <dynamicField name="*_l"   type="plong"    indexed="true"  stored="true"/>
+    <dynamicField name="*_ls"  type="plongs"   indexed="true"  stored="true"/>
+    <dynamicField name="*_b"   type="boolean"  indexed="true"  stored="true"/>
+    <dynamicField name="*_bs"  type="booleans" indexed="true"  stored="true"/>
+    <dynamicField name="*_f"   type="pfloat"   indexed="true"  stored="true"/>
+    <dynamicField name="*_fs"  type="pfloats"  indexed="true"  stored="true"/>
+    <dynamicField name="*_d"   type="pdouble"  indexed="true"  stored="true"/>
+    <dynamicField name="*_ds"  type="pdoubles" indexed="true"  stored="true"/>
+    <dynamicField name="*_dt"  type="pdate"    indexed="true"  stored="true"/>
+    <dynamicField name="*_dts" type="pdates"   indexed="true"  stored="true"/>
+    <dynamicField name="*_t"   type="text_general" indexed="true" stored="true" multiValued="false"/>
     <dynamicField name="*_txt" type="text_general" indexed="true" stored="true"/>
-    <dynamicField name="*_b"  type="boolean" indexed="true" stored="true"/>
-    <dynamicField name="*_bs" type="booleans" indexed="true" stored="true"/>
-    <dynamicField name="*_f"  type="pfloat"  indexed="true"  stored="true"/>
-    <dynamicField name="*_fs" type="pfloats"  indexed="true"  stored="true"/>
-    <dynamicField name="*_d"  type="pdouble" indexed="true"  stored="true"/>
-    <dynamicField name="*_ds" type="pdoubles" indexed="true"  stored="true"/>
+
     <dynamicField name="random_*" type="random"/>
     <dynamicField name="ignored_*" type="ignored"/>
 
     <!-- Type used for data-driven schema, to add a string copy for each text field -->
     <dynamicField name="*_str" type="strings" stored="false" docValues="true" indexed="false" useDocValuesAsStored="false"/>
 
-    <dynamicField name="*_dt"  type="pdate"    indexed="true"  stored="true"/>
-    <dynamicField name="*_dts" type="pdate"    indexed="true"  stored="true" multiValued="true"/>
     <dynamicField name="*_p"  type="location" indexed="true" stored="true"/>
     <dynamicField name="*_srpt"  type="location_rpt" indexed="true" stored="true"/>
 
diff --git a/solr/server/solr/configsets/sample_techproducts_configs/conf/managed-schema b/solr/server/solr/configsets/sample_techproducts_configs/conf/managed-schema
index aad0c82..54f440f 100644
--- a/solr/server/solr/configsets/sample_techproducts_configs/conf/managed-schema
+++ b/solr/server/solr/configsets/sample_techproducts_configs/conf/managed-schema
@@ -195,39 +195,35 @@
 
 
    <!-- Dynamic field definitions allow using convention over configuration
-       for fields via the specification of patterns to match field names.
-       EXAMPLE:  name="*_i" will match any field ending in _i (like myid_i, z_i)
-       RESTRICTION: the glob-like pattern in the name attribute must have
-       a "*" only at the start or the end.  -->
-
-   <dynamicField name="*_i"  type="pint"    indexed="true"  stored="true"/>
-   <dynamicField name="*_is" type="pint"    indexed="true"  stored="true"  multiValued="true"/>
-   <dynamicField name="*_s"  type="string"  indexed="true"  stored="true" />
-   <dynamicField name="*_s_ns"  type="string"  indexed="true"  stored="false" />
-   <dynamicField name="*_ss" type="string"  indexed="true"  stored="true" multiValued="true"/>
-   <dynamicField name="*_l"  type="plong"   indexed="true"  stored="true"/>
-   <dynamicField name="*_l_ns"  type="plong"   indexed="true"  stored="false"/>
-   <dynamicField name="*_ls" type="plong"   indexed="true"  stored="true"  multiValued="true"/>
-   <dynamicField name="*_t"  type="text_general"    indexed="true"  stored="true"/>
-   <dynamicField name="*_txt" type="text_general"   indexed="true"  stored="true" multiValued="true"/>
-   <dynamicField name="*_en"  type="text_en"    indexed="true"  stored="true" multiValued="true"/>
-   <dynamicField name="*_b"  type="boolean" indexed="true" stored="true"/>
-   <dynamicField name="*_bs" type="boolean" indexed="true" stored="true"  multiValued="true"/>
-   <dynamicField name="*_f"  type="pfloat"  indexed="true"  stored="true"/>
-   <dynamicField name="*_fs" type="pfloat"  indexed="true"  stored="true"  multiValued="true"/>
-   <dynamicField name="*_d"  type="pdouble" indexed="true"  stored="true"/>
-   <dynamicField name="*_ds" type="pdouble" indexed="true"  stored="true"  multiValued="true"/>
-
+      for fields via the specification of patterns to match field names.
+      EXAMPLE:  name="*_i" will match any field ending in _i (like myid_i, z_i)
+      RESTRICTION: the glob-like pattern in the name attribute must have a "*" only at the start or the end.  -->
+
+   <dynamicField name="*_i"   type="pint"     indexed="true"  stored="true"/>
+   <dynamicField name="*_is"  type="pints"    indexed="true"  stored="true"/>
+   <dynamicField name="*_s"   type="string"   indexed="true"  stored="true" />
+   <dynamicField name="*_ss"  type="strings"  indexed="true"  stored="true"/>
+   <dynamicField name="*_l"   type="plong"    indexed="true"  stored="true"/>
+   <dynamicField name="*_ls"  type="plongs"   indexed="true"  stored="true"/>
+   <dynamicField name="*_b"   type="boolean"  indexed="true"  stored="true"/>
+   <dynamicField name="*_bs"  type="booleans" indexed="true"  stored="true"/>
+   <dynamicField name="*_f"   type="pfloat"   indexed="true"  stored="true"/>
+   <dynamicField name="*_fs"  type="pfloats"  indexed="true"  stored="true"/>
+   <dynamicField name="*_d"   type="pdouble"  indexed="true"  stored="true"/>
+   <dynamicField name="*_ds"  type="pdoubles" indexed="true"  stored="true"/>
    <dynamicField name="*_dt"  type="pdate"    indexed="true"  stored="true"/>
-   <dynamicField name="*_dts" type="pdate"    indexed="true"  stored="true" multiValued="true"/>
-   <dynamicField name="*_p"  type="location" indexed="true" stored="true"/>
+   <dynamicField name="*_dts" type="pdates"   indexed="true"  stored="true"/>
+   <dynamicField name="*_t"   type="text_general" indexed="true" stored="true" multiValued="false"/>
+   <dynamicField name="*_txt" type="text_general" indexed="true" stored="true"/>
 
-   <dynamicField name="*_c"   type="currency" indexed="true"  stored="true"/>
+   <dynamicField name="random_*" type="random"/>
+   <dynamicField name="ignored_*" type="ignored"/>
 
-   <dynamicField name="ignored_*" type="ignored" multiValued="true"/>
-   <dynamicField name="attr_*" type="text_general" indexed="true" stored="true" multiValued="true"/>
+   <dynamicField name="*_c"   type="currency" indexed="true"  stored="true"/>
 
-   <dynamicField name="random_*" type="random" />
+   <!-- Subfields used with currency fieldType -->
+   <dynamicField name="*_s_ns"  type="string"  indexed="true"  stored="false" />
+   <dynamicField name="*_l_ns"  type="plong"   indexed="true"  stored="false"/>
 
    <!-- uncomment the following to ignore any fields that don't already match an existing
         field name or dynamic field, rather than reporting them as an error.
@@ -290,9 +286,12 @@
 
     <!-- The StrField type is not analyzed, but indexed/stored verbatim. -->
     <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
+    <fieldType name="strings" class="solr.StrField" sortMissingLast="true" multiValued="true" docValues="true" />
+
 
     <!-- boolean type: "true" or "false" -->
     <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
+    <fieldType name="booleans" class="solr.BoolField" sortMissingLast="true" multiValued="true"/>
 
     <!-- sortMissingLast and sortMissingFirst attributes are optional attributes are
          currently supported on types that are sorted internally as strings