Using an "AND" query with Lucene
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...
精彩评论