Lucene.Net 搜索关键字 "The" 失败

Lucene.Net fails to search keyword "The"

我正在使用 Lucene.Net(Lucene 3.0.3 版)。在搜索关键字 "The" 时, 当有大量记录匹配该关键字时,它给出的结果少于 5 个。 它适用于所有其他关键字。

lucene对'The'有什么问题吗??? :-)

如评论中所述,您的问题出在您使用的分析器上。

StandardAnalyzer 做各种与语法有关的事情,但也删除了一组默认的英语 stop-words(a、and、or、then 等)"the" 就是其中之一。

你可以像

一样创建它
  var a  new StandardAnalyzer(version, new HashSet<string>());

给它一个空的哈希集表示 "there are no stop words"