如何根据 NHibernate 搜索中的一些属性禁用某些实体?
我对 NHibernate.Search 还很陌生,所以如果这是一个愚蠢的问题,请耐心等待:)
比如说,我已经索引了一些 BlogPost 类型的实体,它有一个名为 IsDeleted 的属性。如果 IsDeleted 设置为 true,我不希望我的查询显示此特定博客文章。
这可能吗?如果是的话——如何? :P
提前致谢 - 华普
Im still pretty new to NHibernate.Search so please bear with me if this is stupid question :)
Say, I have indexed some entities of type BlogPost, which has a property called IsDeleted. If IsDeleted is set to true, I don't want my queries to show this particular blogpost.
Is this possible? And if it is - How? :P
Thanks in advance
- cwap
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我自己找到了解决方案。我将 [Field(Index.Tokenized, Store = Store.Yes)] 属性添加到 IsDeleted 属性,并将此子句添加到任何入站查询:
我知道这很简单:)
Found the solution myself. I added the [Field(Index.Tokenized, Store = Store.Yes)]-attribute to the IsDeleted property, and added this clause to any query inbound:
I knew it was something simple :)