IndexedEmbedded 不更新关系的另一方?
我有一对多,比如说公司对员工。我尝试在员工的公司引用上使用 [IndexEmbedded],因此我可以执行类似于“Company.Name:IBM”的员工查询。插入员工时,效果很好。但是,如果我更新 Company 实例,员工端的 lucene 索引不会更新。如果我在同一事务中以其他方式更新员工,Lucene 索引确实会更新。
我根据 这个问题,但索引仍然没有更新。这是我的相关配置:
c.SetListener(ListenerType.PostUpdate, new FullTextIndexEventListener());
c.SetListener(ListenerType.PostInsert, new FullTextIndexEventListener());
c.SetListener(ListenerType.PostDelete, new FullTextIndexEventListener());
c.SetListener(ListenerType.PostCollectionUpdate, new FullTextIndexCollectionEventListener());
c.SetListener(ListenerType.PostCollectionRecreate, new FullTextIndexCollectionEventListener());
c.SetListener(ListenerType.PostCollectionRemove, new FullTextIndexCollectionEventListener());
非常感谢任何建议。
I have a one to many, let's say company-to-employees. I am trying to use [IndexEmbedded] on Employee's Company reference, so I can perform a employee query similar to: "Company.Name:IBM". When inserting the employee, this works fine. However, if I update the Company instance, the lucene index on the employee side does not get updated. The Lucene index does get updated if I update the employee in some other way in the same transaction.
I updated my NHibernate Search based on the advice from this question, but the index still does not get updated. Here's my relevant configuration:
c.SetListener(ListenerType.PostUpdate, new FullTextIndexEventListener());
c.SetListener(ListenerType.PostInsert, new FullTextIndexEventListener());
c.SetListener(ListenerType.PostDelete, new FullTextIndexEventListener());
c.SetListener(ListenerType.PostCollectionUpdate, new FullTextIndexCollectionEventListener());
c.SetListener(ListenerType.PostCollectionRecreate, new FullTextIndexCollectionEventListener());
c.SetListener(ListenerType.PostCollectionRemove, new FullTextIndexCollectionEventListener());
Any advice much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论