It is also an issue for Elasticsearch as we end up with creating the wrong field in the schema: we don't take into account the information added in the MetadataProvidingFieldBridge and we suppose the information on the original field is the one we should take into account. This is in relation with the idea we discussed in London to separate completely:
- the metadata used to build the indexed document
- the metadata of the structure of the indexed document
This would also allow to simplify a lot the schema generation of Elasticsearch as we could generate the Es schema directly from the structure of the indexed document instead of iteration through the fields, the field bridges, the class bridges and so on. This is in fact blocking https://hibernate.atlassian.net/browse/HSEARCH-2261 as a test fails due to this issue if we remove the check which should be useless in the Es case. |