Greetings,
We have a problem were our @IndexEmbedded collections are indexed when the object is saved or updated, but if we use the Mass Indexer to index, then they are not.
We have a Page object, which has a collection of PageModerators, this object basically links the Page with an Account. Is there anything about this structure that would prevent it from being re-indexed? Or is it how we use the MassIndexer?
Any insights appreciated
Code:
@Entity @Table(name="page") @Indexed
public class Page
{
@Id @GeneratedValue(strategy = GenerationType.AUTO) @DocumentId
private int id;
@OneToMany(cascade = { CascadeType.ALL }, orphanRemoval = true, fetch = FetchType.EAGER, mappedBy = "page")
@IndexedEmbedded
private Set<PageModerator> acl;
}
@Entity @Table(name="page_acl") @Indexed
public class PageModerator extends Moderator
{
@ManyToOne( cascade = {} ) @JoinColumn(name="page_page_fk")
@IndexedEmbedded(includePaths = { "id" })
private Page page;
@ManyToOne( cascade = {} ) @JoinColumn(name="page_account_fk")
@IndexedEmbedded(includePaths = { "id" })
private Account account;
}
FullTextSession fts = Search.getFullTextSession(sessionFactory.getCurrentSession());
SimpleIndexingProgressMonitor monitor = new SimpleIndexingProgressMonitor();
MassIndexer indexer = fts.createIndexer(Page.class)
.batchSizeToLoadObjects(100).threadsForSubsequentFetching(8)
.threadsToLoadObjects(4).threadsForSubsequentFetching(8)
.threadsToLoadObjects(8).cacheMode(CacheMode.NORMAL);
try {
ReflectionUtils.setFieldValue(MassIndexerImpl.class, "monitor", indexer, monitor);
indexer.startAndWait();
}
catch ....