
不过关于 Lucene 这个东东的研究与褒奖已经有好多好多,所以偶决定先写点实用的,以方便人民大众。
—— 用 DotLucene 做项目不能不 De 的 Bugs 大集合:
(以 DotLucene 1.9 RC1 Build 002 alpha 为准,目前发现 Bug 三大条)
第一条:

位置:Document\DateField.cs 75 行 | 120行
重要度:0.1
描述:其实不能算 Bug …… 因为注释里已经写得明明白白:查询日期不能早于1970-1-1

原因:想破头也没有想明白为什么,难道是因为36岁以后还在当程序员的人太少。。。

解决方案:把上述位置 1970 改成 1900 or so . KO.
第二条:

位置:Document\DateField.cs 52 行
重要度:0.2
描述:
此前的版本都可以正常工作,因为使用的是自定义的 "itoa" 方法。(SupportClass.Number.MAX_RADIX = = 36)

1000L * 365 * 24 * 60 * 60 * 1000, SupportClass.Number.MAX_RADIX ).Length;

最新版本居然改成了这样:

System.Convert.ToString( 1000L * 365 * 24 * 60 * 60 * 1000, 36 ).Length;

而以上方法并不接受 2,8,10,16 以外的基数,所以只要创建了 DateField 类的实例就会抛出异常。
原因:也许创建这个版本的家伙当天睡眠不太充足……
解决方案:改回原来版本的实现。
第三条:

位置:Index\SegementTermVector.cs 83 行
重要度:1000
描述与原因:
SegementTermVector.IndexOf 方法通过 Term 的 Text 进行二分查找得到该 Term 的 Index,从而在TermPositionVector 等数组中获取相应的数据(例如需要确定 Term 在数据源中的出现顺序时就会用到)。然而地球人都知道应用二分查找的前提是数组有序,上述位置中数组 terms 的顺序是倒排索引中 Term 的顺序,也就是String.CompareOrdinal 方法的顺序,而 Array.BinarySearch(Array,object) 方法使用的是 String.Compare 方法来进行比较

解决方案:实现使用 String.CompareOrdinal 方法进行比较的 IComparer ,并使用带有 IComparer 参数的 Array.BinarySearch 方法重载版本进行查找。
注:Search.QueryTermVector 中不存在此问题,因为在 Search\QueryTermVector.cs 78 行 terms 已经事先使用 Array.Sort 方法排序,此顺序与 String.Compare 方法一致。
原文地址:http://www.cnblogs.com/leaphy/archive/2006/02/22/335122.html