Lucene‘加入’怎么做?
目前使用 Nhibernate.Search。
一些上下文代码:
[Indexed]
class foo {
[DocumentId]
int id {get;set;}
bar bar {get;set;}
}
[Indexed]
class bar {
[DocumentId]
int id {get;set;}
}
问题:
如何使用 IFullTextQuery 检索 foo.bar.id==1 处的所有 foo?
Using Nhibernate.Search at the moment.
Some code for context:
[Indexed]
class foo {
[DocumentId]
int id {get;set;}
bar bar {get;set;}
}
[Indexed]
class bar {
[DocumentId]
int id {get;set;}
}
Question:
How to retrieve all foos where foo.bar.id==1 using IFullTextQuery?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您想将相关信息包含到 foo 索引中,您可以查看 IndexedEmbeddedAttribute。这将允许您查询关系,例如,如果栏对象上有 Name 属性,您可以创建如下查询
If you want to include related information into the foo index you may look into the IndexedEmbeddedAttribute. This will allow you to query for relationships such as if there was a Name property on the bar object you could create a query such as this
似乎
[IndexedAttribute] 是一个答案。
Seems that
[IndexedAttribute]
is an answer.