开发者

Using an "AND" query with Lucene

开发者 https://www.devze.com 2023-02-19 07:58 出处:网络
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...wond

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...


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...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号