[jira] [Updated] (SOLR-18016) issue with distance sorting on SpatialRecursivePrefixTreeFieldType with spatialContextFactory JTS in Solr 9.9 / 9.10

2025-12-05 Thread Umut Saribiyik (Jira)


 [ 
https://issues.apache.org/jira/browse/SOLR-18016?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Umut Saribiyik updated SOLR-18016:
--
Description: 
*Summary*
Sorting exception for {{SpatialRecursivePrefixTreeFieldType}} when using 
spatialContextFactory="JTS". Identical to SOLR-18006 but for a different field 
type.

*Description*
Hello [~janhoy] [~dsmiley] 

an issue identical to *SOLR-18006* occurs when using the field type 
*{{SpatialRecursivePrefixTreeFieldType}}* with 
{{{}*spatialContextFactory="JTS"*{}}}.
Both sorting directions ({{{}asc{}}} and {{{}desc{}}}) result in the same 
exception, which worked before solr 9.9 and 9.10

I was able to reproduce this on {*}main{*}, by extending the existing 
{{TestSolr4Spatial2}} class with an additional test.

h2. *Steps to Reproduce*
h3. *1. Add JTS dependency*

Extend {{{}build.gradle{}}}:
{code:java}
implementation("org.locationtech.jts:jts-core:1.20.0") {code}
*2. Disable dependency locking (for local testing only)*

In {{{}dependencies.gradle{}}}, comment out:
{code:java}
// lockAllConfigurations(){code}
(This is required only locally to avoid blocking the JTS dependency.
h3. *3. Extend schema with additional field type and field*

Add to {{{}schema-spatial.xml{}}}:
{code:java}
...

...
{code}
h3. *4. Add and run the test*

 
{code:java}
@Test
public void 
test_geodist_on_SpatialRecursivePrefixTreeFieldType_with_jts_spatialContextFactory()
 throws Exception {

  String fieldName = "location_jts";

  // Index sample documents
  assertU(adoc("id", "jts-001", fieldName, "11.628476,48.106651"));
  assertU(adoc("id", "jts-002", fieldName, "11.622016,48.113089"));
  assertU(adoc("id", "jts-003", fieldName, "11.576124,48.137154"));
  assertU(adoc("id", "jts-004", fieldName, "11.581981,48.135125"));
  assertU(adoc("id", "jts-005", fieldName, "11.612,48.121"));
  assertU(adoc("id", "jts-006", fieldName, "11.64,48.09"));
  assertU(commit());


  assertJQ(
  req(
  "q", "*:*",
  "fq", "{!geofilt}",
  "sfield", fieldName,
  "pt", "11.622015740056845,48.11308880280511",
  "d", "1000",
  "fl", "id",
  "sort", "geodist() desc"), // Or 'geodist() asc'
  "/response/numFound==6",
  "/response/docs/[0]/id=='jts-003'", // farthest
  "/response/docs/[1]/id=='jts-004'",
  "/response/docs/[2]/id=='jts-006'",
  "/response/docs/[3]/id=='jts-005'",
  "/response/docs/[4]/id=='jts-001'",
  "/response/docs/[5]/id=='jts-002'"); // closest
}{code}
 

*Test Result:*

!image-2025-12-05-16-20-48-202.png!
 

  was:
*Summary*
Sorting exception for {{SpatialRecursivePrefixTreeFieldType}} when using 
spatialContextFactory="JTS". Identical to SOLR-18006 but for a different field 
type.

*Description*
Hello [~janhoy] [~dsmiley] 

an issue identical to *SOLR-18006* occurs when using the field type 
*{{SpatialRecursivePrefixTreeFieldType}}* with 
{{{}*spatialContextFactory="JTS"*{}}}.
Both sorting directions ({{{}asc{}}} and {{{}desc{}}}) result in the same 
exception, which worked before solr 9.9 and 9.10

I was able to reproduce this on {*}main{*}, by extending the existing 
{{TestSolr4Spatial2}} class with an additional test.

h2. *Steps to Reproduce*
h3. *1. Add JTS dependency*

Extend {{{}build.gradle{}}}:
{code:java}
implementation("org.locationtech.jts:jts-core:1.20.0") {code}
*2. Disable dependency locking (for local testing only)*

In {{{}dependencies.gradle{}}}, comment out:
{code:java}
// lockAllConfigurations(){code}
(This is required only locally to avoid blocking the JTS dependency.)}}{}}}
h3. *3. Extend schema with additional field type and field*

Add to {{{}schema-spatial.xml{}}}:
{code:java}
...

