From b499686133e138843aa3b52782dcce4a8bf19aaa Mon Sep 17 00:00:00 2001 From: Jason Gerlowski Date: Tue, 31 Mar 2026 08:28:29 -0400 Subject: [PATCH] SOLR-13309: Simplify references numeric-range classes Prior to this commit, the org.apache.solr.schema.numericrange subpackage was not in the list of packages that SolrResourceLoader uses to support the "shorthand" class syntax. As a result, references to these classes had to use fully-qualified syntax ('org.apache.solr.schema.numericRange.IntLongField'), or semi-qualified ('solr.numericrange.IntLongField'). This was quite awkward. This commit adds the 'numericrange' subpackage to the special list used by SRL, and cleans up the references to these field types to use the preferred shorthand syntax. --- .../apache/solr/core/SolrResourceLoader.java | 1 + .../schema/numericrange/DoubleRangeField.java | 4 +-- .../schema/numericrange/FloatRangeField.java | 4 +-- .../schema/numericrange/IntRangeField.java | 4 +-- .../schema/numericrange/LongRangeField.java | 4 +-- .../collection1/conf/schema-numericrange.xml | 32 +++++++++---------- .../pages/field-types-included-with-solr.adoc | 8 ++--- 7 files changed, 29 insertions(+), 28 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java b/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java index 4d2812ca668e..456106d0c877 100644 --- a/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java +++ b/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java @@ -90,6 +90,7 @@ public class SolrResourceLoader "", "analysis.", "schema.", + "schema.numericrange.", "handler.", "handler.tagger.", "search.", diff --git a/solr/core/src/java/org/apache/solr/schema/numericrange/DoubleRangeField.java b/solr/core/src/java/org/apache/solr/schema/numericrange/DoubleRangeField.java index 5f0d17da4bd0..c7eaeb5a82b8 100644 --- a/solr/core/src/java/org/apache/solr/schema/numericrange/DoubleRangeField.java +++ b/solr/core/src/java/org/apache/solr/schema/numericrange/DoubleRangeField.java @@ -51,8 +51,8 @@ *

Schema Configuration

* *
- * <fieldType name="doublerange" class="org.apache.solr.schema.numericrange.DoubleRangeField" numDimensions="1"/>
- * <fieldType name="doublerange2d" class="org.apache.solr.schema.numericrange.DoubleRangeField" numDimensions="2"/>
+ * <fieldType name="doublerange" class="solr.DoubleRangeField" numDimensions="1"/>
+ * <fieldType name="doublerange2d" class="solr.DoubleRangeField" numDimensions="2"/>
  * <field name="price_range" type="doublerange" indexed="true" stored="true"/>
  * <field name="my_2d_range" type="doublerange2d" indexed="true" stored="true"/>
  * 
diff --git a/solr/core/src/java/org/apache/solr/schema/numericrange/FloatRangeField.java b/solr/core/src/java/org/apache/solr/schema/numericrange/FloatRangeField.java index 80a685f45ff5..0d4e4f31d583 100644 --- a/solr/core/src/java/org/apache/solr/schema/numericrange/FloatRangeField.java +++ b/solr/core/src/java/org/apache/solr/schema/numericrange/FloatRangeField.java @@ -51,8 +51,8 @@ *

Schema Configuration

* *
- * <fieldType name="floatrange" class="org.apache.solr.schema.numericrange.FloatRangeField" numDimensions="1"/>
- * <fieldType name="floatrange2d" class="org.apache.solr.schema.numericrange.FloatRangeField" numDimensions="2"/>
+ * <fieldType name="floatrange" class="solr.FloatRangeField" numDimensions="1"/>
+ * <fieldType name="floatrange2d" class="solr.FloatRangeField" numDimensions="2"/>
  * <field name="price_range" type="floatrange" indexed="true" stored="true"/>
  * <field name="my_2d_range" type="floatrange2d" indexed="true" stored="true"/>
  * 
diff --git a/solr/core/src/java/org/apache/solr/schema/numericrange/IntRangeField.java b/solr/core/src/java/org/apache/solr/schema/numericrange/IntRangeField.java index 55a966c312fa..b8e76d0a680b 100644 --- a/solr/core/src/java/org/apache/solr/schema/numericrange/IntRangeField.java +++ b/solr/core/src/java/org/apache/solr/schema/numericrange/IntRangeField.java @@ -49,8 +49,8 @@ *

