diff --git a/src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs b/src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs index d571c773d4..d4987954fe 100644 --- a/src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs +++ b/src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs @@ -126,7 +126,7 @@ public virtual ITopGroups GetTopGroups(int withinGroupOffset) GroupDocs[] groupDocsResult = new GroupDocs[groups.Count()]; int groupIDX = 0; - float maxScore = float.MinValue; + float maxScore = float.Epsilon; // LUCENENET: Epsilon in .NET is the same as MIN_VALUE in Java foreach (var group in groups) { AbstractSecondPassGroupingCollector.SearchGroupDocs groupDocs = m_groupMap[group.GroupValue]; diff --git a/src/Lucene.Net.Grouping/BlockGroupingCollector.cs b/src/Lucene.Net.Grouping/BlockGroupingCollector.cs index 12bbdf6154..93c907d878 100644 --- a/src/Lucene.Net.Grouping/BlockGroupingCollector.cs +++ b/src/Lucene.Net.Grouping/BlockGroupingCollector.cs @@ -394,7 +394,7 @@ public virtual ITopGroups GetTopGroups(Sort withinGrou FakeScorer fakeScorer = new FakeScorer(); - float maxScore = float.MinValue; + float maxScore = float.Epsilon; // LUCENENET: Epsilon in .NET is the same as MIN_VALUE in Java GroupDocs[] groups = new GroupDocs[groupQueue.Count - groupOffset]; for (int downTo = groupQueue.Count - groupOffset - 1; downTo >= 0; downTo--) diff --git a/src/Lucene.Net.Grouping/TopGroups.cs b/src/Lucene.Net.Grouping/TopGroups.cs index ff2c592716..2a49669cf5 100644 --- a/src/Lucene.Net.Grouping/TopGroups.cs +++ b/src/Lucene.Net.Grouping/TopGroups.cs @@ -173,13 +173,13 @@ public static TopGroups Merge(ITopGroups[] shardGroups, Sort groupSort, var mergedGroupDocs = new GroupDocs[numGroups]; TopDocs[] shardTopDocs = new TopDocs[shardGroups.Length]; - float totalMaxScore = float.MinValue; + float totalMaxScore = float.Epsilon; // LUCENENET: Epsilon in .NET is the same as MIN_VALUE in Java for (int groupIDX = 0; groupIDX < numGroups; groupIDX++) { T groupValue = shardGroups[0].Groups[groupIDX].GroupValue; //System.out.println(" merge groupValue=" + groupValue + " sortValues=" + Arrays.toString(shardGroups[0].groups[groupIDX].groupSortValues)); - float maxScore = float.MinValue; + float maxScore = float.Epsilon; // LUCENENET: Epsilon in .NET is the same as MIN_VALUE in Java int totalHits = 0; double scoreSum = 0.0; for (int shardIdx = 0; shardIdx < shardGroups.Length; shardIdx++) diff --git a/src/Lucene.Net.Join/Support/ToParentBlockJoinCollector.cs b/src/Lucene.Net.Join/Support/ToParentBlockJoinCollector.cs index 0b70aeb46f..1551d6ce54 100644 --- a/src/Lucene.Net.Join/Support/ToParentBlockJoinCollector.cs +++ b/src/Lucene.Net.Join/Support/ToParentBlockJoinCollector.cs @@ -115,7 +115,7 @@ public ToParentBlockJoinCollector(Sort sort, int numParentHits, bool trackScores this.trackMaxScore = trackMaxScore; if (trackMaxScore) { - maxScore = float.MinValue; + maxScore = float.Epsilon; // LUCENENET: Epsilon in .NET is the same as MIN_VALUE in Java } //System.out.println("numParentHits=" + numParentHits); this.trackScores = trackScores; diff --git a/src/Lucene.Net.Join/ToParentBlockJoinCollector.cs b/src/Lucene.Net.Join/ToParentBlockJoinCollector.cs index d5002c21fe..6f89ad9c10 100644 --- a/src/Lucene.Net.Join/ToParentBlockJoinCollector.cs +++ b/src/Lucene.Net.Join/ToParentBlockJoinCollector.cs @@ -113,7 +113,7 @@ public ToParentBlockJoinCollector(Sort sort, int numParentHits, bool trackScores this.trackMaxScore = trackMaxScore; if (trackMaxScore) { - maxScore = float.MinValue; + maxScore = float.Epsilon; // LUCENENET: Epsilon in .NET is the same as MIN_VALUE in Java } //System.out.println("numParentHits=" + numParentHits); this.trackScores = trackScores; diff --git a/src/Lucene.Net.Tests.TestFramework/Codecs/Compressing/TestCompressingStoredFieldsFormat.cs b/src/Lucene.Net.Tests.TestFramework/Codecs/Compressing/TestCompressingStoredFieldsFormat.cs index 2fbdc22837..765ef22b9e 100644 --- a/src/Lucene.Net.Tests.TestFramework/Codecs/Compressing/TestCompressingStoredFieldsFormat.cs +++ b/src/Lucene.Net.Tests.TestFramework/Codecs/Compressing/TestCompressingStoredFieldsFormat.cs @@ -122,7 +122,7 @@ // +0.0f, // float.NegativeInfinity, // float.PositiveInfinity, -// float.MinValue, +// float.Epsilon, // LUCENENET: Epsilon in .NET is the same as MIN_VALUE in Java // float.MaxValue, // float.NaN, // }; @@ -180,11 +180,11 @@ // double[] special = { // -0.0d, // +0.0d, -// Double.NegativeInfinity, -// Double.PositiveInfinity, -// Double.MinValue, -// Double.MaxValue, -// Double.NaN +// double.NegativeInfinity, +// double.PositiveInfinity, +// double.Epsilon, // LUCENENET: Epsilon in .NET is the same as MIN_VALUE in Java +// double.MaxValue, +// double.NaN // }; // foreach (double x in special) diff --git a/src/Lucene.Net/Search/TopDocs.cs b/src/Lucene.Net/Search/TopDocs.cs index c9e99375f9..c142bad448 100644 --- a/src/Lucene.Net/Search/TopDocs.cs +++ b/src/Lucene.Net/Search/TopDocs.cs @@ -1,4 +1,4 @@ -using Lucene.Net.Diagnostics; +using Lucene.Net.Diagnostics; using Lucene.Net.Support; using System; using System.Diagnostics.CodeAnalysis; @@ -271,7 +271,7 @@ public static TopDocs Merge(Sort sort, int start, int size, TopDocs[] shardHits) int totalHitCount = 0; int availHitCount = 0; - float maxScore = float.MinValue; + float maxScore = float.Epsilon; // LUCENENET: Epsilon in .NET is the same as MIN_VALUE in Java for (int shardIDX = 0; shardIDX < shardHits.Length; shardIDX++) { TopDocs shard = shardHits[shardIDX];