...
{code}
h3. *4. Add and run the test*

 
{code:java}
@Test
public void 
test_geodist_on_SpatialRecursivePrefixTreeFieldType_with_jts_spatialContextFactory()
 throws Exception {

  String fieldName = "location_jts";

  // Index sample documents
  assertU(adoc("id", "jts-001", fieldName, "11.628476,48.106651"));
  assertU(adoc("id", "jts-002", fieldName, "11.622016,48.113089"));
  assertU(adoc("id", "jts-003", fieldName, "11.576124,48.137154"));
  assertU(adoc("id", "jts-004", fieldName, "11.581981,48.135125"));
  assertU(adoc("id", "jts-005", fieldName, "11.612,48.121"));
  assertU(adoc("id", "jts-006", fieldName, "11.64,48.09"));
  assertU(commit());


  assertJQ(
  req(
  "q", "*:*",
  "fq", "{!geofilt}",
  "sfield", fieldName,
  "pt", "11.622015740056845,48.11308880280511",
  "d", "1000",
  "fl", "id",
  "sort", "geodist() desc"), // Or 'geodist() asc'
  "/response/numFound==6",
  "/response/docs/[0]/id=='jts-003'", // farthest
  "/response/docs/[1]/id=='jts-004'",
  "/response/docs/[2]/id=='jts-006'",
  "/response/docs/[3]/id=='jts-005'",
  "/response/docs/[4]/id=='jts-001'",
  "/response/docs/[5]/id=='jts-002'"); // closest
}{

[jira] [Updated] (SOLR-18016) issue with distance sorting on SpatialRecursivePrefixTreeFieldType with spatialContextFactory JTS in Solr 9.9 / 9.10

2025-12-05 Thread Umut Saribiyik (Jira)


 [ 
https://issues.apache.org/jira/browse/SOLR-18016?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Umut Saribiyik updated SOLR-18016:
--
Description: 
*Summary*
Sorting exception for {{SpatialRecursivePrefixTreeFieldType}} when using 
spatialContextFactory="JTS". Identical to SOLR-18006 but for a different field 
type.

*Description*
Hello [~janhoy] [~dsmiley] 

an issue identical to *SOLR-18006* occurs when using the field type 
*{{SpatialRecursivePrefixTreeFieldType}}* with 
{{{}*spatialContextFactory="JTS"*{}}}.
Both sorting directions ({{{}asc{}}} and {{{}desc{}}}) result in the same 
exception, which worked before solr 9.9 and 9.10

I was able to reproduce this on {*}main{*}, by extending the existing 
{{TestSolr4Spatial2}} class with an additional test.

h2. *Steps to Reproduce*
h3. *1. Add JTS dependency*

Extend {{{}build.gradle{}}}:
{code:java}
implementation("org.locationtech.jts:jts-core:1.20.0") {code}
*2. Disable dependency locking (for local testing only)*

In {{{}dependencies.gradle{}}}, comment out:
{code:java}
// lockAllConfigurations(){code}
(This is required only locally to avoid blocking the JTS dependency.)}}{}}}
h3. *3. Extend schema with additional field type and field*

Add to {{{}schema-spatial.xml{}}}:
{code:java}
...

...
{code}
h3. *4. Add and run the test*

 
{code:java}
@Test
public void 
test_geodist_on_SpatialRecursivePrefixTreeFieldType_with_jts_spatialContextFactory()
 throws Exception {

  String fieldName = "location_jts";

  // Index sample documents
  assertU(adoc("id", "jts-001", fieldName, "11.628476,48.106651"));
  assertU(adoc("id", "jts-002", fieldName, "11.622016,48.113089"));
  assertU(adoc("id", "jts-003", fieldName, "11.576124,48.137154"));
  assertU(adoc("id", "jts-004", fieldName, "11.581981,48.135125"));
  assertU(adoc("id", "jts-005", fieldName, "11.612,48.121"));
  assertU(adoc("id", "jts-006", fieldName, "11.64,48.09"));
  assertU(commit());


  assertJQ(
  req(
  "q", "*:*",
  "fq", "{!geofilt}",
  "sfield", fieldName,
  "pt", "11.622015740056845,48.11308880280511",
  "d", "1000",
  "fl", "id",
  "sort", "geodist() desc"), // Or 'geodist() asc'
  "/response/numFound==6",
  "/response/docs/[0]/id=='jts-003'", // farthest
  "/response/docs/[1]/id=='jts-004'",
  "/response/docs/[2]/id=='jts-006'",
  "/response/docs/[3]/id=='jts-005'",
  "/response/docs/[4]/id=='jts-001'",
  "/response/docs/[5]/id=='jts-002'"); // closest
}{code}
 

