Fixed
Details
Assignee
Yoann RodièreYoann RodièreReporter
Yoann RodièreYoann RodièreComponents
Sprint
NoneFix versions
Affects versions
Priority
Major
Details
Details
Assignee
Yoann Rodière
Yoann RodièreReporter
Yoann Rodière
Yoann RodièreComponents
Sprint
None
Fix versions
Affects versions
Priority
Created September 7, 2020 at 3:38 PM
Updated October 8, 2020 at 12:30 PM
Resolved September 23, 2020 at 1:56 PM
Relevant Search 5 test:
org.hibernate.search.test.batchindexing.IndexingGeneratedCorpusTest
It seems the method
org.hibernate.search.mapper.orm.massindexing.impl.IdentifierConsumerDocumentProducer#index
passes the root type toindexer.add
. This will only work properly if the root type has no subtype; otherwise, this will result in instances of a subtype being treated as the root type: if the root type is not indexed, it will fail; if both the root type and the subtype are indexed, but the subtype defines additional fields, those will be ignored.This should be fixed by detecting the type with
org.hibernate.search.mapper.pojo.model.spi.PojoRuntimeIntrospector#detectEntityType
, at least when the root entity type has entity subtypes. If the type is not indexed, this should be detected and the entity should be ignored.Ideally, the query generating the IDs to reindex should also exclude IDs of instances of subtypes that are not indexed, but I'm not sure that's possible?