Skip to content

Commit b0ab58e

Browse files
SOLR-12963: Default uninvertible=false in schema version 1.7 (#2601)
1 parent 57fa8b9 commit b0ab58e

File tree

48 files changed

+238
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+238
-216
lines changed

solr/CHANGES.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ Improvements
156156
Statuses are now removed 5 minutes after the read of a completed/failed status. Helps collection
157157
async backup/restore and other operations scale to 100+ shards. (Pierre Salagnac, David Smiley)
158158

159+
* SOLR-10808, SOLR-12963: The Solr schema version has been increased to 1.7.
160+
Starting in schema version 1.7, all fields/fieldTypes that support docValues will have them enabled by default.
161+
This behavior can be reverted by setting the 'docValues' parameter for a field or a field type to false, the default for schema versions 1.6 and below.
162+
Also in schema version 1.7, all fields/fieldTypes will be unable to be uninverted by default.
163+
This behavior can be reverted by setting the 'uninvertible' parameter for a field or a field type to true, the default for schema versions 1.6 and below.
164+
(Houston Putman, hossman)
165+
159166
* SOLR-10808 : The Solr schema version has been increased to 1.7. Since schema version 1.7, all fields/fieldTypes that
160167
support docValues will have them enabled by default. This behavior can be reverted by setting
161168
'docValues' parameter for a field or a field type to false, the default for schema versions 1.6 and below. (Houston Putman)

solr/core/src/java/org/apache/solr/schema/FieldType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ protected void setArgs(IndexSchema schema, Map<String, String> args) {
190190
if (schemaVersion >= 1.6f) properties |= USE_DOCVALUES_AS_STORED;
191191
if (schemaVersion >= 1.7f && doesTypeSupportDocValues()) properties |= DOC_VALUES;
192192

193-
properties |= UNINVERTIBLE;
193+
if (schemaVersion < 1.7f) properties |= UNINVERTIBLE;
194194

195195
this.args = Collections.unmodifiableMap(args);
196196
Map<String, String> initArgs = new HashMap<>(args);

solr/core/src/java/org/apache/solr/schema/SortableTextField.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ public ValueSource getSingleValueSource(
227227
return new SortedSetFieldSource(field.getName(), selectorType);
228228
}
229229

230-
/** {@inheritDoc} this field type is not uninvertable, this method always returns null */
230+
/** {@inheritDoc} this field type is not uninvertible, this method always returns null */
231231
@Override
232232
public Type getUninversionType(SchemaField sf) {
233233
return null;

solr/core/src/java/org/apache/solr/uninverting/UninvertingReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public static LeafReader wrap(LeafReader in, Function<String, Type> mapping) {
228228
ArrayList<FieldInfo> newFieldInfos = new ArrayList<>(in.getFieldInfos().size());
229229
for (FieldInfo fi : in.getFieldInfos()) {
230230
DocValuesType type = fi.getDocValuesType();
231-
// fields which currently don't have docValues, but are uninvertable (indexed or points data
231+
// fields which currently don't have docValues, but are uninvertible (indexed or points data
232232
// present)
233233
if (type == DocValuesType.NONE
234234
&& (fi.getIndexOptions() != IndexOptions.NONE

solr/core/src/test-files/solr/collection1/conf/schema-collate.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939

4040
<field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
4141
<field name="text" type="text" indexed="true" stored="false"/>
42-
<field name="sort_ar" type="sort_ar_t" indexed="true" stored="false" multiValued="false" docValues="false"/>
43-
<field name="sort_de" type="sort_de_t" indexed="true" stored="false" multiValued="false" docValues="false"/>
44-
<field name="sort_tr_canon" type="sort_tr_canon_t" indexed="true" stored="false" multiValued="false" docValues="false"/>
45-
<field name="sort_zh_full" type="sort_zh_full_t" indexed="true" stored="false" multiValued="false" docValues="false"/>
46-
<field name="sort_da" type="sort_da_t" indexed="true" stored="false" multiValued="false" docValues="false"/>
47-
<field name="sort_custom" type="sort_custom_t" indexed="true" stored="false" multiValued="false" docValues="false"/>
42+
<field name="sort_ar" type="sort_ar_t" indexed="true" stored="false" multiValued="false" docValues="false" uninvertible="true"/>
43+
<field name="sort_de" type="sort_de_t" indexed="true" stored="false" multiValued="false" docValues="false" uninvertible="true"/>
44+
<field name="sort_tr_canon" type="sort_tr_canon_t" indexed="true" stored="false" multiValued="false" docValues="false" uninvertible="true"/>
45+
<field name="sort_zh_full" type="sort_zh_full_t" indexed="true" stored="false" multiValued="false" docValues="false" uninvertible="true"/>
46+
<field name="sort_da" type="sort_da_t" indexed="true" stored="false" multiValued="false" docValues="false" uninvertible="true"/>
47+
<field name="sort_custom" type="sort_custom_t" indexed="true" stored="false" multiValued="false" docValues="false" uninvertible="true"/>
4848

4949
<uniqueKey>id</uniqueKey>
5050

solr/core/src/test-files/solr/collection1/conf/schema-custom-field.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
-->
1818

1919
<schema name="test-custom-field-sort" version="1.7">
20-
<fieldType name="int" class="${solr.tests.IntegerFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
21-
<fieldType name="long" class="${solr.tests.LongFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
20+
<fieldType name="int" class="${solr.tests.IntegerFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0" uninvertible="true"/>
21+
<fieldType name="long" class="${solr.tests.LongFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0" uninvertible="true"/>
2222
<fieldType name="string" class="solr.StrField" sortMissingLast="true"/>
2323
<fieldType name="text" class="solr.TextField">
2424
<analyzer>

solr/core/src/test-files/solr/collection1/conf/schema-distributed-missing-sort.xml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,30 @@
1717
-->
1818

1919
<schema name="test-distributed-missing-sort" version="1.7">
20-
<fieldType name="int" class="${solr.tests.IntegerFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
21-
<fieldType name="tint" class="${solr.tests.IntegerFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
20+
<fieldType name="int" class="${solr.tests.IntegerFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0" uninvertible="true"/>
21+
<fieldType name="tint" class="${solr.tests.IntegerFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="8" omitNorms="true" positionIncrementGap="0" uninvertible="true"/>
2222

23-
<fieldType name="long" class="${solr.tests.LongFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
24-
<fieldType name="tlong" class="${solr.tests.LongFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
23+
<fieldType name="long" class="${solr.tests.LongFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0" uninvertible="true"/>
24+
<fieldType name="tlong" class="${solr.tests.LongFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="8" omitNorms="true" positionIncrementGap="0" uninvertible="true"/>
2525

26-
<fieldType name="float" class="${solr.tests.FloatFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
27-
<fieldType name="tfloat" class="${solr.tests.FloatFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
26+
<fieldType name="float" class="${solr.tests.FloatFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0" uninvertible="true"/>
27+
<fieldType name="tfloat" class="${solr.tests.FloatFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="8" omitNorms="true" positionIncrementGap="0" uninvertible="true"/>
2828

29-
<fieldType name="double" class="${solr.tests.DoubleFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
30-
<fieldType name="tdouble" class="${solr.tests.DoubleFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
29+
<fieldType name="double" class="${solr.tests.DoubleFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0" uninvertible="true"/>
30+
<fieldType name="tdouble" class="${solr.tests.DoubleFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="8" omitNorms="true" positionIncrementGap="0" uninvertible="true"/>
3131

32-
<fieldType name="date" class="${solr.tests.DateFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0"/>
33-
<fieldType name="tdate" class="${solr.tests.DateFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="6"/>
32+
<fieldType name="date" class="${solr.tests.DateFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" uninvertible="true"/>
33+
<fieldType name="tdate" class="${solr.tests.DateFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="6" uninvertible="true"/>
3434

3535
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
3636

37-
<fieldType name="int_ml" class="${solr.tests.IntegerFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" sortMissingLast="true"/>
38-
<fieldType name="int_mf" class="${solr.tests.IntegerFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" sortMissingFirst="true"/>
37+
<fieldType name="int_ml" class="${solr.tests.IntegerFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" sortMissingLast="true" uninvertible="true"/>
38+
<fieldType name="int_mf" class="${solr.tests.IntegerFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" sortMissingFirst="true" uninvertible="true"/>
3939

4040
<fieldType name="long_ml" class="${solr.tests.LongFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0"
41-
sortMissingLast="true"/>
41+
sortMissingLast="true" uninvertible="true"/>
4242
<fieldType name="long_mf" class="${solr.tests.LongFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0"
43-
sortMissingFirst="true"/>
43+
sortMissingFirst="true" uninvertible="true"/>
4444

4545
<fieldType name="string_ml" class="solr.StrField" sortMissingLast="true"/>
4646
<fieldType name="string_mf" class="solr.StrField" sortMissingFirst="true"/>
@@ -70,12 +70,12 @@
7070
<dynamicField name="*_dt1" type="date" indexed="true" stored="true" multiValued="false"/>
7171
<dynamicField name="*_tdt1" type="tdate" indexed="true" stored="true" multiValued="false"/>
7272

73-
<dynamicField name="*_b" type="boolean" indexed="true" stored="true" docValues="false"/>
73+
<dynamicField name="*_b" type="boolean" indexed="true" stored="true" docValues="false" uninvertible="true"/>
7474

75-
<dynamicField name="*_s1_ml" type="string_ml" indexed="true" stored="true" multiValued="false" docValues="false"/>
76-
<dynamicField name="*_s1_mf" type="string_mf" indexed="true" stored="true" multiValued="false" docValues="false"/>
75+
<dynamicField name="*_s1_ml" type="string_ml" indexed="true" stored="true" multiValued="false" docValues="false" uninvertible="true"/>
76+
<dynamicField name="*_s1_mf" type="string_mf" indexed="true" stored="true" multiValued="false" docValues="false" uninvertible="true"/>
7777

78-
<dynamicField name="*_mfacet" type="string_ml" indexed="true" stored="false" multiValued="true" docValues="false"/>
78+
<dynamicField name="*_mfacet" type="string_ml" indexed="true" stored="false" multiValued="true" docValues="false" uninvertible="true"/>
7979
<dynamicField name="*_sS" type="string_ml" indexed="false" stored="true" docValues="false"/>
8080

8181
<!-- int varient of id, adding this here simplifies some indexing and test assertions -->

solr/core/src/test-files/solr/collection1/conf/schema-docValues.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@
3838
These are provided more for backward compatability, allowing one
3939
to create a schema that matches an existing lucene index.
4040
-->
41-
<fieldType name="int" class="${solr.tests.IntegerFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
42-
<fieldType name="float" class="${solr.tests.FloatFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
43-
<fieldType name="long" class="${solr.tests.LongFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
44-
<fieldType name="double" class="${solr.tests.DoubleFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
41+
<fieldType name="int" class="${solr.tests.IntegerFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0" uninvertible="true"/>
42+
<fieldType name="float" class="${solr.tests.FloatFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0" uninvertible="true"/>
43+
<fieldType name="long" class="${solr.tests.LongFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0" uninvertible="true"/>
44+
<fieldType name="double" class="${solr.tests.DoubleFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0" uninvertible="true"/>
4545
<!-- format for date is 1995-12-31T23:59:59.999Z and only the fractional
4646
seconds part (.999) is optional.
4747
-->
48-
<fieldType name="date" class="${solr.tests.DateFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
48+
<fieldType name="date" class="${solr.tests.DateFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0" uninvertible="true"/>
4949

5050
<fieldType name="boolean" class="solr.BoolField"/>
5151
<fieldType name="string" class="solr.StrField"/>

0 commit comments

Comments
 (0)