【发布时间】:2013-03-18 01:13:18
【问题描述】:
我有一个列出运动和用户的数据库,并有一个连接表 (UserSports):
Sports Table:
ID Name
1 Running
2 Swimming
3 Football
4 Baseball
5 Basketball
Users Table:
ID Name
1 George
2 Jane
3 Alex
UsersSports
UserID SportID
1 2
3 1
2 4
2 5
我想使用 lucene.net 搜索运动,因此我为它们创建了一个索引并分析了名称。这很好用。当我搜索“球”时,我得到了足球、棒球、篮球。我想要做的是,对于特定用户,只返回他们在 UserSports 中没有记录的运动。因此,如果 Jane 搜索“ball”,它应该只返回 Football。我可以使用not in 或left join ... where join is null 在SQL 中执行此操作,效果很好,但我想添加模糊逻辑搜索Lucene.net 给出的。
在 Lucene.Net 中索引我的数据的最佳方法是什么?
【问题讨论】:
标签: c# lucene.net