【发布时间】:2012-05-15 19:06:17
【问题描述】:
显然,数据库中的更改不会始终反映索引中的内容。是否有人将 EF 与 Lucene 结合使用,并将 Lucene 搜索的结果与 EF 中的相同搜索结果相结合?我知道您只想从 EF 中提取不在 Lucene 结果中的结果。
更新:
我想处理这个问题的最好方法是首先搜索 Lucene 索引并获取结果列表,然后你会为 EF 进行这样的搜索:
伪代码:
var result = (from ef in EntityFrameworkList
where !(from l in LuceneList
select l.documentId)
.Contains(ef.Id)
select ef);
LuceneList.AddRange(result);
对于喜欢方法链的人
var result = (EntityFrameworkList.Where(ef => !(LuceneList.Select(l => l.documentId))
.Contains(ef.Id)));
【问题讨论】:
标签: entity-framework lucene lucene.net