public abstract Compare ( int slot1, int slot2 ) : int | ||
slot1 | int | first slot to compare /// |
slot2 | int | second slot to compare /// |
return | int |
/// <summary> Returns whether <c>a</c> is less relevant than <c>b</c>.</summary> /// <param name="a">ScoreDoc /// </param> /// <param name="b">ScoreDoc /// </param> /// <returns> <c>true</c> if document <c>a</c> should be sorted after document <c>b</c>. /// </returns> public override bool LessThan(Entry hitA, Entry hitB) { System.Diagnostics.Debug.Assert(hitA != hitB); System.Diagnostics.Debug.Assert(hitA.slot != hitB.slot); int c = oneReverseMul * comparator.Compare(hitA.slot, hitB.slot); if (c != 0) { return(c > 0); } // avoid random sort order that could lead to duplicates (bug #31241): return(hitA.Doc > hitB.Doc); }
/// <summary> Returns whether <code>a</code> is less relevant than <code>b</code>.</summary> /// <param name="a">ScoreDoc /// </param> /// <param name="b">ScoreDoc /// </param> /// <returns> <code>true</code> if document <code>a</code> should be sorted after document <code>b</code>. /// </returns> public override bool LessThan(System.Object a, System.Object b) { Entry hitA = (Entry)a; Entry hitB = (Entry)b; System.Diagnostics.Debug.Assert(hitA != hitB); System.Diagnostics.Debug.Assert(hitA.slot != hitB.slot); int c = oneReverseMul * comparator.Compare(hitA.slot, hitB.slot); if (c != 0) { return(c > 0); } // avoid random sort order that could lead to duplicates (bug #31241): return(hitA.docID > hitB.docID); }