Hello everyone,
Suppose I have two @Entity to index. So I annotated each one with @Indexed. Here the code :
@Entity
@Indexed
public class MentionMicen {
private Acte acte;
@IndexedEmbedded(includePaths = {
Acte_.ID,
Acte_.DOSSIER + "." + Dossier_.ID,
Acte_.TYPE_ACTE + "." + TypeActe_.LIBELLE,
Acte_.LIBELLE,
Acte_.DOSSIER + "." + Dossier_.LIBELLE,
Acte_.DOSSIER + "." + Dossier_.NUMERO,
Acte_.DOSSIER + "." + Dossier_.TYPE + "." + TypeDossier_.GENRE
})
public Acte getActe() {
return acte;
}
}
and I have the other entity :
@Entity
@Indexed
public class ActePrive extends Acte {
}
public class Acte {
private Dossier dossier;
@IndexedEmbedded(includePaths = {
Dossier_.ID,
Dossier_.NUMERO,
Dossier_.CLERC + "." + Clerc_.ID,
Dossier_.SECRETAIRE + "." + Secretaire_.ID,
Dossier_.NOTAIRE + "." + Notaire_.ID
})
public Dossier getDossier() {
return this.dossier;
}
}
The mass indexer will fail with the code above. Because the path specified on MentionMicen.getActe()
:
Acte_.DOSSIER + "." + Dossier_.LIBELLE,
Acte_.DOSSIER + "." + Dossier_.TYPE + "." + TypeDossier_.GENRE
is not existing. To correct the problem I simply add this path to Acte.getDossier() :
public class Acte {
private Dossier dossier;
@IndexedEmbedded(includePaths = {
Dossier_.ID,
Dossier_.NUMERO,
Dossier_.LIBELLE,
Dossier_.TYPE + "." + TypeDossier_.GENRE,
Dossier_.CLERC + "." + Clerc_.ID,
Dossier_.SECRETAIRE + "." + Secretaire_.ID,
Dossier_.NOTAIRE + "." + Notaire_.ID
})
public Dossier getDossier() {
return this.dossier;
}
}
The problem is that now, the indexed entity ActePrive
includes data index in each document I don’t care ; the two one I have to add so to correct the mass indexer problem.
How can I prevent to index extra data in ActePrive documents which I don’t care ?
I attempt to annotate my indexed entities as close as possible to real Json created indexes (through
@IndexEmbedded)
Thx.