Env : JBoss 7.1.3, JEE6 Application, Hibernate Search 4.3.0.Final
Hello,
I have problem with the mass indexer. I have got a 1->N relation (with a backward ref on the N side). When I enable that relation to be indexed, my Server runs into memory problems.
My Indexer strategy:
[code] public void reindexData(Class<?> clazz, final FullTextEntityManager ftEm, final Logger logger) { ftEm.createIndexer(clazz) .batchSizeToLoadObjects(1000) .threadsToLoadObjects(5) .threadsForSubsequentFetching(3) .idFetchSize(1000) .progressMonitor(new MassIndexerProgressMonitor() { ..... }) .start(); } [/code]
My entity bean is :
[code] @Entity .... @Indexed public class VersichertePerson extends MPEntity implements Historisierbar {
...
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @DocumentId private Long id; @ManyToOne @OmitHistory @IndexedEmbedded(depth = 1, prefix = "") private Auftraggeber auftraggeber; @Field(analyze = Analyze.YES, store = Store.YES, name = "nachname") private String nachname;
@Field(analyze = Analyze.YES, store = Store.YES, name = "nachnameCode") private String codeNachname; @Field(analyze = Analyze.YES, store = Store.YES, name = "vorname") private String vorname;
@Field(analyze = Analyze.YES, store = Store.YES, name = "vornameCode") private String codeVorname;
@OneToMany(targetEntity = Auftrag.class, mappedBy = "versichertePerson") @IndexedEmbedded(depth = 1) private List<Auftrag> auftraege;
.... [/code]
The Auftrag class only delivers a transient attribute to be indexed:
[code] public abstract class Auftrag extends MPEntity implements Historisierbar, Comparable<Auftrag> { ... @Transient @Field(analyze = Analyze.YES, store = Store.YES, name = "isAuftragOffen") public boolean isAuftragOffen() { switch (getBearbeitungsstatus()) { case ...: return true; default: return false; } } [/code]
After indexing, I find 1GB of loitering objects in the class ProducerConsumerQueue (Hibernate Search internal).
When I disable the @IndexEmebedded on List<Auftrag> I don't have the problem.
Is there a common way to deal with such problem? I need that attribute in my index.
Or is there a way to flush the index?
|