Skip to content

Apache Lucene open-source search software

SOLR-11978: use new SortableTextField in _default and sample_techproducts_configs configsets

Chris Hostetter034677d5ca0e
diff --git a/solr/core/src/test-files/solr/configsets/_default/conf/managed-schema b/solr/core/src/test-files/solr/configsets/_default/conf/managed-schema
index abc72a0c9fd..5a2ebaf2ee6 100644
--- a/solr/core/src/test-files/solr/configsets/_default/conf/managed-schema
+++ b/solr/core/src/test-files/solr/configsets/_default/conf/managed-schema
@@ -289,6 +289,30 @@
</analyzer>
</fieldType>
+
+ <!-- SortableTextField generaly functions exactly like TextField,
+ except that it supports, and by default uses, docValues for sorting (or faceting)
+ on the first 1024 characters of the original field values (which is configurable).
+
+ This makes it a bit more useful then TextField in many situations, but the trade-off
+ is that it takes up more space on disk; which is why it's not used in place of TextField
+ for every fieldType in this _default schema.
+ -->
+ <dynamicField name="*_txt_sort" type="text_gen_sort" indexed="true" stored="true"/>
+ <fieldType name="text_gen_sort" class="solr.SortableTextField" positionIncrementGap="100" multiValued="true">
+ <analyzer type="index">
+ <tokenizer class="solr.StandardTokenizerFactory"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
+ <filter class="solr.LowerCaseFilterFactory"/>
+ </analyzer>
+ <analyzer type="query">
+ <tokenizer class="solr.StandardTokenizerFactory"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
+ <filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
+ <filter class="solr.LowerCaseFilterFactory"/>
+ </analyzer>
+ </fieldType>
+
<!-- A text field with defaults appropriate for English: it tokenizes with StandardTokenizer,
removes English stop words (lang/stopwords_en.txt), down cases, protects words from protwords.txt, and
finally applies Porter's stemming. The query time analyzer also applies synonyms from synonyms.txt. -->
diff --git a/solr/server/solr/configsets/_default/conf/managed-schema b/solr/server/solr/configsets/_default/conf/managed-schema
index abc72a0c9fd..5a2ebaf2ee6 100644
--- a/solr/server/solr/configsets/_default/conf/managed-schema
+++ b/solr/server/solr/configsets/_default/conf/managed-schema
@@ -289,6 +289,30 @@
</analyzer>
</fieldType>
+
+ <!-- SortableTextField generaly functions exactly like TextField,
+ except that it supports, and by default uses, docValues for sorting (or faceting)
+ on the first 1024 characters of the original field values (which is configurable).
+
+ This makes it a bit more useful then TextField in many situations, but the trade-off
+ is that it takes up more space on disk; which is why it's not used in place of TextField
+ for every fieldType in this _default schema.
+ -->
+ <dynamicField name="*_txt_sort" type="text_gen_sort" indexed="true" stored="true"/>
+ <fieldType name="text_gen_sort" class="solr.SortableTextField" positionIncrementGap="100" multiValued="true">
+ <analyzer type="index">
+ <tokenizer class="solr.StandardTokenizerFactory"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
+ <filter class="solr.LowerCaseFilterFactory"/>
+ </analyzer>
+ <analyzer type="query">
+ <tokenizer class="solr.StandardTokenizerFactory"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
+ <filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
+ <filter class="solr.LowerCaseFilterFactory"/>
+ </analyzer>
+ </fieldType>
+
<!-- A text field with defaults appropriate for English: it tokenizes with StandardTokenizer,
removes English stop words (lang/stopwords_en.txt), down cases, protects words from protwords.txt, and
finally applies Porter's stemming. The query time analyzer also applies synonyms from synonyms.txt. -->
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 6d6b9fd3dee..5751806dd64 100644
--- a/solr/server/solr/configsets/sample_techproducts_configs/conf/managed-schema
+++ b/solr/server/solr/configsets/sample_techproducts_configs/conf/managed-schema
@@ -134,7 +134,7 @@
<field name="pre" type="preanalyzed" indexed="true" stored="true"/>
<field name="sku" type="text_en_splitting_tight" indexed="true" stored="true" omitNorms="true"/>
<field name="name" type="text_general" indexed="true" stored="true"/>
- <field name="manu" type="text_general" indexed="true" stored="true" omitNorms="true"/>
+ <field name="manu" type="text_gen_sort" indexed="true" stored="true" omitNorms="true" multiValued="false"/>
<field name="cat" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="features" type="text_general" indexed="true" stored="true" multiValued="true"/>
<field name="includes" type="text_general" indexed="true" stored="true" termVectors="true" termPositions="true" termOffsets="true" />
@@ -154,11 +154,11 @@
"content_type": From the HTTP headers of incoming stream
"resourcename": From SolrCell request param resource.name
-->
- <field name="title" type="text_general" indexed="true" stored="true" multiValued="true"/>
- <field name="subject" type="text_general" indexed="true" stored="true"/>
+ <field name="title" type="text_gen_sort" indexed="true" stored="true" multiValued="true"/>
+ <field name="subject" type="text_gen_sort" indexed="true" stored="true" multiValued="false"/>
<field name="description" type="text_general" indexed="true" stored="true"/>
<field name="comments" type="text_general" indexed="true" stored="true"/>
- <field name="author" type="text_general" indexed="true" stored="true"/>
+ <field name="author" type="text_gen_sort" indexed="true" stored="true" multiValued="false"/>
<field name="keywords" type="text_general" indexed="true" stored="true"/>
<field name="category" type="text_general" indexed="true" stored="true"/>
<field name="resourcename" type="text_general" indexed="true" stored="true"/>
@@ -423,6 +423,28 @@
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
+
+ <!-- SortableTextField generaly functions exactly like TextField,
+ except that it supports, and by default uses, docValues for sorting (or faceting)
+ on the first 1024 characters of the original field values (which is configurable).
+
+ This makes it a bit more useful then TextField in many situations, but the trade-off
+ is that it takes up more space on disk; which is why it's not used in place of TextField
+ for every fieldType in this _default schema.
+ -->
+ <fieldType name="text_gen_sort" class="solr.SortableTextField" positionIncrementGap="100" multiValued="true">
+ <analyzer type="index">
+ <tokenizer class="solr.StandardTokenizerFactory"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
+ <filter class="solr.LowerCaseFilterFactory"/>
+ </analyzer>
+ <analyzer type="query">
+ <tokenizer class="solr.StandardTokenizerFactory"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
+ <filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
+ <filter class="solr.LowerCaseFilterFactory"/>
+ </analyzer>
+ </fieldType>
<!-- A text field with defaults appropriate for English: it
tokenizes with StandardTokenizer, removes English stop words