Detect invalid cardinality of fields mapped as DocValues
Description
Activity
Show:

Yoann Rodière January 27, 2020 at 9:01 AM
This was addressed as part of HSEARCH-3324. Closing.

Sanne Grinovero April 19, 2016 at 9:26 AM
Agreed

Gunnar Morling April 19, 2016 at 9:04 AM
Good you filed this, wanted to talk to you about it, too
Apart from detecting the issue and failing fast (+1 for that), my question rather is how we can support it, as the use case is legit. Sub-documents come to mind, I hope we can address this soon-ish (6, or maybe even 5.7?).
Out of Date
Details
Details
Assignee

Reporter

Components
Priority
Created April 18, 2016 at 8:24 PM
Updated January 27, 2020 at 9:01 AM
Resolved January 27, 2020 at 9:01 AM
It appears that a mapping following this structure:
root entity -> oneToMany -> Spatial fields
will attempt to index the spatial coordinates multiple times for the same field name.
Since Spatial now uses DocValues, this is an invalid mapping.
The mapping has always been invalid as the pairs of coordinates would have been indexed in a mixed bag - so impossible to pair up a latitude with its related longitude - yet we didn't throw an exception at runtime when these were not DocValues.
We should detect an illegal cardinality for DocValue fields at boot time, and fail fast.
See also https://forum.hibernate.org/viewtopic.php?f=9&t=1043185