*Test Result:*

!image-2025-12-05-16-20-48-202.png!
 

  was:
*Summary*
Sorting exception for {{SpatialRecursivePrefixTreeFieldType}} when using 
\{{spatialContextFactory="JTS". }}Identical to SOLR-18006 but for a different 
field type.

*Description*
Hello [~janhoy] [~dsmiley] 

an issue identical to *SOLR-18006* occurs when using the field type 
*{{SpatialRecursivePrefixTreeFieldType}}* with 
{{{}*spatialContextFactory="JTS"*{}}}.
Both sorting directions ({{{}asc{}}} and {{{}desc{}}}) result in the same 
exception, which worked before solr 9.9 and 9.10

I was able to reproduce this on {*}main{*}, by extending the existing 
{{TestSolr4Spatial2}} class with an additional test.

h2. *Steps to Reproduce*
h3. *1. Add JTS dependency*

Extend {{{}build.gradle{}}}:
{code:java}
implementation("org.locationtech.jts:jts-core:1.20.0") {code}
*2. Disable dependency locking (for local testing only)*

In {{{}dependencies.gradle{}}}, comment out:
{code:java}
// lockAllConfigurations(){code}
(This is required only locally to avoid blocking the JTS dependency.)}}{}}}
h3. *3. Extend schema with additional field type and field*

Add to {{{}schema-spatial.xml{}}}:
{code:java}
...

...
{code}
h3. *4. Add and run the test*

 
{code:java}
@Test
public void 
test_geodist_on_SpatialRecursivePrefixTreeFieldType_with_jts_spatialContextFactory()
 throws Exception {

  String fieldName = "location_jts";

  // Index sample documents
  assertU(adoc("id", "jts-001", fieldName, "11.628476,48.106651"));
  assertU(adoc("id", "jts-002", fieldName, "11.622016,48.113089"));
  assertU(adoc("id", "jts-003", fieldName, "11.576124,48.137154"));
  assertU(adoc("id", "jts-004", fieldName, "11.581981,48.135125"));
  assertU(adoc("id", "jts-005", fieldName, "11.612,48.121"));
  assertU(adoc("id", "jts-006", fieldName, "11.64,48.09"));
  assertU(commit());


  assertJQ(
  req(
  "q", "*:*",
  "fq", "{!geofilt}",
  "sfield", fieldName,
  "pt", "11.622015740056845,48.11308880280511",
  "d", "1000",
  "fl", "id",
  "sort", "geodist() desc"), // Or 'geodist() asc'
  "/response/numFound==6",
  "/response/docs/[0]/id=='jts-003'", // farthest
  "/response/docs/[1]/id=='jts-004'",
  "/response/docs/[2]/id=='jts-006'",
  "/response/docs/[3]/id=='jts-005'",
  "/response/docs/[4]/id=='jts-001'",
  "/response/docs/[5]/id=='jts-002'"

[jira] [Updated] (SOLR-18016) issue with distance sorting on SpatialRecursivePrefixTreeFieldType with spatialContextFactory JTS in Solr 9.9 / 9.10

2025-12-05 Thread Umut Saribiyik (Jira)


 [ 
https://issues.apache.org/jira/browse/SOLR-18016?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Umut Saribiyik updated SOLR-18016:
--
Description: 
*Summary*
Sorting exception for {{SpatialRecursivePrefixTreeFieldType}} when using 
\{{spatialContextFactory="JTS". }}Identical to SOLR-18006 but for a different 
field type.

*Description*
Hello [~janhoy] [~dsmiley] 

an issue identical to *SOLR-18006* occurs when using the field type 
*{{SpatialRecursivePrefixTreeFieldType}}* with 
{{{}*spatialContextFactory="JTS"*{}}}.
Both sorting directions ({{{}asc{}}} and {{{}desc{}}}) result in the same 
exception, which worked before solr 9.9 and 9.10

I was able to reproduce this on {*}main{*}, by extending the existing 
{{TestSolr4Spatial2}} class with an additional test.

h2. *Steps to Reproduce*
h3. *1. Add JTS dependency*

Extend {{{}build.gradle{}}}:

 
{code:java}
implementation("org.locationtech.jts:jts-core:1.20.0") {code}
*2. Disable dependency locking (for local testing only)*

In {{{}dependencies.gradle{}}}, comment out:
{code:java}
// lockAllConfigurations(){code}
(This is required only locally to avoid blocking the JTS dependency.)}}{}}}
h3. *3. Extend schema with additional field type and field*

