NHibernate.Search ContainedIn 属性有什么作用?
它与 IndexedEmbedded 有什么不同?
Ps,有关 NHibernate.Search 的最佳信息来源是什么?
And how it differs from IndexedEmbedded?
P.s. and what's the best source of information about NHibernate.Search?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ContainedInAttribute 与 IndexedEmbeddedAttribute 结合使用。 ContainedInAttribute 用作一种标记,指向使用 IndexedEmbeddedAttribute 的类。这告诉 NHibernate.Search 当您更新该类时,您想要更新父级的全文索引。当您更新拥有类的子级并且希望所有者的索引也更新时,这非常有用。
下面是如何使用它的示例。
注意:如果您指向不使用 IndexEmbeded 属性的所属父级,则 ContainedIn 属性是无用的。
文档信息来自 hibernate 搜索,但这里的大多数内容也适用于 NHibernate.Search。
http://docs.jboss.org/hibernate/stable/search /reference/en/html/
或
http:// /docs.jboss.org/hibernate/stable/search/reference/en/html_single/
The ContainedInAttribute is used in conjunction with the IndexedEmbeddedAttribute. The ContainedInAttribute is used as a sort of marker, that points back to a class that uses and IndexedEmbeddedAttribute. This tells NHibernate.Search that when you update that class, you want to update the parent's full text index. This is good when you update a child of a owning class and you want the owner's index also updated.
below is an example of how to use this.
Note: The ContainedIn attribute is useless if you are pointing to an owning parent that is not using an IndexEmbeded attribute.
Documentation Information is from hibernate search, but most things here apply to NHibernate.Search as well.
http://docs.jboss.org/hibernate/stable/search/reference/en/html/
or
http://docs.jboss.org/hibernate/stable/search/reference/en/html_single/