Lucene'加入'怎么样?

时间:2010-02-19 09:21:17

标签: lucene.net nhibernate.search

目前使用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中的所有foos?

2 个答案:

答案 0 :(得分:1)

如果要将相关信息包含在foo索引中,可以查看IndexedEmbeddedAttribute。这将允许您查询关系,例如条形对象上是否有Name属性,您可以创建查询,例如

IFullTextQuery query = search.CreateFullTextQuery("bar.Name:Arnis");
query.List<foo>();

答案 1 :(得分:0)

相关问题