Add to {{{}schema-spatial.xml{}}}:

 
{code:java}
...

...
{code}
h3. *4. Add and run the test*

 
{code:java}
@Test
public void 
test_geodist_on_SpatialRecursivePrefixTreeFieldType_with_jts_spatialContextFactory()
 throws Exception {

  String fieldName = "location_jts";

  // Index sample documents
  assertU(adoc("id", "jts-001", fieldName, "11.628476,48.106651"));
  assertU(adoc("id", "jts-002", fieldName, "11.622016,48.113089"));
  assertU(adoc("id", "jts-003", fieldName, "11.576124,48.137154"));
  assertU(adoc("id", "jts-004", fieldName, "11.581981,48.135125"));
  assertU(adoc("id", "jts-005", fieldName, "11.612,48.121"));
  assertU(adoc("id", "jts-006", fieldName, "11.64,48.09"));
  assertU(commit());


  assertJQ(
  req(
  "q", "*:*",
  "fq", "{!geofilt}",
  "sfield", fieldName,
  "pt", "11.622015740056845,48.11308880280511",
  "d", "1000",
  "fl", "id",
  "sort", "geodist() desc"), // Or 'geodist() asc'
  "/response/numFound==6",
  "/response/docs/[0]/id=='jts-003'", // farthest
  "/response/docs/[1]/id=='jts-004'",
  "/response/docs/[2]/id=='jts-006'",
  "/response/docs/[3]/id=='jts-005'",
  "/response/docs/[4]/id=='jts-001'",
  "/response/docs/[5]/id=='jts-002'"); // closest
}{code}
 

*Test Result:*

!image-2025-12-05-16-20-48-202.png!
 

  was:
*Summary*
Sorting exception for {{SpatialRecursivePrefixTreeFieldType}} when using 
\{{spatialContextFactory="JTS". }}Identical to SOLR-18006 but for a different 
field type.

*Description*
Hello [~janhoy] [~dsmiley] 

an issue identical to *SOLR-18006* occurs when using the field type 
*{{SpatialRecursivePrefixTreeFieldType}}* with 
{{{}*spatialContextFactory="JTS"*{}}}.
Both sorting directions ({{{}asc{}}} and {{{}desc{}}}) result in the same 
exception, which worked before solr 9.9 and 9.10

I was able to reproduce this on {*}main{*}, by extending the existing 
{{TestSolr4Spatial2}} class with an additional test.

h2. *Steps to Reproduce*
h3. *1. Add JTS dependency*

Extend {{{}build.gradle{}}}:

 
{code:java}
implementation("org.locationtech.jts:jts-core:1.20.0") {code}

*2. Disable dependency locking (for local testing only)*

In {{{}dependencies.gradle{}}}, comment out:
{code:java}
// lockAllConfigurations(){code}
(This is required only locally to avoid blocking the JTS dependency.)}}{}}}
h3. *3. Extend schema with additional field type and field*

Add to {{{}schema-spatial.xml{}}}:

 
{code:java}
...

...
{code}
 
h3. *4. Add and run the test*

 

 
{code:java}
@Test
public void 
test_geodist_on_SpatialRecursivePrefixTreeFieldType_with_jts_spatialContextFactory()
 throws Exception {

  String fieldName = "location_jts";

  // Index sample documents
  assertU(adoc("id", "jts-001", fieldName, "11.628476,48.106651"));
  assertU(adoc("id", "jts-002", fieldName, "11.622016,48.113089"));
  assertU(adoc("id", "jts-003", fieldName, "11.576124,48.137154"));
  assertU(adoc("id", "jts-004", fieldName, "11.581981,48.135125"));
  assertU(adoc("id", "jts-005", fieldName, "11.612,48.121"));
  assertU(adoc("id", "jts-006", fieldName, "11.64,48.09"));
  assertU(commit());


  assertJQ(
  req(
  "q", "*:*",
  "fq", "{!geofilt}",
  "sfield", fieldName,
  "pt", "11.622015740056845,48.11308880280511",
  "d", "1000",
  "fl", "id",
  "sort", "geodist() desc"), // Or 'geodist() asc'
  "/response/numFound==6",
  "/response/docs/[0]/id=='jts-003'", // farthest
  "/response/docs/[1]/id=='jts-004'",
  "/response/docs/[2]/id=='jts-006'",
  "/response/docs/[3]/id=='jts-005'",
  "/response/docs/[4]/id=='jts-001'",
  "/response/

[jira] [Updated] (SOLR-18016) issue with distance sorting on SpatialRecursivePrefixTreeFieldType with spatialContextFactory JTS in Solr 9.9 / 9.10

2025-12-05 Thread Umut Saribiyik (Jira)


 [ 
https://issues.apache.org/jira/browse/SOLR-18016?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Umut Saribiyik updated SOLR-18016:
--
Description: 
*Summary*
Sorting exception for {{SpatialRecursivePrefixTreeFieldType}} when using 
\{{spatialContextFactory="JTS". }}Identical to SOLR-18006 but for a different 
field type.

*Description*
Hello [~janhoy] [~dsmiley] 

an issue identical to *SOLR-18006* occurs when using the field type 
*{{SpatialRecursivePrefixTreeFieldType}}* with 
{{{}*spatialContextFactory="JTS"*{}}}.
Both sorting directions ({{{}asc{}}} and {{{}desc{}}}) result in the same 
exception, which worked before solr 9.9 and 9.10

I was able to reproduce this on {*}main{*}, by extending the existing 
{{TestSolr4Spatial2}} class with an additional test.

h2. *Steps to Reproduce*
h3. *1. Add JTS dependency*

Extend {{{}build.gradle{}}}:


{code:java}
implementation("org.locationtech.jts:jts-core:1.20.0") {code}
*2. Disable dependency locking (for local testing only)*

In {{{}dependencies.gradle{}}}, comment out:
{code:java}
// lockAllConfigurations(){code}
(This is required only locally to avoid blocking the JTS dependency.)}}{}}}
h3. *3. Extend schema with additional field type and field*

Add to {{{}schema-spatial.xml{}}}:

 
{code:java}
...

...
{code}
h3. *4. Add and run the test*

 
{code:java}
@Test
public void 
test_geodist_on_SpatialRecursivePrefixTreeFieldType_with_jts_spatialContextFactory()
 throws Exception {

  String fieldName = "location_jts";

  // Index sample documents
  assertU(adoc("id", "jts-001", fieldName, "11.628476,48.106651"));
  assertU(adoc("id", "jts-002", fieldName, "11.622016,48.113089"));
  assertU(adoc("id", "jts-003", fieldName, "11.576124,48.137154"));
  assertU(adoc("id", "jts-004", fieldName, "11.581981,48.135125"));
  assertU(adoc("id", "jts-005", fieldName, "11.612,48.121"));
  assertU(adoc("id", "jts-006", fieldName, "11.64,48.09"));
  assertU(commit());


  assertJQ(
  req(
  "q", "*:*",
  "fq", "{!geofilt}",
  "sfield", fieldName,
  "pt", "11.622015740056845,48.11308880280511",
  "d", "1000",
  "fl", "id",
  "sort", "geodist() desc"), // Or 'geodist() asc'
  "/response/numFound==6",
  "/response/docs/[0]/id=='jts-003'", // farthest
  "/response/docs/[1]/id=='jts-004'",
  "/response/docs/[2]/id=='jts-006'",
  "/response/docs/[3]/id=='jts-005'",
  "/response/docs/[4]/id=='jts-001'",
  "/response/docs/[5]/id=='jts-002'"); // closest
}{code}
 

*Test Result:*

!image-2025-12-05-16-20-48-202.png!
 

  was:
*Summary*
Sorting exception for {{SpatialRecursivePrefixTreeFieldType}} when using 
\{{spatialContextFactory="JTS". }}Identical to SOLR-18006 but for a different 
field type.

*Description*
Hello [~janhoy] [~dsmiley] 

an issue identical to *SOLR-18006* occurs when using the field type 
*{{SpatialRecursivePrefixTreeFieldType}}* with 
{{{}*spatialContextFactory="JTS"*{}}}.
Both sorting directions ({{{}asc{}}} and {{{}desc{}}}) result in the same 
exception, which worked before solr 9.9 and 9.10

I was able to reproduce this on {*}main{*}, by extending the existing 
{{TestSolr4Spatial2}} class with an additional test.

h2. *Steps to Reproduce*
h3. *1. Add JTS dependency*

Extend {{{}build.gradle{}}}:

 
{code:java}
implementation("org.locationtech.jts:jts-core:1.20.0") {code}
*2. Disable dependency locking (for local testing only)*

In {{{}dependencies.gradle{}}}, comment out:
{code:java}
// lockAllConfigurations(){code}
(This is required only locally to avoid blocking the JTS dependency.)}}{}}}
h3. *3. Extend schema with additional field type and field*

