Hello,
i have 2 classes ObjectA and ObjectB.
@Entity
@Indexed(index = "idx_objectA")
@Table(name = "objectA")
public class ObjectA {
.
.
.
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "objectBid", referencedColumnName = "id")
private ObjectB objectB;
}
@Entity
@Indexed(index = "idx_objectB")
@Table(name = "objectB")
public class ObjectB {
.
.
.
@OneToOne(mappedBy = "objectB")
private ObjectA objectA;
}
Both of them i dont use @IndexedEmbedded
For mass indexer i use the below
final MassIndexer indexer = searchSession.massIndexer(ObjectA.class/*or ObjectB.class*/)
.purgeAllOnStart(true)
.mergeSegmentsAfterPurge(true)
.batchSizeToLoadObjects(100)
.threadsToLoadObjects(12)
.typesToIndexInParallel(1)
.idFetchSize(250);
indexer.startAndWait();
i have almost 2M records on my database both ObjectA and ObjectB.
In the debug mode during the massindexer i get the below sql too many times but I can’t understand why, since I don’t use the @IndexedEmbedded. Without @IndexedEmbedded, expecting it to be skipped.
DEBUG- 2023-07-24 15:01:03.228 28780-[ity loading - 7] o.h.SQL select objectA.id from objectA where objectA.objectB.id = ?
DEBUG- 2023-07-24 15:01:03.231 28780-[ity loading - 9] o.h.SQL select objectB.id from objectB where objectB.id = ?