BUG: Lucene.Net.Search.ConstantScoreQuery.ConstantWeight: Fixed initialization issue with commented code in GetValueForNormalization() (that diverged from Lucene)
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/484f2683 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/484f2683 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/484f2683 Branch: refs/heads/master Commit: 484f2683468fc018580449f20c1307b4964f95d0 Parents: 06e1a90 Author: Shad Storhaug <[email protected]> Authored: Thu Jun 22 00:54:25 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Thu Jun 22 00:54:25 2017 +0700 ---------------------------------------------------------------------- src/Lucene.Net/Search/ConstantScoreQuery.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/484f2683/src/Lucene.Net/Search/ConstantScoreQuery.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net/Search/ConstantScoreQuery.cs b/src/Lucene.Net/Search/ConstantScoreQuery.cs index 254d267..88a36b8 100644 --- a/src/Lucene.Net/Search/ConstantScoreQuery.cs +++ b/src/Lucene.Net/Search/ConstantScoreQuery.cs @@ -162,10 +162,10 @@ namespace Lucene.Net.Search public override float GetValueForNormalization() { // we calculate sumOfSquaredWeights of the inner weight, but ignore it (just to initialize everything) - /*if (InnerWeight != null) // LUCENENET TODO: BUG This code was in the original + if (innerWeight != null) { - return innerWeight.GetValueForNormalization(); - }*/ + innerWeight.GetValueForNormalization(); + } queryWeight = outerInstance.Boost; return queryWeight * queryWeight; }