Add to {{{}schema-spatial.xml{}}}:

 
{code:java}
...

...
{code}
h3. *4. Add and run the test*

 
{code:java}
@Test
public void 
test_geodist_on_SpatialRecursivePrefixTreeFieldType_with_jts_spatialContextFactory()
 throws Exception {

  String fieldName = "location_jts";

  // Index sample documents
  assertU(adoc("id", "jts-001", fieldName, "11.628476,48.106651"));
  assertU(adoc("id", "jts-002", fieldName, "11.622016,48.113089"));
  assertU(adoc("id", "jts-003", fieldName, "11.576124,48.137154"));
  assertU(adoc("id", "jts-004", fieldName, "11.581981,48.135125"));
  assertU(adoc("id", "jts-005", fieldName, "11.612,48.121"));
  assertU(adoc("id", "jts-006", fieldName, "11.64,48.09"));
  assertU(commit());


  assertJQ(
  req(
  "q", "*:*",
  "fq", "{!geofilt}",
  "sfield", fieldName,
  "pt", "11.622015740056845,48.11308880280511",
  "d", "1000",
  "fl", "id",
  "sort", "geodist() desc"), // Or 'geodist() asc'
  "/response/numFound==6",
  "/response/docs/[0]/id=='jts-003'", // farthest
  "/response/docs/[1]/id=='jts-004'",
  "/response/docs/[2]/id=='jts-006'",
  "/response/docs/[3]/id=='jts-005'",
  "/response/docs/[4]/id=='jts-001'",
  "/response/docs/[5

[jira] [Updated] (SOLR-18016) issue with distance sorting on SpatialRecursivePrefixTreeFieldType with spatialContextFactory JTS in Solr 9.9 / 9.10

2025-12-05 Thread Umut Saribiyik (Jira)


 [ 
https://issues.apache.org/jira/browse/SOLR-18016?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Umut Saribiyik updated SOLR-18016:
--
Description: 
*Summary*
Sorting exception for {{SpatialRecursivePrefixTreeFieldType}} when using 
\{{spatialContextFactory="JTS". }}Identical to SOLR-18006 but for a different 
field type.

*Description*
Hello [~janhoy] [~dsmiley] 

an issue identical to *SOLR-18006* occurs when using the field type 
*{{SpatialRecursivePrefixTreeFieldType}}* with 
{{{}*spatialContextFactory="JTS"*{}}}.
Both sorting directions ({{{}asc{}}} and {{{}desc{}}}) result in the same 
exception, which worked before solr 9.9 and 9.10

I was able to reproduce this on {*}main{*}, by extending the existing 
{{TestSolr4Spatial2}} class with an additional test.

h2. *Steps to Reproduce*
h3. *1. Add JTS dependency*

Extend {{{}build.gradle{}}}:
{code:java}
implementation("org.locationtech.jts:jts-core:1.20.0") {code}
*2. Disable dependency locking (for local testing only)*

In {{{}dependencies.gradle{}}}, comment out:
{code:java}
// lockAllConfigurations(){code}
(This is required only locally to avoid blocking the JTS dependency.)}}{}}}
h3. *3. Extend schema with additional field type and field*

Add to {{{}schema-spatial.xml{}}}:
{code:java}
...

...
{code}
h3. *4. Add and run the test*

 
{code:java}
@Test
public void 
test_geodist_on_SpatialRecursivePrefixTreeFieldType_with_jts_spatialContextFactory()
 throws Exception {

  String fieldName = "location_jts";

  // Index sample documents
  assertU(adoc("id", "jts-001", fieldName, "11.628476,48.106651"));
  assertU(adoc("id", "jts-002", fieldName, "11.622016,48.113089"));
  assertU(adoc("id", "jts-003", fieldName, "11.576124,48.137154"));
  assertU(adoc("id", "jts-004", fieldName, "11.581981,48.135125"));
  assertU(adoc("id", "jts-005", fieldName, "11.612,48.121"));
  assertU(adoc("id", "jts-006", fieldName, "11.64,48.09"));
  assertU(commit());


  assertJQ(
  req(
  "q", "*:*",
  "fq", "{!geofilt}",
  "sfield", fieldName,
  "pt", "11.622015740056845,48.11308880280511",
  "d", "1000",
  "fl", "id",
  "sort", "geodist() desc"), // Or 'geodist() asc'
  "/response/numFound==6",
  "/response/docs/[0]/id=='jts-003'", // farthest
  "/response/docs/[1]/id=='jts-004'",
  "/response/docs/[2]/id=='jts-006'",
  "/response/docs/[3]/id=='jts-005'",
  "/response/docs/[4]/id=='jts-001'",
  "/response/docs/[5]/id=='jts-002'"); // closest
}{code}
 