Schema Configuration

* *
- * <fieldType name="intrange" class="org.apache.solr.schema.numericrange.IntRangeField" numDimensions="1"/>
- * <fieldType name="intrange2d" class="org.apache.solr.schema.numericrange.IntRangeField" numDimensions="2"/>
+ * <fieldType name="intrange" class="solr.IntRangeField" numDimensions="1"/>
+ * <fieldType name="intrange2d" class="solr.IntRangeField" numDimensions="2"/>
  * <field name="price_range" type="intrange" indexed="true" stored="true"/>
  * <field name="bbox" type="intrange2d" indexed="true" stored="true"/>
  * 
diff --git a/solr/core/src/java/org/apache/solr/schema/numericrange/LongRangeField.java b/solr/core/src/java/org/apache/solr/schema/numericrange/LongRangeField.java index e4eaabb768e8..5004f3affb31 100644 --- a/solr/core/src/java/org/apache/solr/schema/numericrange/LongRangeField.java +++ b/solr/core/src/java/org/apache/solr/schema/numericrange/LongRangeField.java @@ -50,8 +50,8 @@ *

Schema Configuration

* *
- * <fieldType name="longrange" class="org.apache.solr.schema.numericrange.LongRangeField" numDimensions="1"/>
- * <fieldType name="longrange2d" class="org.apache.solr.schema.numericrange.LongRangeField" numDimensions="2"/>
+ * <fieldType name="longrange" class="solr.LongRangeField" numDimensions="1"/>
+ * <fieldType name="longrange2d" class="solr.LongRangeField" numDimensions="2"/>
  * <field name="long_range" type="longrange" indexed="true" stored="true"/>
  * <field name="long_range_2d" type="longrange2d" indexed="true" stored="true"/>
  * 
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-numericrange.xml b/solr/core/src/test-files/solr/collection1/conf/schema-numericrange.xml index 145de4a46c9c..660acc1bfb1a 100644 --- a/solr/core/src/test-files/solr/collection1/conf/schema-numericrange.xml +++ b/solr/core/src/test-files/solr/collection1/conf/schema-numericrange.xml @@ -25,28 +25,28 @@ - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + diff --git a/solr/solr-ref-guide/modules/indexing-guide/pages/field-types-included-with-solr.adoc b/solr/solr-ref-guide/modules/indexing-guide/pages/field-types-included-with-solr.adoc index c7124e6c816e..7a9508e083f8 100644 --- a/solr/solr-ref-guide/modules/indexing-guide/pages/field-types-included-with-solr.adoc +++ b/solr/solr-ref-guide/modules/indexing-guide/pages/field-types-included-with-solr.adoc @@ -51,17 +51,17 @@ The {solr-javadocs}/core/org/apache/solr/schema/package-summary.html[`org.apache |IntPointField |Integer field (32-bit signed integer). This class encodes int values using a "Dimensional Points" based data structure that allows for very efficient searches for specific values, or ranges of values. For single valued fields, `docValues="true"` must be used to enable sorting. -|IntRangeField |Stores single or multi-dimensional ranges, using syntax like `[1 TO 4]` or `[1,2 TO 3,4]`. Up to 4 dimensions are supported. Dimensionality is specified on new field-types using a `numDimensions` property, and all values for a particular field must have exactly this number of dimensions. Field type is defined in the `org.apache.solr.schema.numericrange` package; fieldType definitions typically reference this as: ``. Field type does not support docValues. Typically queried using the xref:query-guide:other-parsers.adoc#numeric-range-query-parser[Numeric Range Query Parser], though the Lucene and other query parsers also support this field by assuming "contains" semantics for searches. +|IntRangeField |Stores single or multi-dimensional ranges, using syntax like `[1 TO 4]` or `[1,2 TO 3,4]`. Up to 4 dimensions are supported. Dimensionality is specified on new field-types using a `numDimensions` property, and all values for a particular field must have exactly this number of dimensions. Field type does not support docValues. Typically queried using the xref:query-guide:other-parsers.adoc#numeric-range-query-parser[Numeric Range Query Parser], though the Lucene and other query parsers also support this field by assuming "contains" semantics for searches. |LatLonPointSpatialField |A latitude/longitude coordinate pair; possibly multi-valued for multiple points. Usually it's specified as "lat,lon" order with a comma. See the section xref:query-guide:spatial-search.adoc[] for more information. |LongPointField |Long field (64-bit signed integer). This class encodes foo values using a "Dimensional Points" based data structure that allows for very efficient searches for specific values, or ranges of values. For single valued fields, `docValues="true"` must be used to enable sorting. -|LongRangeField |Stores single or multi-dimensional ranges of long integers, using syntax like `[1000000000 TO 4000000000]` or `[1,2 TO 3,4]`. Up to 4 dimensions are supported. Dimensionality is specified on new field-types using a `numDimensions` property, and all values for a particular field must have exactly this number of dimensions. Field type is defined in the `org.apache.solr.schema.numericrange` package; fieldType definitions typically reference this as: ``. Field type does not support docValues. Typically queried using the xref:query-guide:other-parsers.adoc#numeric-range-query-parser[Numeric Range Query Parser], though the Lucene and other query parsers also support this field by assuming "contains" semantics for searches. +|LongRangeField |Stores single or multi-dimensional ranges of long integers, using syntax like `[1000000000 TO 4000000000]` or `[1,2 TO 3,4]`. Up to 4 dimensions are supported. Dimensionality is specified on new field-types using a `numDimensions` property, and all values for a particular field must have exactly this number of dimensions. Field type does not support docValues. Typically queried using the xref:query-guide:other-parsers.adoc#numeric-range-query-parser[Numeric Range Query Parser], though the Lucene and other query parsers also support this field by assuming "contains" semantics for searches. -|DoubleRangeField |Stores single or multi-dimensional ranges of double-precision floating-point numbers, using syntax like `[1.5 TO 2.5]` or `[1.0,2.0 TO 3.0,4.0]`. Up to 4 dimensions are supported. Dimensionality is specified on new field-types using a `numDimensions` property, and all values for a particular field must have exactly this number of dimensions. Field type is defined in the `org.apache.solr.schema.numericrange` package; fieldType definitions typically reference this as: ``. Field type does not support docValues. Typically queried using the xref:query-guide:other-parsers.adoc#numeric-range-query-parser[Numeric Range Query Parser], though the Lucene and other query parsers also support this field by assuming "contains" semantics for searches. +|DoubleRangeField |Stores single or multi-dimensional ranges of double-precision floating-point numbers, using syntax like `[1.5 TO 2.5]` or `[1.0,2.0 TO 3.0,4.0]`. Up to 4 dimensions are supported. Dimensionality is specified on new field-types using a `numDimensions` property, and all values for a particular field must have exactly this number of dimensions. Field type does not support docValues. Typically queried using the xref:query-guide:other-parsers.adoc#numeric-range-query-parser[Numeric Range Query Parser], though the Lucene and other query parsers also support this field by assuming "contains" semantics for searches. -|FloatRangeField |Stores single or multi-dimensional ranges of floating-point numbers, using syntax like `[1.5 TO 4.5]` or `[1.0,2.0 TO 3.0,4.0]`. Up to 4 dimensions are supported. Dimensionality is specified on new field-types using a `numDimensions` property, and all values for a particular field must have exactly this number of dimensions. Field type is defined in the `org.apache.solr.schema.numericrange` package; fieldType definitions typically reference this as: ``. Field type does not support docValues. Typically queried using the xref:query-guide:other-parsers.adoc#numeric-range-query-parser[Numeric Range Query Parser], though the Lucene and other query parsers also support this field by assuming "contains" semantics for searches. +|FloatRangeField |Stores single or multi-dimensional ranges of floating-point numbers, using syntax like `[1.5 TO 4.5]` or `[1.0,2.0 TO 3.0,4.0]`. Up to 4 dimensions are supported. Dimensionality is specified on new field-types using a `numDimensions` property, and all values for a particular field must have exactly this number of dimensions. Field type does not support docValues. Typically queried using the xref:query-guide:other-parsers.adoc#numeric-range-query-parser[Numeric Range Query Parser], though the Lucene and other query parsers also support this field by assuming "contains" semantics for searches. |NestPathField | Specialized field type storing enhanced information, when xref:indexing-nested-documents.adoc#schema-configuration[working with nested documents].