使用“AND”使用 Lucene 进行查询
我对 Lucene.net (2.9.4) 非常陌生,我正在尝试使用 MultiFieldQueryParser 进行搜索。我没有得到预期的结果。我搜索了无济于事的答案...不知道是否有人可以提供帮助...
获取已编入索引的项目的以下记录(字符串):
- 医疗咨询委员会简介
- 医疗咨询委员会
- 演示文稿 - 演讲者简介
当我搜索时: 咨询,我希望得到 1 & 2回来,我就是这么做的。 当我搜索 advisory AND bios 时,我希望只得到 1 个结果,但它似乎将 AND 视为 or ,并且我得到了所有三个结果......
我错过了什么关于与?文档似乎说你可以直接开箱即用地完成此操作。感谢您的帮助...
I'm very new to Lucene.net (2.9.4), and I'm attempting to search using a MultiFieldQueryParser. I'm not getting the results back I expect. I've searched for answers to no avail...wonder if someone can assist...
Take the following records (strings) of items that have been indexed:
- Medical Advisory Board Bios
- Medical Advisory Board
- A presentation - Speaker Bios
When I search for:
advisory, I'd expect to get 1 & 2 back, which I do.
When I search for advisory AND bios, I'd expect to get just 1 back, but it seems to be treating the AND as an or and I get all three results back...
What am I missing about the AND? The docs seem to say you can do this straight-forward out of the box. Thanks for the help...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
昨天花了几个小时之后,我又试了一次,结果成功了。似乎布尔运算符需要大写字母,我非常肯定我正在测试它,但是,我一定不是。希望这对其他人有帮助......
After spending hours on this yesterday, I just tried it again, and it worked. Seems as if it requires capital letters for boolean operators, which I'm quite positive I was testing with, but, I must not have been. Hope this helps seomeone else...