Using DistanceSortField does not verify the field parameter passed to the constructor

Description

It is possible to use DistanceSortField on non existent or non spatial fields without warning or error. From SpatialIndexingTest:

SpatialIndexingTest.java

where NonGeoPOI looks like this:

NonGeoPOI.java

The test refers to a field location which does not even exist. The code does neither fail or log a warning. The projected distance value is constant for all indexed points.

One could try to verify whether the field exists using the meta data, but this requires that the targeted entity is known. What would one do, if all entities are targeted? Does this even make sense?

Environment

None

Assignee

Davide D'Alto

Reporter

Hardy Ferentschik

Labels

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Affects versions

Priority

Major
Configure