Apache Solr open-source search software
SOLR-8740: use docValues for non-text fields in schema templates
yonike76fa5681721
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex eaedca6510f..945a123f5b8 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -130,6 +130,12 @@ Upgrading from Solr 5.x* SOLR-8736: The deprecated GET methods for schema are now accessible through the bulk API. The outputhas less details and is not backward compatible.+* In the past, Solr guaranteed that retrieval of multi-valued fields would preserve the order of values.+ Because values may now be retrieved from column-stored fields (docValues="true"), in conjunction with the+ fact that docValues do not currently preserve order, means that users should set useDocValuesAsStored="false"+ to prevent future optizations from using the column-stored values over the row-stored values when+ fields have both stored="true" and docValues="true".+Detailed Change List----------------------@@ -442,6 +448,9 @@ Other Changes* SOLR-8836: Return 400, and a SolrException when an invalid json is provided to the update handlerinstead of 500. (Jason Gerlowski via Anshum Gupta)+* SOLR-8740: docValues are now enabled by default for most non-text (string, date, and numeric) fields+ in the schema templates. (yonik)+================== 5.5.1 ==================Bug Fixesdiff --git a/solr/server/solr/configsets/basic_configs/conf/managed-schema b/solr/server/solr/configsets/basic_configs/conf/managed-schemaindex 2599a28dffd..3ce6b73e7ff 100644--- a/solr/server/solr/configsets/basic_configs/conf/managed-schema+++ b/solr/server/solr/configsets/basic_configs/conf/managed-schema@@ -94,12 +94,12 @@<!-- If you remove this field, you must _also_ disable the update log in solrconfig.xmlor Solr won't start. _version_ and update log are required for SolrCloud-->- <field name="_version_" type="long" indexed="true" stored="true"/>+ <field name="_version_" type="long" indexed="true" stored="false" /><!-- points to the root document of a block of nested documents. Required for nesteddocument support, may be removed otherwise-->- <field name="_root_" type="string" indexed="true" stored="false"/>+ <field name="_root_" type="string" indexed="true" stored="false" docValues="false" /><!-- Only remove the "id" field if you have a very good reason to. While not strictlyrequired, it is highly recommended. A <uniqueKey> is present in almost all Solr@@ -135,7 +135,7 @@<dynamicField name="*_ds" type="double" indexed="true" stored="true" multiValued="true"/><!-- Type used to index the lat and lon components for the "location" FieldType -->- <dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false" />+ <dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false" useDocValuesAsStored="false" /><dynamicField name="*_dt" type="date" indexed="true" stored="true"/><dynamicField name="*_dts" type="date" indexed="true" stored="true" multiValued="true"/>@@ -187,7 +187,7 @@It supports doc values but in that case the field needs to besingle-valued and either required or have a default value.-->- <fieldType name="string" class="solr.StrField" sortMissingLast="true" />+ <fieldType name="string" class="solr.StrField" sortMissingLast="true" docValues="true" /><!-- boolean type: "true" or "false" --><fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>@@ -214,10 +214,10 @@These fields support doc values, but they require the field to besingle-valued and either be required or have a default value.-->- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>- <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>- <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>- <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/>+ <fieldType name="int" class="solr.TrieIntField" docValues="true" precisionStep="0" positionIncrementGap="0"/>+ <fieldType name="float" class="solr.TrieFloatField" docValues="true" precisionStep="0" positionIncrementGap="0"/>+ <fieldType name="long" class="solr.TrieLongField" docValues="true" precisionStep="0" positionIncrementGap="0"/>+ <fieldType name="double" class="solr.TrieDoubleField" docValues="true" precisionStep="0" positionIncrementGap="0"/><!--Numeric field types that index each value at various levels of precision@@ -229,10 +229,10 @@indexed per value, slightly larger index size, and faster range queries.A precisionStep of 0 disables indexing at different precision levels.-->- <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0"/>- <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0"/>- <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0"/>- <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0"/>+ <fieldType name="tint" class="solr.TrieIntField" docValues="true" precisionStep="8" positionIncrementGap="0"/>+ <fieldType name="tfloat" class="solr.TrieFloatField" docValues="true" precisionStep="8" positionIncrementGap="0"/>+ <fieldType name="tlong" class="solr.TrieLongField" docValues="true" precisionStep="8" positionIncrementGap="0"/>+ <fieldType name="tdouble" class="solr.TrieDoubleField" docValues="true" precisionStep="8" positionIncrementGap="0"/><!-- The format for this date field is of the form 1995-12-31T23:59:59Z, andis a more restricted form of the canonical representation of dateTime@@ -256,10 +256,10 @@Note: For faster range queries, consider the tdate type-->- <fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>+ <fieldType name="date" class="solr.TrieDateField" docValues="true" precisionStep="0" positionIncrementGap="0"/><!-- A Trie based date field for faster date range queries and date faceting. -->- <fieldType name="tdate" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0"/>+ <fieldType name="tdate" class="solr.TrieDateField" docValues="true" precisionStep="6" positionIncrementGap="0"/><!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->@@ -487,7 +487,7 @@<!-- since fields of this type are by default not stored or indexed,any data added to them will be ignored outright. -->- <fieldType name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />+ <fieldType name="ignored" stored="false" indexed="false" docValues="false" multiValued="true" class="solr.StrField" /><!-- This point type indexes the coordinates as separate fields (subFields)If subFieldType is defined, it references a type, and a dynamic field@@ -517,7 +517,7 @@relevancy. --><fieldType name="bbox" class="solr.BBoxField"geo="true" distanceUnits="kilometers" numberType="_bbox_coord" />- <fieldType name="_bbox_coord" class="solr.TrieDoubleField" precisionStep="8" docValues="true" stored="false"/>+ <fieldType name="_bbox_coord" class="solr.TrieDoubleField" precisionStep="8" docValues="true" useDocValuesAsStored="false" stored="false"/><!-- Money/currency field type. See http://wiki.apache.org/solr/MoneyFieldTypeParameters:diff --git a/solr/server/solr/configsets/data_driven_schema_configs/conf/managed-schema b/solr/server/solr/configsets/data_driven_schema_configs/conf/managed-schemaindex 822e2074a3f..fa9429fe2ff 100644--- a/solr/server/solr/configsets/data_driven_schema_configs/conf/managed-schema+++ b/solr/server/solr/configsets/data_driven_schema_configs/conf/managed-schema@@ -118,8 +118,8 @@If you don't need it, consider removing it and the corresponding copyField directive.--><field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />- <field name="_version_" type="long" indexed="true" stored="true"/>- <field name="_root_" type="string" indexed="true" stored="false"/>+ <field name="_version_" type="long" indexed="true" stored="false"/>+ <field name="_root_" type="string" indexed="true" stored="false" docValues="false" /><field name="_text_" type="text_general" indexed="true" stored="false" multiValued="true"/><copyField source="*" dest="_text_"/>@@ -146,7 +146,7 @@<dynamicField name="*_ds" type="doubles" indexed="true" stored="true"/><!-- Type used to index the lat and lon components for the "location" FieldType -->- <dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false" />+ <dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false" useDocValuesAsStored="false" /><dynamicField name="*_dt" type="date" indexed="true" stored="true"/><dynamicField name="*_dts" type="date" indexed="true" stored="true" multiValued="true"/>@@ -205,8 +205,8 @@It supports doc values but in that case the field needs to besingle-valued and either required or have a default value.-->- <fieldType name="string" class="solr.StrField" sortMissingLast="true" />- <fieldType name="strings" class="solr.StrField" sortMissingLast="true" multiValued="true"/>+ <fieldType name="string" class="solr.StrField" sortMissingLast="true" docValues="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"/>@@ -235,15 +235,15 @@These fields support doc values, but they require the field to besingle-valued and either be required or have a default value.-->- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>- <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>- <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>- <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/>+ <fieldType name="int" class="solr.TrieIntField" docValues="true" precisionStep="0" positionIncrementGap="0"/>+ <fieldType name="float" class="solr.TrieFloatField" docValues="true" precisionStep="0" positionIncrementGap="0"/>+ <fieldType name="long" class="solr.TrieLongField" docValues="true" precisionStep="0" positionIncrementGap="0"/>+ <fieldType name="double" class="solr.TrieDoubleField" docValues="true" precisionStep="0" positionIncrementGap="0"/>- <fieldType name="ints" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0" multiValued="true"/>- <fieldType name="floats" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0" multiValued="true"/>- <fieldType name="longs" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0" multiValued="true"/>- <fieldType name="doubles" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0" multiValued="true"/>+ <fieldType name="ints" class="solr.TrieIntField" docValues="true" precisionStep="0" positionIncrementGap="0" multiValued="true"/>+ <fieldType name="floats" class="solr.TrieFloatField" docValues="true" precisionStep="0" positionIncrementGap="0" multiValued="true"/>+ <fieldType name="longs" class="solr.TrieLongField" docValues="true" precisionStep="0" positionIncrementGap="0" multiValued="true"/>+ <fieldType name="doubles" class="solr.TrieDoubleField" docValues="true" precisionStep="0" positionIncrementGap="0" multiValued="true"/><!--Numeric field types that index each value at various levels of precision@@ -255,15 +255,15 @@indexed per value, slightly larger index size, and faster range queries.A precisionStep of 0 disables indexing at different precision levels.-->- <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0"/>- <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0"/>- <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0"/>- <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0"/>+ <fieldType name="tint" class="solr.TrieIntField" docValues="true" precisionStep="8" positionIncrementGap="0"/>+ <fieldType name="tfloat" class="solr.TrieFloatField" docValues="true" precisionStep="8" positionIncrementGap="0"/>+ <fieldType name="tlong" class="solr.TrieLongField" docValues="true" precisionStep="8" positionIncrementGap="0"/>+ <fieldType name="tdouble" class="solr.TrieDoubleField" docValues="true" precisionStep="8" positionIncrementGap="0"/>- <fieldType name="tints" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0" multiValued="true"/>- <fieldType name="tfloats" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0" multiValued="true"/>- <fieldType name="tlongs" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0" multiValued="true"/>- <fieldType name="tdoubles" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0" multiValued="true"/>+ <fieldType name="tints" class="solr.TrieIntField" docValues="true" precisionStep="8" positionIncrementGap="0" multiValued="true"/>+ <fieldType name="tfloats" class="solr.TrieFloatField" docValues="true" precisionStep="8" positionIncrementGap="0" multiValued="true"/>+ <fieldType name="tlongs" class="solr.TrieLongField" docValues="true" precisionStep="8" positionIncrementGap="0" multiValued="true"/>+ <fieldType name="tdoubles" class="solr.TrieDoubleField" docValues="true" precisionStep="8" positionIncrementGap="0" multiValued="true"/><!-- The format for this date field is of the form 1995-12-31T23:59:59Z, andis a more restricted form of the canonical representation of dateTime@@ -287,13 +287,13 @@Note: For faster range queries, consider the tdate type-->- <fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>- <fieldType name="dates" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0" multiValued="true"/>+ <fieldType name="date" class="solr.TrieDateField" docValues="true" precisionStep="0" positionIncrementGap="0"/>+ <fieldType name="dates" class="solr.TrieDateField" docValues="true" precisionStep="0" positionIncrementGap="0" multiValued="true"/><!-- A Trie based date field for faster date range queries and date faceting. -->- <fieldType name="tdate" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0"/>+ <fieldType name="tdate" class="solr.TrieDateField" docValues="true" precisionStep="6" positionIncrementGap="0"/>- <fieldType name="tdates" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0" multiValued="true"/>+ <fieldType name="tdates" class="solr.TrieDateField" docValues="true" precisionStep="6" positionIncrementGap="0" multiValued="true"/><!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->@@ -532,7 +532,7 @@<!-- since fields of this type are by default not stored or indexed,any data added to them will be ignored outright. -->- <fieldType name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />+ <fieldType name="ignored" stored="false" indexed="false" docValues="false" multiValued="true" class="solr.StrField" /><!-- This point type indexes the coordinates as separate fields (subFields)If subFieldType is defined, it references a type, and a dynamic field@@ -1000,5 +1000,4 @@</similarity>-->-<useDocValuesAsStored>false</useDocValuesAsStored></schema>diff --git a/solr/server/solr/configsets/sample_techproducts_configs/conf/managed-schema b/solr/server/solr/configsets/sample_techproducts_configs/conf/managed-schemaindex ddba4835155..1000d9a3623 100644--- a/solr/server/solr/configsets/sample_techproducts_configs/conf/managed-schema+++ b/solr/server/solr/configsets/sample_techproducts_configs/conf/managed-schema@@ -112,12 +112,12 @@<!-- If you remove this field, you must _also_ disable the update log in solrconfig.xmlor Solr won't start. _version_ and update log are required for SolrCloud-->- <field name="_version_" type="long" indexed="true" stored="true"/>+ <field name="_version_" type="long" indexed="true" stored="false" /><!-- points to the root document of a block of nested documents. Required for nesteddocument support, may be removed otherwise-->- <field name="_root_" type="string" indexed="true" stored="false"/>+ <field name="_root_" type="string" indexed="true" stored="false" docValues="false" /><!-- Only remove the "id" field if you have a very good reason to. While not strictlyrequired, it is highly recommended. A <uniqueKey> is present in almost all Solr@@ -184,24 +184,11 @@<!-- non-tokenized version of manufacturer to make it easier to sort or groupresults by manufacturer. copied from "manu" via copyField -->- <field name="manu_exact" type="string" indexed="true" stored="false"/>+ <field name="manu_exact" type="string" indexed="true" stored="false" docValues="false" /><field name="payloads" type="payloads" indexed="true" stored="true"/>- <!--- Some fields such as popularity and manu_exact could be modified to- leverage doc values:- <field name="popularity" type="int" indexed="true" stored="true" docValues="true" />- <field name="manu_exact" type="string" indexed="false" stored="false" docValues="true" />- <field name="cat" type="string" indexed="true" stored="true" docValues="true" multiValued="true"/>--- Although it would make indexing slightly slower and the index bigger, it- would also make the index faster to load, more memory-efficient and more- NRT-friendly.- -->-<!-- Dynamic field definitions allow using convention over configurationfor 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)@@ -225,7 +212,7 @@<dynamicField name="*_ds" type="double" indexed="true" stored="true" multiValued="true"/><!-- Type used to index the lat and lon components for the "location" FieldType -->- <dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false" />+ <dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false" useDocValuesAsStored="false" /><dynamicField name="*_dt" type="date" indexed="true" stored="true"/><dynamicField name="*_dts" type="date" indexed="true" stored="true" multiValued="true"/>@@ -351,10 +338,10 @@These fields support doc values, but they require the field to besingle-valued and either be required or have a default value.-->- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>- <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>- <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>- <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/>+ <fieldType name="int" class="solr.TrieIntField" docValues="true" precisionStep="0" positionIncrementGap="0"/>+ <fieldType name="float" class="solr.TrieFloatField" docValues="true" precisionStep="0" positionIncrementGap="0"/>+ <fieldType name="long" class="solr.TrieLongField" docValues="true" precisionStep="0" positionIncrementGap="0"/>+ <fieldType name="double" class="solr.TrieDoubleField" docValues="true" precisionStep="0" positionIncrementGap="0"/><!--Numeric field types that index each value at various levels of precision@@ -366,10 +353,10 @@indexed per value, slightly larger index size, and faster range queries.A precisionStep of 0 disables indexing at different precision levels.-->- <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0"/>- <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0"/>- <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0"/>- <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0"/>+ <fieldType name="tint" class="solr.TrieIntField" docValues="true" precisionStep="8" positionIncrementGap="0"/>+ <fieldType name="tfloat" class="solr.TrieFloatField" docValues="true" precisionStep="8" positionIncrementGap="0"/>+ <fieldType name="tlong" class="solr.TrieLongField" docValues="true" precisionStep="8" positionIncrementGap="0"/>+ <fieldType name="tdouble" class="solr.TrieDoubleField" docValues="true" precisionStep="8" positionIncrementGap="0"/><!-- The format for this date field is of the form 1995-12-31T23:59:59Z, andis a more restricted form of the canonical representation of dateTime@@ -393,10 +380,10 @@Note: For faster range queries, consider the tdate type-->- <fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>+ <fieldType name="date" class="solr.TrieDateField" docValues="true" precisionStep="0" positionIncrementGap="0"/><!-- A Trie based date field for faster date range queries and date faceting. -->- <fieldType name="tdate" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0"/>+ <fieldType name="tdate" class="solr.TrieDateField" docValues="true" precisionStep="6" positionIncrementGap="0"/><!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->@@ -723,7 +710,7 @@relevancy. --><fieldType name="bbox" class="solr.BBoxField"geo="true" distanceUnits="kilometers" numberType="_bbox_coord" />- <fieldType name="_bbox_coord" class="solr.TrieDoubleField" precisionStep="8" docValues="true" stored="false"/>+ <fieldType name="_bbox_coord" class="solr.TrieDoubleField" precisionStep="8" docValues="true" useDocValuesAsStored="false" stored="false" /><!-- Money/currency field type. See http://wiki.apache.org/solr/MoneyFieldTypeParameters: