I m not able to autosync the database changes with the index in some situations. Following is the scenario.
Code:
@Indexed(index="case")
public class HdCaseMst {
@DocumentId
private long srNo;
@IndexedEmbedded(prefix="person_")
private CmnPersonMst cmnPersonMst;
@Field(index=Index.TOKENIZED, store=Store.NO)
private String cangenReason;
.............
}
public class CmnPersonMst {
..........
@Field(index=Index.TOKENIZED, store=Store.NO)
private String firstName;
............
}
Here, CmnPersonMst is not indexed, but embedded in HdCaseMst. only it's field firstName is indexed.
Now, when the field "cangenReason" of HdCaseMst is updated, the corresponding index is also updated.
Also, using the following code, index is updated.
Code:
caseMst.getCmnPersonMst().setFirstName("Miss kiran");
session.update(caseAccMst);
but, when i try to update only CmnPersonMst individually as follows,
Code:
personMst.setFirstName("viral test");
session.update(personMst);
corresponding index is not updated.
is there any way to do the same? please note i don't want to make seperate index folder for CmnPersonMst.