Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
None
Description
At index time term vectors are sorted using String.CompareOrdinal. However method IndexOf of class SegmentTermVector invokes System.Array.BinarySearch, which is using String.Compare.
public virtual int IndexOf(System.String termText) { if (terms == null) return - 1; int res = System.Array.BinarySearch(terms, termText); return res >= 0 ? res : - 1; }
The effect is that the IndexOf method always returns a negative number (no match) because the sort order is incompatible with the default comparer.