*Test Result:*

!image-2025-12-05-16-20-48-202.png!
 

  was:
*Summary*
Sorting exception for {{SpatialRecursivePrefixTreeFieldType}} when using 
\{{spatialContextFactory="JTS". }}Identical to SOLR-18006 but for a different 
field type.

*Description*
Hello [~janhoy] [~dsmiley] 

an issue identical to *SOLR-18006* occurs when using the field type 
*{{SpatialRecursivePrefixTreeFieldType}}* with 
{{{}*spatialContextFactory="JTS"*{}}}.
Both sorting directions ({{{}asc{}}} and {{{}desc{}}}) result in the same 
exception, which worked before solr 9.9 and 9.10

I was able to reproduce this on {*}main{*}, by extending the existing 
{{TestSolr4Spatial2}} class with an additional test.

h2. *Steps to Reproduce*
h3. *1. Add JTS dependency*

Extend {{{}build.gradle{}}}:


{code:java}
implementation("org.locationtech.jts:jts-core:1.20.0") {code}
*2. Disable dependency locking (for local testing only)*

In {{{}dependencies.gradle{}}}, comment out:
{code:java}
// lockAllConfigurations(){code}
(This is required only locally to avoid blocking the JTS dependency.)}}{}}}
h3. *3. Extend schema with additional field type and field*

Add to {{{}schema-spatial.xml{}}}:

 
{code:java}
...

...
{code}
h3. *4. Add and run the test*

 
{code:java}
@Test
public void 
test_geodist_on_SpatialRecursivePrefixTreeFieldType_with_jts_spatialContextFactory()
 throws Exception {

  String fieldName = "location_jts";

  // Index sample documents
  assertU(adoc("id", "jts-001", fieldName, "11.628476,48.106651"));
  assertU(adoc("id", "jts-002", fieldName, "11.622016,48.113089"));
  assertU(adoc("id", "jts-003", fieldName, "11.576124,48.137154"));
  assertU(adoc("id", "jts-004", fieldName, "11.581981,48.135125"));
  assertU(adoc("id", "jts-005", fieldName, "11.612,48.121"));
  assertU(adoc("id", "jts-006", fieldName, "11.64,48.09"));
  assertU(commit());


  assertJQ(
  req(
  "q", "*:*",
  "fq", "{!geofilt}",
  "sfield", fieldName,
  "pt", "11.622015740056845,48.11308880280511",
  "d", "1000",
  "fl", "id",
  "sort", "geodist() desc"), // Or 'geodist() asc'
  "/response/numFound==6",
  "/response/docs/[0]/id=='jts-003'", // farthest
  "/response/docs/[1]/id=='jts-004'",
  "/response/docs/[2]/id=='jts-006'",
  "/response/docs/[3]/id=='jts-005'",
  "/response/docs/[4]/id=='jts-001'",
  "/response/docs/[5]/id==

[jira] [Updated] (SOLR-18016) issue with distance sorting on SpatialRecursivePrefixTreeFieldType with spatialContextFactory JTS in Solr 9.9 / 9.10

2025-12-05 Thread Umut Saribiyik (Jira)


 [ 
https://issues.apache.org/jira/browse/SOLR-18016?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Umut Saribiyik updated SOLR-18016:
--
Description: 
*Summary*
Sorting exception for {{SpatialRecursivePrefixTreeFieldType}} when using 
\{{spatialContextFactory="JTS". }}Identical to SOLR-18006 but for a different 
field type.

*Description*
Hello [~janhoy] [~dsmiley] 

an issue identical to *SOLR-18006* occurs when using the field type 
*{{SpatialRecursivePrefixTreeFieldType}}* with 
{{{}*spatialContextFactory="JTS"*{}}}.
Both sorting directions ({{{}asc{}}} and {{{}desc{}}}) result in the same 
exception, which worked before solr 9.9 and 9.10

I was able to reproduce this on {*}main{*}, by extending the existing 
{{TestSolr4Spatial2}} class with an additional test.

h2. *Steps to Reproduce*
h3. *1. Add JTS dependency*

Extend {{{}build.gradle{}}}:

 
{code:java}
implementation("org.locationtech.jts:jts-core:1.20.0") {code}

*2. Disable dependency locking (for local testing only)*

In {{{}dependencies.gradle{}}}, comment out:
{code:java}
// lockAllConfigurations(){code}
(This is required only locally to avoid blocking the JTS dependency.)}}{}}}
h3. *3. Extend schema with additional field type and field*

