Hi,
Im doing with the Hibernate search not able to index properly, i don no wht could b the porblem, pls any body could go through it and tell me what could b the prob.
@Entity
@Indexed
class EventDb{
@IndexedEmbedded(prefix="EvtSessionInfo_", depth=2)
private List<EvtSessionInfo> evtSessionInfos = new ArrayList<EvtSessionInfo>(0);
}
@Entity
@Indexed
class EvtSessionInfo{
@IndexedEmbedded(prefix="hallMeetingRoom_", depth =1)
private HallMeetingRoom hallMeetingRoom;
@NaturalId
@ContainedIn
private EventDb eventDb;
}
@Entity
@Indexed
class HallMeetingRoom{
@Field(index=Index.TOKENIZED, store=Store.NO)
private String hallMeetingRoomName;
}
Im making the index of EventDb like this
Code:
try {
Session session = null;
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
session =sessionFactory.openSession();
FullTextSession fullTextSession = Search.createFullTextSession(session);
List<EventDb> eventDbTx = session.createQuery("from EventDb").list();
for(EventDb eventDbTx1 : eventDbTx){
System.out.println("Inside Creating Index........");
fullTextSession.index(eventDbTx1);
}
session.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
In the above index EventSessionInfo has the bidirectional approach to EventDb and HallMeetingRoom doesn't have a bidirectional approach to EventSessionInfo. I don no whether this is making any problem or depth is making prob, i feel depth is proper.
When i open the EventDb index im able to eventSessionInfo and not the HallMeetingRoom info.
Any other proper way to handle this.
Could anyone come up on this, to solve my issue.
Thanks,
Ambika☺