Add to {{{}schema-spatial.xml{}}}:

 
{code:java}
...

...
{code}
 
h3. *4. Add and run the test*

 

 
{code:java}
@Test
public void 
test_geodist_on_SpatialRecursivePrefixTreeFieldType_with_jts_spatialContextFactory()
 throws Exception {

  String fieldName = "location_jts";

  // Index sample documents
  assertU(adoc("id", "jts-001", fieldName, "11.628476,48.106651"));
  assertU(adoc("id", "jts-002", fieldName, "11.622016,48.113089"));
  assertU(adoc("id", "jts-003", fieldName, "11.576124,48.137154"));
  assertU(adoc("id", "jts-004", fieldName, "11.581981,48.135125"));
  assertU(adoc("id", "jts-005", fieldName, "11.612,48.121"));
  assertU(adoc("id", "jts-006", fieldName, "11.64,48.09"));
  assertU(commit());


  assertJQ(
  req(
  "q", "*:*",
  "fq", "{!geofilt}",
  "sfield", fieldName,
  "pt", "11.622015740056845,48.11308880280511",
  "d", "1000",
  "fl", "id",
  "sort", "geodist() desc"), // Or 'geodist() asc'
  "/response/numFound==6",
  "/response/docs/[0]/id=='jts-003'", // farthest
  "/response/docs/[1]/id=='jts-004'",
  "/response/docs/[2]/id=='jts-006'",
  "/response/docs/[3]/id=='jts-005'",
  "/response/docs/[4]/id=='jts-001'",
  "/response/docs/[5]/id=='jts-002'"); // closest
}{code}
 

 

Test Result:

!image-2025-12-05-16-20-48-202.png!
 

  was:
*Summary*
Sorting exception for {{SpatialRecursivePrefixTreeFieldType}} when using 
{{spatialContextFactory="JTS". }}Identical to SOLR-18006 but for a different 
field type.

*Description*
Hello [~janhoy] [~dsmiley] 

an issue identical to *SOLR-18006* occurs when using the field type 
*{{SpatialRecursivePrefixTreeFieldType}}* with 
{{{}*spatialContextFactory="JTS"*{}}}.
Both sorting directions ({{{}asc{}}} and {{{}desc{}}}) result in the same 
exception, which worked before solr 9.9 and 9.10

I was able to reproduce this on {*}main{*}, by extending the existing 
{{TestSolr4Spatial2}} class with an additional test.

h2. *Steps to Reproduce*
h3. *1. Add JTS dependency*

Extend {{{}build.gradle{}}}:

 
{code:java}
implementation("org.locationtech.jts:jts-core:1.20.0") {code}
 
h3. *2. Disable dependency locking (for local testing only)*

In {{{}dependencies.gradle{}}}, comment out:
{code:java}
// lockAllConfigurations(){code}
(This is required only locally to avoid blocking the JTS dependency.){{{}{}}}
h3. *3. Extend schema with additional field type and field*

Add to {{{}schema-spatial.xml{}}}:

 

 
{code:java}
...

...
{code}
 
h3. *4. Add and run the test*

 

 
{code:java}
@Test
public void 
test_geodist_on_SpatialRecursivePrefixTreeFieldType_with_jts_spatialContextFactory()
 throws Exception {

  String fieldName = "location_jts";

  // Index sample documents
  assertU(adoc("id", "jts-001", fieldName, "11.628476,48.106651"));
  assertU(adoc("id", "jts-002", fieldName, "11.622016,48.113089"));
  assertU(adoc("id", "jts-003", fieldName, "11.576124,48.137154"));
  assertU(adoc("id", "jts-004", fieldName, "11.581981,48.135125"));
  assertU(adoc("id", "jts-005", fieldName, "11.612,48.121"));
  assertU(adoc("id", "jts-006", fieldName, "11.64,48.09"));
  assertU(commit());


  assertJQ(
  req(
  "q", "*:*",
  "fq", "{!geofilt}",
  "sfield", fieldName,
  "pt", "11.622015740056845,48.11308880280511",
  "d", "1000",
  "fl", "id",
  "sort", "geodist() desc"), // Or 'geodist() asc'
  "/response/numFound==6",
  "/response/docs/[0]/id=='jts-003'", // farthest
  "/response/docs/[1]/id=='jts-004'",
  "/response/docs/[2]/id=='jts-006'",
  "/response/docs/[3]/id=='jts-005'",
  "/response/docs/[4]/id=='jts-001'",