You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2021/02/22 04:55:18 UTC

[lucenenet] branch master updated (7806275 -> d5a5e98)

This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git.


    from 7806275  Merge branch 'docs/markdown-converted/4.8.1' into master
     new e022533  Lucene.Net.Tests.Queries: Use consistent license headers (#259)
     new bbce37e  Lucene.Net.Tests.Queries: Removed unused imports (#259)
     new 05cacbd  BUG: Lucene.Net.Tests.Queries.Function.TestFieldScoreQuery: Added missing [Test] attributes (#259)
     new fc77ea2  SWEEP: MemberwiseClone() doesn't throw exceptions in .NET, so there is no need to place it in a try/catch block. There is also no need to cast the result if we don't need access to its members. (#259)
     new 1e88f7c  Lucene.Net.Index.Term: Added TODO about converting Text() to a property (#259)
     new 58fa97e  BUG: Lucene.Net.Tests.Queries.TermsFilterTest::TestSingleFieldEquals(): Hash code collision provided in Lucene won't necessarily be a collision in .NET. Generate the collision at runtime so the test will pass (the test wouldn't have passed if the assert hadn't been commented). (#259)
     new d5a5e98  Lucene.Net.Queries, Lucene.Net.Tests.Queries: Marked lucene compatibility version 4.8.1 at the top of each file. (#259)

The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/Lucene.Net.Queries/BooleanFilter.cs            |   3 +-
 src/Lucene.Net.Queries/BoostingQuery.cs            |   3 +-
 src/Lucene.Net.Queries/ChainedFilter.cs            |   3 +-
 src/Lucene.Net.Queries/CommonTermsQuery.cs         |   3 +-
 src/Lucene.Net.Queries/CustomScoreProvider.cs      |   3 +-
 src/Lucene.Net.Queries/CustomScoreQuery.cs         |   3 +-
 src/Lucene.Net.Queries/FilterClause.cs             |   3 +-
 src/Lucene.Net.Queries/Function/BoostedQuery.cs    |   3 +-
 .../Function/DocValues/BoolDocValues.cs            |   3 +-
 .../Function/DocValues/DocTermsIndexDocValues.cs   |   3 +-
 .../Function/DocValues/DoubleDocValues.cs          |   3 +-
 .../Function/DocValues/FloatDocValues.cs           |   3 +-
 .../Function/DocValues/IntDocValues.cs             |   3 +-
 .../Function/DocValues/LongDocValues.cs            |   3 +-
 .../Function/DocValues/StrDocValues.cs             |   3 +-
 src/Lucene.Net.Queries/Function/FunctionQuery.cs   |   3 +-
 src/Lucene.Net.Queries/Function/FunctionValues.cs  |   3 +-
 src/Lucene.Net.Queries/Function/ValueSource.cs     |   3 +-
 .../Function/ValueSourceScorer.cs                  |   3 +-
 .../Function/ValueSources/BoolFunction.cs          |   4 +-
 .../Function/ValueSources/ByteFieldSource.cs       |   3 +-
 .../Function/ValueSources/BytesRefFieldSource.cs   |   3 +-
 .../Function/ValueSources/ConstNumberSource.cs     |   4 +-
 .../Function/ValueSources/ConstValueSource.cs      |   3 +-
 .../Function/ValueSources/DefFunction.cs           |   3 +-
 .../Function/ValueSources/DivFloatFunction.cs      |   4 +-
 .../Function/ValueSources/DocFreqValueSource.cs    |   3 +-
 .../ValueSources/DoubleConstValueSource.cs         |   3 +-
 .../Function/ValueSources/DoubleFieldSource.cs     |   3 +-
 .../Function/ValueSources/DualFloatFunction.cs     |   3 +-
 .../Function/ValueSources/EnumFieldSource.cs       |   3 +-
 .../Function/ValueSources/FieldCacheSource.cs      |   3 +-
 .../Function/ValueSources/FloatFieldSource.cs      |   3 +-
 .../Function/ValueSources/IDFValueSource.cs        |   3 +-
 .../Function/ValueSources/IfFunction.cs            |   3 +-
 .../Function/ValueSources/IntFieldSource.cs        |   3 +-
 .../ValueSources/JoinDocFreqValueSource.cs         |   3 +-
 .../Function/ValueSources/LinearFloatFunction.cs   |   3 +-
 .../Function/ValueSources/LiteralValueSource.cs    |   3 +-
 .../Function/ValueSources/LongFieldSource.cs       |   3 +-
 .../Function/ValueSources/MaxDocValueSource.cs     |   3 +-
 .../Function/ValueSources/MaxFloatFunction.cs      |   3 +-
 .../Function/ValueSources/MinFloatFunction.cs      |   3 +-
 .../Function/ValueSources/MultiBoolFunction.cs     |   3 +-
 .../Function/ValueSources/MultiFloatFunction.cs    |   3 +-
 .../Function/ValueSources/MultiFunction.cs         |   3 +-
 .../Function/ValueSources/MultiValueSource.cs      |   4 +-
 .../Function/ValueSources/NormValueSource.cs       |   3 +-
 .../Function/ValueSources/NumDocsValueSource.cs    |   3 +-
 .../Function/ValueSources/OrdFieldSource.cs        |   3 +-
 .../Function/ValueSources/PowFloatFunction.cs      |   3 +-
 .../Function/ValueSources/ProductFloatFunction.cs  |   4 +-
 .../Function/ValueSources/QueryValueSource.cs      |   3 +-
 .../Function/ValueSources/RangeMapFloatFunction.cs |   3 +-
 .../ValueSources/ReciprocalFloatFunction.cs        |   3 +-
 .../Function/ValueSources/ReverseOrdFieldSource.cs |   3 +-
 .../Function/ValueSources/ScaleFloatFunction.cs    |   3 +-
 .../Function/ValueSources/ShortFieldSource.cs      |   3 +-
 .../Function/ValueSources/SimpleBoolFunction.cs    |   3 +-
 .../Function/ValueSources/SimpleFloatFunction.cs   |   3 +-
 .../Function/ValueSources/SingleFunction.cs        |   3 +-
 .../Function/ValueSources/SumFloatFunction.cs      |   4 +-
 .../ValueSources/SumTotalTermFreqValueSource.cs    |   3 +-
 .../Function/ValueSources/TFValueSource.cs         |   3 +-
 .../Function/ValueSources/TermFreqValueSource.cs   |   3 +-
 .../ValueSources/TotalTermFreqValueSource.cs       |   3 +-
 .../Function/ValueSources/VectorValueSource.cs     |   3 +-
 src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs         |   3 +-
 src/Lucene.Net.Queries/Mlt/MoreLikeThisQuery.cs    |   3 +-
 src/Lucene.Net.Queries/TermFilter.cs               |   3 +-
 src/Lucene.Net.Queries/TermsFilter.cs              |   3 +-
 src/Lucene.Net.Tests.Queries/BooleanFilterTest.cs  |  92 ++++++----
 src/Lucene.Net.Tests.Queries/BoostingQueryTest.cs  |  39 ++---
 src/Lucene.Net.Tests.Queries/ChainedFilterTest.cs  |  57 +++---
 .../CommonTermsQueryTest.cs                        | 194 +++++++++++++--------
 .../Function/FunctionTestSetup.cs                  |  77 ++++----
 .../Function/TestBoostedQuery.cs                   |  39 ++---
 .../Function/TestDocValuesFieldSources.cs          |  40 ++---
 .../Function/TestFieldScoreQuery.cs                |  66 +++----
 .../Function/TestFunctionQuerySort.cs              |  44 +++--
 .../Function/TestLongNormValueSource.cs            |  46 +++--
 .../Function/TestOrdValues.cs                      |  47 ++---
 .../Function/TestValueSources.cs                   | 179 ++++++++++++-------
 .../Mlt/TestMoreLikeThis.cs                        |  42 +++--
 src/Lucene.Net.Tests.Queries/TermFilterTest.cs     |  55 +++---
 src/Lucene.Net.Tests.Queries/TermsFilterTest.cs    |  96 +++++++---
 .../TestCustomScoreQuery.cs                        |  68 ++++----
 src/Lucene.Net/Index/Term.cs                       |   4 +-
 src/Lucene.Net/Search/Query.cs                     |  11 +-
 src/Lucene.Net/Util/InfoStream.cs                  |  11 +-
 90 files changed, 818 insertions(+), 608 deletions(-)


[lucenenet] 02/07: Lucene.Net.Tests.Queries: Removed unused imports (#259)

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit bbce37e4711cd55e60fd5d33c92083299cb8ebb6
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Sun Feb 21 23:03:32 2021 +0700

    Lucene.Net.Tests.Queries: Removed unused imports (#259)
---
 src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs | 1 -
 src/Lucene.Net.Tests.Queries/Function/TestLongNormValueSource.cs   | 1 -
 2 files changed, 2 deletions(-)

diff --git a/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs b/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs
index 71cfce7..cf27cbd 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs
@@ -5,7 +5,6 @@ using Lucene.Net.Queries.Function;
 using Lucene.Net.Queries.Function.ValueSources;
 using Lucene.Net.Randomized.Generators;
 using Lucene.Net.Store;
-using Lucene.Net.Support;
 using Lucene.Net.Util;
 using Lucene.Net.Util.Packed;
 using NUnit.Framework;
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestLongNormValueSource.cs b/src/Lucene.Net.Tests.Queries/Function/TestLongNormValueSource.cs
index 01030d2..753d06f 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestLongNormValueSource.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestLongNormValueSource.cs
@@ -7,7 +7,6 @@ using Lucene.Net.Queries.Function.ValueSources;
 using Lucene.Net.Search;
 using Lucene.Net.Search.Similarities;
 using Lucene.Net.Store;
-using Lucene.Net.Support;
 using Lucene.Net.Util;
 using NUnit.Framework;
 using System;


[lucenenet] 03/07: BUG: Lucene.Net.Tests.Queries.Function.TestFieldScoreQuery: Added missing [Test] attributes (#259)

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit 05cacbd5cb3d8ff98887e43798a02ac873bb01d2
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Mon Feb 22 00:19:31 2021 +0700

    BUG: Lucene.Net.Tests.Queries.Function.TestFieldScoreQuery: Added missing [Test] attributes (#259)
---
 .../Function/TestFieldScoreQuery.cs                | 27 +++++++---------------
 1 file changed, 8 insertions(+), 19 deletions(-)

diff --git a/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs b/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs
index 1951dd7..bdb2e6b 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs
@@ -115,10 +115,8 @@ namespace Lucene.Net.Tests.Queries.Function
 
         /// <summary>
         /// Test that FieldScoreQuery of Type.BYTE returns the expected scores. </summary>
-        //JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
-        //ORIGINAL LINE: @Test public void testExactScoreByte() throws Exception
-        //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-        public virtual void testExactScoreByte()
+        [Test]
+        public virtual void TestExactScoreByte()
         {
             // INT field values are small enough to be parsed as byte
             doTestExactScore(BYTE_VALUESOURCE);
@@ -126,10 +124,8 @@ namespace Lucene.Net.Tests.Queries.Function
 
         /// <summary>
         /// Test that FieldScoreQuery of Type.SHORT returns the expected scores. </summary>
-        //JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
-        //ORIGINAL LINE: @Test public void testExactScoreShort() throws Exception
-        //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-        public virtual void testExactScoreShort()
+        [Test]
+        public virtual void TestExactScoreShort()
         {
             // INT field values are small enough to be parsed as short
             doTestExactScore(SHORT_VALUESOURCE);
@@ -137,20 +133,16 @@ namespace Lucene.Net.Tests.Queries.Function
 
         /// <summary>
         /// Test that FieldScoreQuery of Type.INT returns the expected scores. </summary>
-        //JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
-        //ORIGINAL LINE: @Test public void testExactScoreInt() throws Exception
-        //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-        public virtual void testExactScoreInt()
+        [Test]
+        public virtual void TestExactScoreInt()
         {
             doTestExactScore(INT_VALUESOURCE);
         }
 
         /// <summary>
         /// Test that FieldScoreQuery of Type.FLOAT returns the expected scores. </summary>
-        //JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
-        //ORIGINAL LINE: @Test public void testExactScoreFloat() throws Exception
-        //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-        public virtual void testExactScoreFloat()
+        [Test]
+        public virtual void TestExactScoreFloat()
         {
             // INT field can be parsed as float
             doTestExactScore(INT_AS_FLOAT_VALUESOURCE);
@@ -159,8 +151,6 @@ namespace Lucene.Net.Tests.Queries.Function
         }
 
         // Test that FieldScoreQuery returns docs with expected score.
-        //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-        //ORIGINAL LINE: private void doTestExactScore(ValueSource valueSource) throws Exception
         private void doTestExactScore(ValueSource valueSource)
         {
             FunctionQuery functionQuery = new FunctionQuery(valueSource);
@@ -179,6 +169,5 @@ namespace Lucene.Net.Tests.Queries.Function
             }
             r.Dispose();
         }
-
     }
 }


[lucenenet] 06/07: BUG: Lucene.Net.Tests.Queries.TermsFilterTest::TestSingleFieldEquals(): Hash code collision provided in Lucene won't necessarily be a collision in .NET. Generate the collision at runtime so the test will pass (the test wouldn't have passed if the assert hadn't been commented). (#259)

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit 58fa97ebf43cf4fddb2359d471c9bafbeaca8eea
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Mon Feb 22 06:46:47 2021 +0700

    BUG: Lucene.Net.Tests.Queries.TermsFilterTest::TestSingleFieldEquals(): Hash code collision provided in Lucene won't necessarily be a collision in .NET. Generate the collision at runtime so the test will pass (the test wouldn't have passed if the assert hadn't been commented). (#259)
---
 src/Lucene.Net.Tests.Queries/TermsFilterTest.cs | 43 +++++++++++++++++++++++--
 1 file changed, 40 insertions(+), 3 deletions(-)

diff --git a/src/Lucene.Net.Tests.Queries/TermsFilterTest.cs b/src/Lucene.Net.Tests.Queries/TermsFilterTest.cs
index 45b1add..7627f18 100644
--- a/src/Lucene.Net.Tests.Queries/TermsFilterTest.cs
+++ b/src/Lucene.Net.Tests.Queries/TermsFilterTest.cs
@@ -339,13 +339,50 @@ namespace Lucene.Net.Tests.Queries
         [Test]
         public void TestSingleFieldEquals()
         {
-            // Two terms with the same hash code
+            //// Two terms with the same hash code
             //assertEquals("AaAaBB".GetHashCode(), "BBBBBB".GetHashCode());
-            TermsFilter left = TermsFilter(true, new Term("id", "AaAaAa"), new Term("id", "AaAaBB"));
-            TermsFilter right = TermsFilter(true, new Term("id", "AaAaAa"), new Term("id", "BBBBBB"));
+            //TermsFilter left = TermsFilter(true, new Term("id", "AaAaAa"), new Term("id", "AaAaBB"));
+            //TermsFilter right = TermsFilter(true, new Term("id", "AaAaAa"), new Term("id", "BBBBBB"));
+            //assertFalse(left.Equals(right));
+
+            // LUCENENET specific - since in .NET the hash code is dependent on the underlying
+            // target framework, we need to generate a collision at runtime.
+            GenerateHashCollision(out string theString, out string stringWithCollision);
+            assertEquals(theString.GetHashCode(), stringWithCollision.GetHashCode());
+            TermsFilter left = TermsFilter(true, new Term("id", "AaAaAa"), new Term("id", theString));
+            TermsFilter right = TermsFilter(true, new Term("id", "AaAaAa"), new Term("id", stringWithCollision));
             assertFalse(left.Equals(right));
         }
 
+        // LUCENENET specific - since in .NET the hash code is dependent on the underlying
+        // target framework, we need to generate a collision at runtime.
+        // Source: https://stackoverflow.com/a/32027473
+        private static void GenerateHashCollision(out string theString, out string stringWithCollision)
+        {
+            var words = new Dictionary<int, string>();
+
+            int i = 0;
+            string teststring;
+            while (true)
+            {
+                i++;
+                teststring = i.ToString();
+                try
+                {
+                    words.Add(teststring.GetHashCode(), teststring);
+                }
+                catch (Exception)
+                {
+                    break;
+                }
+            }
+
+            var collisionHash = teststring.GetHashCode();
+
+            theString = teststring;
+            stringWithCollision = words[collisionHash];
+        }
+
         [Test]
         public void TestNoTerms()
         {


[lucenenet] 05/07: Lucene.Net.Index.Term: Added TODO about converting Text() to a property (#259)

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit 1e88f7cbe807bac15fb04b55be5c2a2b2535f8a3
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Mon Feb 22 04:27:50 2021 +0700

    Lucene.Net.Index.Term: Added TODO about converting Text() to a property (#259)
---
 src/Lucene.Net/Index/Term.cs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Lucene.Net/Index/Term.cs b/src/Lucene.Net/Index/Term.cs
index 3183474..34bc92c 100644
--- a/src/Lucene.Net/Index/Term.cs
+++ b/src/Lucene.Net/Index/Term.cs
@@ -1,4 +1,4 @@
-using J2N.Text;
+using J2N.Text;
 using System;
 using System.Text;
 
@@ -84,7 +84,7 @@ namespace Lucene.Net.Index
         /// text of the word.  In the case of dates and other types, this is an
         /// encoding of the object as a string.
         /// </summary>
-        public string Text()
+        public string Text() // LUCENENET TODO: API - Change to a property. While this calls a method internally, its expected usage is that it will return a deterministic value.
         {
             return ToString(Bytes);
         }


[lucenenet] 01/07: Lucene.Net.Tests.Queries: Use consistent license headers (#259)

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit e0225338110e825e4a2768fe6c1d27f17b8afa80
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Sun Feb 21 22:54:32 2021 +0700

    Lucene.Net.Tests.Queries: Use consistent license headers (#259)
---
 src/Lucene.Net.Tests.Queries/BooleanFilterTest.cs  | 40 ++++++++++------------
 src/Lucene.Net.Tests.Queries/BoostingQueryTest.cs  | 40 ++++++++++------------
 src/Lucene.Net.Tests.Queries/ChainedFilterTest.cs  | 40 ++++++++++------------
 .../CommonTermsQueryTest.cs                        | 40 ++++++++++------------
 .../Function/FunctionTestSetup.cs                  | 40 ++++++++++------------
 .../Function/TestBoostedQuery.cs                   | 40 ++++++++++------------
 .../Function/TestDocValuesFieldSources.cs          | 40 ++++++++++------------
 .../Function/TestFieldScoreQuery.cs                | 40 ++++++++++------------
 .../Function/TestFunctionQuerySort.cs              | 40 ++++++++++------------
 .../Function/TestLongNormValueSource.cs            | 40 ++++++++++------------
 .../Function/TestOrdValues.cs                      | 40 ++++++++++------------
 .../Function/TestValueSources.cs                   | 40 ++++++++++------------
 .../Mlt/TestMoreLikeThis.cs                        | 40 ++++++++++------------
 src/Lucene.Net.Tests.Queries/TermFilterTest.cs     | 40 ++++++++++------------
 src/Lucene.Net.Tests.Queries/TermsFilterTest.cs    | 40 ++++++++++------------
 .../TestCustomScoreQuery.cs                        | 40 ++++++++++------------
 16 files changed, 288 insertions(+), 352 deletions(-)

diff --git a/src/Lucene.Net.Tests.Queries/BooleanFilterTest.cs b/src/Lucene.Net.Tests.Queries/BooleanFilterTest.cs
index 6653f9c..b4159a5 100644
--- a/src/Lucene.Net.Tests.Queries/BooleanFilterTest.cs
+++ b/src/Lucene.Net.Tests.Queries/BooleanFilterTest.cs
@@ -1,25 +1,4 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using Lucene.Net.Analysis;
+using Lucene.Net.Analysis;
 using Lucene.Net.Documents;
 using Lucene.Net.Index;
 using Lucene.Net.Queries;
@@ -30,6 +9,23 @@ using NUnit.Framework;
 
 namespace Lucene.Net.Tests.Queries
 {
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
     public class BooleanFilterTest : LuceneTestCase
     {
         private Directory directory;
diff --git a/src/Lucene.Net.Tests.Queries/BoostingQueryTest.cs b/src/Lucene.Net.Tests.Queries/BoostingQueryTest.cs
index 2d18840..d890a26 100644
--- a/src/Lucene.Net.Tests.Queries/BoostingQueryTest.cs
+++ b/src/Lucene.Net.Tests.Queries/BoostingQueryTest.cs
@@ -1,25 +1,4 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using Lucene.Net.Index;
+using Lucene.Net.Index;
 using Lucene.Net.Queries;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
@@ -27,6 +6,23 @@ using NUnit.Framework;
 
 namespace Lucene.Net.Tests.Queries
 {
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
     public class BoostingQueryTest : LuceneTestCase
     {
         // TODO: this suite desperately needs more tests!
diff --git a/src/Lucene.Net.Tests.Queries/ChainedFilterTest.cs b/src/Lucene.Net.Tests.Queries/ChainedFilterTest.cs
index e764319..5564420 100644
--- a/src/Lucene.Net.Tests.Queries/ChainedFilterTest.cs
+++ b/src/Lucene.Net.Tests.Queries/ChainedFilterTest.cs
@@ -1,25 +1,4 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using System;
+using System;
 using System.Globalization;
 using Lucene.Net.Documents;
 using Lucene.Net.Index;
@@ -31,6 +10,23 @@ using NUnit.Framework;
 
 namespace Lucene.Net.Tests.Queries
 {
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
     public class ChainedFilterTest : LuceneTestCase
     {
         public const int Max = 500;
diff --git a/src/Lucene.Net.Tests.Queries/CommonTermsQueryTest.cs b/src/Lucene.Net.Tests.Queries/CommonTermsQueryTest.cs
index 320e8e2..ddaf36f 100644
--- a/src/Lucene.Net.Tests.Queries/CommonTermsQueryTest.cs
+++ b/src/Lucene.Net.Tests.Queries/CommonTermsQueryTest.cs
@@ -1,25 +1,4 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using System;
+using System;
 using System.Collections.Generic;
 using Lucene.Net.Analysis;
 using Lucene.Net.Documents;
@@ -33,6 +12,23 @@ using JCG = J2N.Collections.Generic;
 
 namespace Lucene.Net.Tests.Queries
 {
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
     public class CommonTermsQueryTest : LuceneTestCase
     {
         [Test]
diff --git a/src/Lucene.Net.Tests.Queries/Function/FunctionTestSetup.cs b/src/Lucene.Net.Tests.Queries/Function/FunctionTestSetup.cs
index c9decbd..e4f3737 100644
--- a/src/Lucene.Net.Tests.Queries/Function/FunctionTestSetup.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/FunctionTestSetup.cs
@@ -1,25 +1,4 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using System;
+using System;
 using Lucene.Net.Analysis;
 using Lucene.Net.Documents;
 using Lucene.Net.Index;
@@ -33,6 +12,23 @@ using Console = Lucene.Net.Util.SystemConsole;
 
 namespace Lucene.Net.Tests.Queries.Function
 {
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
     /// <summary>
     /// Setup for function tests
     /// </summary>
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestBoostedQuery.cs b/src/Lucene.Net.Tests.Queries/Function/TestBoostedQuery.cs
index b04ccf1..dc82e18 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestBoostedQuery.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestBoostedQuery.cs
@@ -1,25 +1,4 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using Lucene.Net.Analysis;
+using Lucene.Net.Analysis;
 using Lucene.Net.Documents;
 using Lucene.Net.Index;
 using Lucene.Net.Index.Extensions;
@@ -32,6 +11,23 @@ using NUnit.Framework;
 
 namespace Lucene.Net.Tests.Queries.Function
 {
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
     /// <summary>
     /// Basic tests for <seealso cref="BoostedQuery"/>
     /// </summary>
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs b/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs
index b190324..71cfce7 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs
@@ -1,25 +1,4 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using Lucene.Net.Analysis;
+using Lucene.Net.Analysis;
 using Lucene.Net.Documents;
 using Lucene.Net.Index;
 using Lucene.Net.Queries.Function;
@@ -35,6 +14,23 @@ using System.Globalization;
 
 namespace Lucene.Net.Tests.Queries.Function
 {
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
     [SuppressCodecs("Lucene3x")]
     public class TestDocValuesFieldSources : LuceneTestCase
     {
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs b/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs
index 2b5ee69..1951dd7 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs
@@ -1,25 +1,4 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using J2N.Text;
+using J2N.Text;
 using Lucene.Net.Index;
 using Lucene.Net.Queries.Function;
 using Lucene.Net.Search;
@@ -27,6 +6,23 @@ using NUnit.Framework;
 
 namespace Lucene.Net.Tests.Queries.Function
 {
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
     /// <summary>
     /// Test FieldScoreQuery search.
     /// <p>
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestFunctionQuerySort.cs b/src/Lucene.Net.Tests.Queries/Function/TestFunctionQuerySort.cs
index 4537b36..768dd6f 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestFunctionQuerySort.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestFunctionQuerySort.cs
@@ -1,25 +1,4 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using System;
+using System;
 using Lucene.Net.Documents;
 using Lucene.Net.Index;
 using Lucene.Net.Index.Extensions;
@@ -31,6 +10,23 @@ using NUnit.Framework;
 
 namespace Lucene.Net.Tests.Queries.Function
 {
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
     /// <summary>
     /// Test that functionquery's getSortField() actually works.
     /// </summary>
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestLongNormValueSource.cs b/src/Lucene.Net.Tests.Queries/Function/TestLongNormValueSource.cs
index 066d862..01030d2 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestLongNormValueSource.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestLongNormValueSource.cs
@@ -1,25 +1,4 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using Lucene.Net.Analysis;
+using Lucene.Net.Analysis;
 using Lucene.Net.Documents;
 using Lucene.Net.Index;
 using Lucene.Net.Index.Extensions;
@@ -35,6 +14,23 @@ using System;
 
 namespace Lucene.Net.Tests.Queries.Function
 {
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
     [SuppressCodecs("Lucene3x")]
     public class TestLongNormValueSource : LuceneTestCase
     {
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs b/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs
index c5e2841..ef5c41b 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs
@@ -1,25 +1,4 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using J2N.Text;
+using J2N.Text;
 using Lucene.Net.Index;
 using Lucene.Net.Queries.Function;
 using Lucene.Net.Queries.Function.ValueSources;
@@ -29,6 +8,23 @@ using System;
 
 namespace Lucene.Net.Tests.Queries.Function
 {
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
     /// <summary>
     /// Test search based on OrdFieldSource and ReverseOrdFieldSource.
     /// <p/>
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs b/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs
index e78ad71..96943f6 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs
@@ -1,25 +1,4 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using System;
+using System;
 using System.Collections.Generic;
 using Lucene.Net.Analysis;
 using Lucene.Net.Codecs;
@@ -36,6 +15,23 @@ using NUnit.Framework;
 
 namespace Lucene.Net.Tests.Queries.Function
 {
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
     // TODO: add separate docvalues test
     /// <summary>
     /// barebones tests for function queries.
diff --git a/src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs b/src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs
index d628238..2f492e6 100644
--- a/src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs
+++ b/src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs
@@ -1,25 +1,4 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using System.Collections.Generic;
+using System.Collections.Generic;
 using System.IO;
 using Lucene.Net.Analysis;
 using Lucene.Net.Documents;
@@ -32,6 +11,23 @@ using Directory = Lucene.Net.Store.Directory;
 
 namespace Lucene.Net.Tests.Queries.Mlt
 {
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
     public class TestMoreLikeThis : LuceneTestCase
     {
         private Directory directory;
diff --git a/src/Lucene.Net.Tests.Queries/TermFilterTest.cs b/src/Lucene.Net.Tests.Queries/TermFilterTest.cs
index 9044639..c4a403c 100644
--- a/src/Lucene.Net.Tests.Queries/TermFilterTest.cs
+++ b/src/Lucene.Net.Tests.Queries/TermFilterTest.cs
@@ -1,25 +1,4 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using System;
+using System;
 using System.Collections.Generic;
 using Lucene.Net.Documents;
 using Lucene.Net.Index;
@@ -32,6 +11,23 @@ using JCG = J2N.Collections.Generic;
 
 namespace Lucene.Net.Tests.Queries
 {
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
     public class TermFilterTest : LuceneTestCase
     {
         [Test]
diff --git a/src/Lucene.Net.Tests.Queries/TermsFilterTest.cs b/src/Lucene.Net.Tests.Queries/TermsFilterTest.cs
index e9df545..45b1add 100644
--- a/src/Lucene.Net.Tests.Queries/TermsFilterTest.cs
+++ b/src/Lucene.Net.Tests.Queries/TermsFilterTest.cs
@@ -1,25 +1,4 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using System;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using J2N.Collections.Generic.Extensions;
@@ -35,6 +14,23 @@ using JCG = J2N.Collections.Generic;
 
 namespace Lucene.Net.Tests.Queries
 {
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
     public class TermsFilterTest : LuceneTestCase
     {
         [Test]
diff --git a/src/Lucene.Net.Tests.Queries/TestCustomScoreQuery.cs b/src/Lucene.Net.Tests.Queries/TestCustomScoreQuery.cs
index 16805f3..47d3052 100644
--- a/src/Lucene.Net.Tests.Queries/TestCustomScoreQuery.cs
+++ b/src/Lucene.Net.Tests.Queries/TestCustomScoreQuery.cs
@@ -1,25 +1,4 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using System;
+using System;
 using System.Collections.Generic;
 using Lucene.Net.Index;
 using Lucene.Net.Queries;
@@ -30,6 +9,23 @@ using NUnit.Framework;
 
 namespace Lucene.Net.Tests.Queries
 {
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
     /// <summary>
     /// Test CustomScoreQuery search.
     /// </summary>


[lucenenet] 07/07: Lucene.Net.Queries, Lucene.Net.Tests.Queries: Marked lucene compatibility version 4.8.1 at the top of each file. (#259)

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit d5a5e9839efe2715e49b748159593926747463da
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Mon Feb 22 07:30:26 2021 +0700

    Lucene.Net.Queries, Lucene.Net.Tests.Queries: Marked lucene compatibility version 4.8.1 at the top of each file. (#259)
---
 src/Lucene.Net.Queries/BooleanFilter.cs            |   3 +-
 src/Lucene.Net.Queries/BoostingQuery.cs            |   3 +-
 src/Lucene.Net.Queries/ChainedFilter.cs            |   3 +-
 src/Lucene.Net.Queries/CommonTermsQuery.cs         |   3 +-
 src/Lucene.Net.Queries/CustomScoreProvider.cs      |   3 +-
 src/Lucene.Net.Queries/CustomScoreQuery.cs         |   3 +-
 src/Lucene.Net.Queries/FilterClause.cs             |   3 +-
 src/Lucene.Net.Queries/Function/BoostedQuery.cs    |   3 +-
 .../Function/DocValues/BoolDocValues.cs            |   3 +-
 .../Function/DocValues/DocTermsIndexDocValues.cs   |   3 +-
 .../Function/DocValues/DoubleDocValues.cs          |   3 +-
 .../Function/DocValues/FloatDocValues.cs           |   3 +-
 .../Function/DocValues/IntDocValues.cs             |   3 +-
 .../Function/DocValues/LongDocValues.cs            |   3 +-
 .../Function/DocValues/StrDocValues.cs             |   3 +-
 src/Lucene.Net.Queries/Function/FunctionQuery.cs   |   3 +-
 src/Lucene.Net.Queries/Function/FunctionValues.cs  |   3 +-
 src/Lucene.Net.Queries/Function/ValueSource.cs     |   3 +-
 .../Function/ValueSourceScorer.cs                  |   3 +-
 .../Function/ValueSources/BoolFunction.cs          |   4 +-
 .../Function/ValueSources/ByteFieldSource.cs       |   3 +-
 .../Function/ValueSources/BytesRefFieldSource.cs   |   3 +-
 .../Function/ValueSources/ConstNumberSource.cs     |   4 +-
 .../Function/ValueSources/ConstValueSource.cs      |   3 +-
 .../Function/ValueSources/DefFunction.cs           |   3 +-
 .../Function/ValueSources/DivFloatFunction.cs      |   4 +-
 .../Function/ValueSources/DocFreqValueSource.cs    |   3 +-
 .../ValueSources/DoubleConstValueSource.cs         |   3 +-
 .../Function/ValueSources/DoubleFieldSource.cs     |   3 +-
 .../Function/ValueSources/DualFloatFunction.cs     |   3 +-
 .../Function/ValueSources/EnumFieldSource.cs       |   3 +-
 .../Function/ValueSources/FieldCacheSource.cs      |   3 +-
 .../Function/ValueSources/FloatFieldSource.cs      |   3 +-
 .../Function/ValueSources/IDFValueSource.cs        |   3 +-
 .../Function/ValueSources/IfFunction.cs            |   3 +-
 .../Function/ValueSources/IntFieldSource.cs        |   3 +-
 .../ValueSources/JoinDocFreqValueSource.cs         |   3 +-
 .../Function/ValueSources/LinearFloatFunction.cs   |   3 +-
 .../Function/ValueSources/LiteralValueSource.cs    |   3 +-
 .../Function/ValueSources/LongFieldSource.cs       |   3 +-
 .../Function/ValueSources/MaxDocValueSource.cs     |   3 +-
 .../Function/ValueSources/MaxFloatFunction.cs      |   3 +-
 .../Function/ValueSources/MinFloatFunction.cs      |   3 +-
 .../Function/ValueSources/MultiBoolFunction.cs     |   3 +-
 .../Function/ValueSources/MultiFloatFunction.cs    |   3 +-
 .../Function/ValueSources/MultiFunction.cs         |   3 +-
 .../Function/ValueSources/MultiValueSource.cs      |   4 +-
 .../Function/ValueSources/NormValueSource.cs       |   3 +-
 .../Function/ValueSources/NumDocsValueSource.cs    |   3 +-
 .../Function/ValueSources/OrdFieldSource.cs        |   3 +-
 .../Function/ValueSources/PowFloatFunction.cs      |   3 +-
 .../Function/ValueSources/ProductFloatFunction.cs  |   4 +-
 .../Function/ValueSources/QueryValueSource.cs      |   3 +-
 .../Function/ValueSources/RangeMapFloatFunction.cs |   3 +-
 .../ValueSources/ReciprocalFloatFunction.cs        |   3 +-
 .../Function/ValueSources/ReverseOrdFieldSource.cs |   3 +-
 .../Function/ValueSources/ScaleFloatFunction.cs    |   3 +-
 .../Function/ValueSources/ShortFieldSource.cs      |   3 +-
 .../Function/ValueSources/SimpleBoolFunction.cs    |   3 +-
 .../Function/ValueSources/SimpleFloatFunction.cs   |   3 +-
 .../Function/ValueSources/SingleFunction.cs        |   3 +-
 .../Function/ValueSources/SumFloatFunction.cs      |   4 +-
 .../ValueSources/SumTotalTermFreqValueSource.cs    |   3 +-
 .../Function/ValueSources/TFValueSource.cs         |   3 +-
 .../Function/ValueSources/TermFreqValueSource.cs   |   3 +-
 .../ValueSources/TotalTermFreqValueSource.cs       |   3 +-
 .../Function/ValueSources/VectorValueSource.cs     |   3 +-
 src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs         |   3 +-
 src/Lucene.Net.Queries/Mlt/MoreLikeThisQuery.cs    |   3 +-
 src/Lucene.Net.Queries/TermFilter.cs               |   3 +-
 src/Lucene.Net.Queries/TermsFilter.cs              |   3 +-
 src/Lucene.Net.Tests.Queries/BooleanFilterTest.cs  |  56 ++++++--
 src/Lucene.Net.Tests.Queries/BoostingQueryTest.cs  |   3 +-
 src/Lucene.Net.Tests.Queries/ChainedFilterTest.cs  |  21 ++-
 .../CommonTermsQueryTest.cs                        | 158 ++++++++++++++-------
 .../Function/FunctionTestSetup.cs                  |  41 +++---
 .../Function/TestBoostedQuery.cs                   |   3 +-
 .../Function/TestDocValuesFieldSources.cs          |   3 +-
 .../Function/TestFieldScoreQuery.cs                |   3 +-
 .../Function/TestFunctionQuerySort.cs              |   8 +-
 .../Function/TestLongNormValueSource.cs            |   9 +-
 .../Function/TestOrdValues.cs                      |  11 +-
 .../Function/TestValueSources.cs                   | 143 +++++++++++++------
 .../Mlt/TestMoreLikeThis.cs                        |   6 +-
 src/Lucene.Net.Tests.Queries/TermFilterTest.cs     |  19 ++-
 src/Lucene.Net.Tests.Queries/TermsFilterTest.cs    |  17 ++-
 .../TestCustomScoreQuery.cs                        |  32 +++--
 87 files changed, 508 insertions(+), 244 deletions(-)

diff --git a/src/Lucene.Net.Queries/BooleanFilter.cs b/src/Lucene.Net.Queries/BooleanFilter.cs
index 24caf4a..7f0601c 100644
--- a/src/Lucene.Net.Queries/BooleanFilter.cs
+++ b/src/Lucene.Net.Queries/BooleanFilter.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Diagnostics;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Diagnostics;
 using Lucene.Net.Index;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
diff --git a/src/Lucene.Net.Queries/BoostingQuery.cs b/src/Lucene.Net.Queries/BoostingQuery.cs
index 7a6c142..3680992 100644
--- a/src/Lucene.Net.Queries/BoostingQuery.cs
+++ b/src/Lucene.Net.Queries/BoostingQuery.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Search;
 
 namespace Lucene.Net.Queries
diff --git a/src/Lucene.Net.Queries/ChainedFilter.cs b/src/Lucene.Net.Queries/ChainedFilter.cs
index a9c43f9..045f9da 100644
--- a/src/Lucene.Net.Queries/ChainedFilter.cs
+++ b/src/Lucene.Net.Queries/ChainedFilter.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
 using System;
diff --git a/src/Lucene.Net.Queries/CommonTermsQuery.cs b/src/Lucene.Net.Queries/CommonTermsQuery.cs
index 69ed7e0..01fd666 100644
--- a/src/Lucene.Net.Queries/CommonTermsQuery.cs
+++ b/src/Lucene.Net.Queries/CommonTermsQuery.cs
@@ -1,4 +1,5 @@
-using J2N.Collections.Generic.Extensions;
+// Lucene version compatibility level 4.8.1
+using J2N.Collections.Generic.Extensions;
 using Lucene.Net.Diagnostics;
 using Lucene.Net.Index;
 using Lucene.Net.Search;
diff --git a/src/Lucene.Net.Queries/CustomScoreProvider.cs b/src/Lucene.Net.Queries/CustomScoreProvider.cs
index 3ad6f1e..d9d430f 100644
--- a/src/Lucene.Net.Queries/CustomScoreProvider.cs
+++ b/src/Lucene.Net.Queries/CustomScoreProvider.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Search;
 
 namespace Lucene.Net.Queries
diff --git a/src/Lucene.Net.Queries/CustomScoreQuery.cs b/src/Lucene.Net.Queries/CustomScoreQuery.cs
index 18e3d84..243b6f8 100644
--- a/src/Lucene.Net.Queries/CustomScoreQuery.cs
+++ b/src/Lucene.Net.Queries/CustomScoreQuery.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function;
 using Lucene.Net.Search;
 using Lucene.Net.Support;
diff --git a/src/Lucene.Net.Queries/FilterClause.cs b/src/Lucene.Net.Queries/FilterClause.cs
index a288ca3..251e13f 100644
--- a/src/Lucene.Net.Queries/FilterClause.cs
+++ b/src/Lucene.Net.Queries/FilterClause.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Search;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Search;
 
 namespace Lucene.Net.Queries
 {
diff --git a/src/Lucene.Net.Queries/Function/BoostedQuery.cs b/src/Lucene.Net.Queries/Function/BoostedQuery.cs
index 844d02d..23464b7 100644
--- a/src/Lucene.Net.Queries/Function/BoostedQuery.cs
+++ b/src/Lucene.Net.Queries/Function/BoostedQuery.cs
@@ -1,4 +1,5 @@
-using J2N.Numerics;
+// Lucene version compatibility level 4.8.1
+using J2N.Numerics;
 using Lucene.Net.Index;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
diff --git a/src/Lucene.Net.Queries/Function/DocValues/BoolDocValues.cs b/src/Lucene.Net.Queries/Function/DocValues/BoolDocValues.cs
index dc9d43b..539853a 100644
--- a/src/Lucene.Net.Queries/Function/DocValues/BoolDocValues.cs
+++ b/src/Lucene.Net.Queries/Function/DocValues/BoolDocValues.cs
@@ -1,4 +1,5 @@
-using System;
+// Lucene version compatibility level 4.8.1
+using System;
 using Lucene.Net.Util.Mutable;
 
 namespace Lucene.Net.Queries.Function.DocValues
diff --git a/src/Lucene.Net.Queries/Function/DocValues/DocTermsIndexDocValues.cs b/src/Lucene.Net.Queries/Function/DocValues/DocTermsIndexDocValues.cs
index eb7c280..8178834 100644
--- a/src/Lucene.Net.Queries/Function/DocValues/DocTermsIndexDocValues.cs
+++ b/src/Lucene.Net.Queries/Function/DocValues/DocTermsIndexDocValues.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
 using Lucene.Net.Util.Mutable;
diff --git a/src/Lucene.Net.Queries/Function/DocValues/DoubleDocValues.cs b/src/Lucene.Net.Queries/Function/DocValues/DoubleDocValues.cs
index 8ed8e0d..7477e8d 100644
--- a/src/Lucene.Net.Queries/Function/DocValues/DoubleDocValues.cs
+++ b/src/Lucene.Net.Queries/Function/DocValues/DoubleDocValues.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Util.Mutable;
 using System;
 using System.Globalization;
diff --git a/src/Lucene.Net.Queries/Function/DocValues/FloatDocValues.cs b/src/Lucene.Net.Queries/Function/DocValues/FloatDocValues.cs
index 0d8fe10..8d1f66e 100644
--- a/src/Lucene.Net.Queries/Function/DocValues/FloatDocValues.cs
+++ b/src/Lucene.Net.Queries/Function/DocValues/FloatDocValues.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Util.Mutable;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Util.Mutable;
 using System;
 using System.Globalization;
 
diff --git a/src/Lucene.Net.Queries/Function/DocValues/IntDocValues.cs b/src/Lucene.Net.Queries/Function/DocValues/IntDocValues.cs
index 58c8a05..9102b33 100644
--- a/src/Lucene.Net.Queries/Function/DocValues/IntDocValues.cs
+++ b/src/Lucene.Net.Queries/Function/DocValues/IntDocValues.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Util.Mutable;
 using System;
 using System.Globalization;
diff --git a/src/Lucene.Net.Queries/Function/DocValues/LongDocValues.cs b/src/Lucene.Net.Queries/Function/DocValues/LongDocValues.cs
index 6f204e2..929a5bb 100644
--- a/src/Lucene.Net.Queries/Function/DocValues/LongDocValues.cs
+++ b/src/Lucene.Net.Queries/Function/DocValues/LongDocValues.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Util.Mutable;
 using System;
 using System.Globalization;
diff --git a/src/Lucene.Net.Queries/Function/DocValues/StrDocValues.cs b/src/Lucene.Net.Queries/Function/DocValues/StrDocValues.cs
index 36d8089..767a40f 100644
--- a/src/Lucene.Net.Queries/Function/DocValues/StrDocValues.cs
+++ b/src/Lucene.Net.Queries/Function/DocValues/StrDocValues.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Util.Mutable;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Util.Mutable;
 
 namespace Lucene.Net.Queries.Function.DocValues
 {
diff --git a/src/Lucene.Net.Queries/Function/FunctionQuery.cs b/src/Lucene.Net.Queries/Function/FunctionQuery.cs
index 02b7fc7..0e37451 100644
--- a/src/Lucene.Net.Queries/Function/FunctionQuery.cs
+++ b/src/Lucene.Net.Queries/Function/FunctionQuery.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
 using System.Collections;
diff --git a/src/Lucene.Net.Queries/Function/FunctionValues.cs b/src/Lucene.Net.Queries/Function/FunctionValues.cs
index 251a33e..71aebbf 100644
--- a/src/Lucene.Net.Queries/Function/FunctionValues.cs
+++ b/src/Lucene.Net.Queries/Function/FunctionValues.cs
@@ -1,4 +1,5 @@
-using System;
+// Lucene version compatibility level 4.8.1
+using System;
 using System.Globalization;
 using Lucene.Net.Index;
 using Lucene.Net.Search;
diff --git a/src/Lucene.Net.Queries/Function/ValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSource.cs
index 26f5cd5..e075efb 100644
--- a/src/Lucene.Net.Queries/Function/ValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSource.cs
@@ -1,4 +1,5 @@
-using J2N.Runtime.CompilerServices;
+// Lucene version compatibility level 4.8.1
+using J2N.Runtime.CompilerServices;
 using Lucene.Net.Index;
 using Lucene.Net.Search;
 using System;
diff --git a/src/Lucene.Net.Queries/Function/ValueSourceScorer.cs b/src/Lucene.Net.Queries/Function/ValueSourceScorer.cs
index 24cdbba..78528ed 100644
--- a/src/Lucene.Net.Queries/Function/ValueSourceScorer.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSourceScorer.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
 using System;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/BoolFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/BoolFunction.cs
index 3470fb3..fac6947 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/BoolFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/BoolFunction.cs
@@ -1,4 +1,6 @@
-namespace Lucene.Net.Queries.Function.ValueSources
+// Lucene version compatibility level 4.8.1
+
+namespace Lucene.Net.Queries.Function.ValueSources
 {
     /*
      * Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ByteFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/ByteFieldSource.cs
index 5279ffe..2597644 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/ByteFieldSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/ByteFieldSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Search;
 using System;
 using System.Collections;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/BytesRefFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/BytesRefFieldSource.cs
index 1903796..21b8150 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/BytesRefFieldSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/BytesRefFieldSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Util;
 using System.Collections;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ConstNumberSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/ConstNumberSource.cs
index 3a33ae7..d8d0aa3 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/ConstNumberSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/ConstNumberSource.cs
@@ -1,4 +1,6 @@
-namespace Lucene.Net.Queries.Function.ValueSources
+// Lucene version compatibility level 4.8.1
+
+namespace Lucene.Net.Queries.Function.ValueSources
 {
     /*
      * Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ConstValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/ConstValueSource.cs
index 607bd57..7c8fa1d 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/ConstValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/ConstValueSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using System.Collections;
 
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/DefFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/DefFunction.cs
index b12c4c8..aff62e2 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/DefFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/DefFunction.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Util;
 using System.Collections;
 using System.Collections.Generic;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/DivFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/DivFloatFunction.cs
index 20b91c6..b8a4c3c 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/DivFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/DivFloatFunction.cs
@@ -1,4 +1,6 @@
-namespace Lucene.Net.Queries.Function.ValueSources
+// Lucene version compatibility level 4.8.1
+
+namespace Lucene.Net.Queries.Function.ValueSources
 {
     /*
      * Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/DocFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/DocFreqValueSource.cs
index f277a97..9d40d9f 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/DocFreqValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/DocFreqValueSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/DoubleConstValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/DoubleConstValueSource.cs
index f7b8d02..1f4f5e6 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/DoubleConstValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/DoubleConstValueSource.cs
@@ -1,4 +1,5 @@
-using J2N.Numerics;
+// Lucene version compatibility level 4.8.1
+using J2N.Numerics;
 using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using System;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/DoubleFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/DoubleFieldSource.cs
index a823e52..55dd2f8 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/DoubleFieldSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/DoubleFieldSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/DualFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/DualFloatFunction.cs
index fc69e47..c842d3a 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/DualFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/DualFloatFunction.cs
@@ -1,4 +1,5 @@
-using J2N.Numerics;
+// Lucene version compatibility level 4.8.1
+using J2N.Numerics;
 using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs
index c1dc8ef..dceac9e 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/FieldCacheSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/FieldCacheSource.cs
index a8ec5c3..e9ce82c 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/FieldCacheSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/FieldCacheSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Search;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Search;
 using System;
 
 namespace Lucene.Net.Queries.Function.ValueSources
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/FloatFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/FloatFieldSource.cs
index f09a127..bb245c0 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/FloatFieldSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/FloatFieldSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/IDFValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/IDFValueSource.cs
index 7d2da72..e64c3c3 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/IDFValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/IDFValueSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Search;
 using Lucene.Net.Search.Similarities;
 using Lucene.Net.Support;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/IfFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/IfFunction.cs
index 2c13413..ee1609f 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/IfFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/IfFunction.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
 using System.Collections;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/IntFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/IntFieldSource.cs
index ac11ed0..d48b2a1 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/IntFieldSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/IntFieldSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/JoinDocFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/JoinDocFreqValueSource.cs
index 9054c0d..76b42e1 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/JoinDocFreqValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/JoinDocFreqValueSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Util;
 using Lucene.Net.Util.Packed;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/LinearFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/LinearFloatFunction.cs
index 2a08aa6..7b3d1bf 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/LinearFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/LinearFloatFunction.cs
@@ -1,4 +1,5 @@
-using J2N.Numerics;
+// Lucene version compatibility level 4.8.1
+using J2N.Numerics;
 using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/LiteralValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/LiteralValueSource.cs
index 2dd7b38..8b792fd 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/LiteralValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/LiteralValueSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Util;
 using System;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/LongFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/LongFieldSource.cs
index 3d6653c..cb73a87 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/LongFieldSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/LongFieldSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/MaxDocValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/MaxDocValueSource.cs
index cf7d616..0db04f5 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/MaxDocValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/MaxDocValueSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Search;
 using System.Collections;
 
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/MaxFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/MaxFloatFunction.cs
index b68cee3..4f21942 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/MaxFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/MaxFloatFunction.cs
@@ -1,4 +1,5 @@
-using System;
+// Lucene version compatibility level 4.8.1
+using System;
 
 namespace Lucene.Net.Queries.Function.ValueSources
 {
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/MinFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/MinFloatFunction.cs
index eab6c2d..6391993 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/MinFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/MinFloatFunction.cs
@@ -1,4 +1,5 @@
-using System;
+// Lucene version compatibility level 4.8.1
+using System;
 
 namespace Lucene.Net.Queries.Function.ValueSources
 {
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/MultiBoolFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/MultiBoolFunction.cs
index 19bf4fe..0a859ef 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/MultiBoolFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/MultiBoolFunction.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using System.Collections;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/MultiFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/MultiFloatFunction.cs
index aaa0bbb..96e8581 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/MultiFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/MultiFloatFunction.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using Lucene.Net.Support;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/MultiFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/MultiFunction.cs
index e78e041..623e101 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/MultiFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/MultiFunction.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Search;
 using System.Collections;
 using System.Collections.Generic;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/MultiValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/MultiValueSource.cs
index 08c8d51..5b83eeb 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/MultiValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/MultiValueSource.cs
@@ -1,4 +1,6 @@
-namespace Lucene.Net.Queries.Function.ValueSources
+// Lucene version compatibility level 4.8.1
+
+namespace Lucene.Net.Queries.Function.ValueSources
 {
     /*
      * Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/NormValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/NormValueSource.cs
index d8e6deb..6a270ab 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/NormValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/NormValueSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using Lucene.Net.Search.Similarities;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/NumDocsValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/NumDocsValueSource.cs
index de5467f..f6749fe 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/NumDocsValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/NumDocsValueSource.cs
@@ -1,4 +1,5 @@
-using System.Collections;
+// Lucene version compatibility level 4.8.1
+using System.Collections;
 using Lucene.Net.Index;
 
 namespace Lucene.Net.Queries.Function.ValueSources
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/OrdFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/OrdFieldSource.cs
index 8bdc8d9..69fcf33 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/OrdFieldSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/OrdFieldSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using Lucene.Net.Util.Mutable;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/PowFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/PowFloatFunction.cs
index 2328bfe..0108f45 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/PowFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/PowFloatFunction.cs
@@ -1,4 +1,5 @@
-using System;
+// Lucene version compatibility level 4.8.1
+using System;
 
 namespace Lucene.Net.Queries.Function.ValueSources
 {
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ProductFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/ProductFloatFunction.cs
index a42e4e7..9b06801 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/ProductFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/ProductFloatFunction.cs
@@ -1,4 +1,6 @@
-namespace Lucene.Net.Queries.Function.ValueSources
+// Lucene version compatibility level 4.8.1
+
+namespace Lucene.Net.Queries.Function.ValueSources
 {
     /*
      * Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/QueryValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/QueryValueSource.cs
index 598536f..cb72e98 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/QueryValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/QueryValueSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/RangeMapFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/RangeMapFloatFunction.cs
index 03389c6..5b436ca 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/RangeMapFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/RangeMapFloatFunction.cs
@@ -1,4 +1,5 @@
-using J2N.Numerics;
+// Lucene version compatibility level 4.8.1
+using J2N.Numerics;
 using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ReciprocalFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/ReciprocalFloatFunction.cs
index e5bbb32..3e44146 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/ReciprocalFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/ReciprocalFloatFunction.cs
@@ -1,4 +1,5 @@
-using J2N.Numerics;
+// Lucene version compatibility level 4.8.1
+using J2N.Numerics;
 using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ReverseOrdFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/ReverseOrdFieldSource.cs
index 75c5f48..6e98b73 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/ReverseOrdFieldSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/ReverseOrdFieldSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using System;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ScaleFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/ScaleFloatFunction.cs
index e7d5584..0d33b05 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/ScaleFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/ScaleFloatFunction.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using System.Collections;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ShortFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/ShortFieldSource.cs
index 4131649..6e219b2 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/ShortFieldSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/ShortFieldSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Search;
 using System;
 using System.Collections;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SimpleBoolFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/SimpleBoolFunction.cs
index 0fc2a94..8c233b1 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/SimpleBoolFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/SimpleBoolFunction.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using System.Collections;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs
index bf0a48c..3f3da4d 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using System.Collections;
 
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SingleFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/SingleFunction.cs
index 5de2beb..a06fd4a 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/SingleFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/SingleFunction.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Search;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Search;
 using System;
 using System.Collections;
 
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs
index befdae8..cdb9915 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs
@@ -1,4 +1,6 @@
-namespace Lucene.Net.Queries.Function.ValueSources
+// Lucene version compatibility level 4.8.1
+
+namespace Lucene.Net.Queries.Function.ValueSources
 {
     /*
      * Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs
index 60c72a2..c02d255 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using System;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs
index 000403b..d1173d2 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using Lucene.Net.Search.Similarities;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs
index 64fec78..39d217b 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs
index 38d6213..6c7200d 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs
index 3417447..5f5ca5c 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Search;
 using System.Collections;
 using System.Collections.Generic;
diff --git a/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs b/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs
index fab5b4e..c4c5c0b 100644
--- a/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs
+++ b/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs
@@ -1,4 +1,5 @@
-using J2N.Collections.Generic.Extensions;
+// Lucene version compatibility level 4.8.1
+using J2N.Collections.Generic.Extensions;
 using Lucene.Net.Analysis;
 using Lucene.Net.Analysis.TokenAttributes;
 using Lucene.Net.Documents;
diff --git a/src/Lucene.Net.Queries/Mlt/MoreLikeThisQuery.cs b/src/Lucene.Net.Queries/Mlt/MoreLikeThisQuery.cs
index 337c77e..b741d43 100644
--- a/src/Lucene.Net.Queries/Mlt/MoreLikeThisQuery.cs
+++ b/src/Lucene.Net.Queries/Mlt/MoreLikeThisQuery.cs
@@ -1,4 +1,5 @@
-/*
+// Lucene version compatibility level 4.8.1
+/*
  * Created on 25-Jan-2006
  */
 using Lucene.Net.Analysis;
diff --git a/src/Lucene.Net.Queries/TermFilter.cs b/src/Lucene.Net.Queries/TermFilter.cs
index 9217e5f..f8f1c1e 100644
--- a/src/Lucene.Net.Queries/TermFilter.cs
+++ b/src/Lucene.Net.Queries/TermFilter.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
 using System;
diff --git a/src/Lucene.Net.Queries/TermsFilter.cs b/src/Lucene.Net.Queries/TermsFilter.cs
index 960b894..c0f9c91 100644
--- a/src/Lucene.Net.Queries/TermsFilter.cs
+++ b/src/Lucene.Net.Queries/TermsFilter.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Search;
 using Lucene.Net.Support;
 using Lucene.Net.Util;
diff --git a/src/Lucene.Net.Tests.Queries/BooleanFilterTest.cs b/src/Lucene.Net.Tests.Queries/BooleanFilterTest.cs
index b4159a5..6a80a34 100644
--- a/src/Lucene.Net.Tests.Queries/BooleanFilterTest.cs
+++ b/src/Lucene.Net.Tests.Queries/BooleanFilterTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Analysis;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Analysis;
 using Lucene.Net.Documents;
 using Lucene.Net.Index;
 using Lucene.Net.Queries;
@@ -42,6 +43,7 @@ namespace Lucene.Net.Tests.Queries
 #endif
                 Random, directory, new MockAnalyzer(Random, MockTokenizer.WHITESPACE, false));
 
+            //Add series of docs with filterable fields : acces rights, prices, dates and "in-stock" flags
             AddDoc(writer, @"admin guest", @"010", @"20040101", @"Y");
             AddDoc(writer, @"guest", @"020", @"20040101", @"Y");
             AddDoc(writer, @"guest", @"020", @"20050101", @"Y");
@@ -87,23 +89,23 @@ namespace Lucene.Net.Tests.Queries
 
         private Filter GetEmptyFilter()
         {
-            return new AnonymousFilter();
+            return new FilterAnonymousClass();
         }
 
-        private sealed class AnonymousFilter : Filter
+        private sealed class FilterAnonymousClass : Filter
         {
             public override DocIdSet GetDocIdSet(AtomicReaderContext context, IBits acceptDocs)
             {
-                return new FixedBitSet(context.AtomicReader.MaxDoc);
+                return new FixedBitSet(context.Reader.MaxDoc);
             }
         }
 
         private Filter GetNullDISFilter()
         {
-            return new AnonymousFilter1();
+            return new FilterAnonymousClass1();
         }
 
-        private sealed class AnonymousFilter1 : Filter
+        private sealed class FilterAnonymousClass1 : Filter
         {
             public override DocIdSet GetDocIdSet(AtomicReaderContext context, IBits acceptDocs)
             {
@@ -113,10 +115,10 @@ namespace Lucene.Net.Tests.Queries
 
         private Filter GetNullDISIFilter()
         {
-            return new AnonymousFilter2();
+            return new FilterAnonymousClass2();
         }
 
-        private sealed class AnonymousDocIdSet : DocIdSet
+        private sealed class DocIdSetAnonymousClass : DocIdSet
         {
             public override DocIdSetIterator GetIterator()
             {
@@ -126,11 +128,11 @@ namespace Lucene.Net.Tests.Queries
             public override bool IsCacheable => true;
         }
 
-        private sealed class AnonymousFilter2 : Filter
+        private sealed class FilterAnonymousClass2 : Filter
         {
             public override DocIdSet GetDocIdSet(AtomicReaderContext context, IBits acceptDocs)
             {
-                return new AnonymousDocIdSet();
+                return new DocIdSetAnonymousClass();
             }
         }
 
@@ -156,6 +158,8 @@ namespace Lucene.Net.Tests.Queries
             BooleanFilter booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetTermsFilter(@"price", @"030"), Occur.SHOULD);
             TstFilterCard(@"Should retrieves only 1 doc", 1, booleanFilter);
+
+            // same with a real DISI (no OpenBitSetIterator)
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetWrappedTermQuery(@"price", @"030"), Occur.SHOULD);
             TstFilterCard(@"Should retrieves only 1 doc", 1, booleanFilter);
@@ -178,13 +182,17 @@ namespace Lucene.Net.Tests.Queries
             booleanFilter.Add(GetRangeFilter(@"price", @"020", @"030"), Occur.SHOULD);
             booleanFilter.Add(GetTermsFilter(@"inStock", @"N"), Occur.MUST_NOT);
             TstFilterCard(@"Shoulds Ored but AndNot", 4, booleanFilter);
+
             booleanFilter.Add(GetTermsFilter(@"inStock", @"Maybe"), Occur.MUST_NOT);
             TstFilterCard(@"Shoulds Ored but AndNots", 3, booleanFilter);
+
+            // same with a real DISI (no OpenBitSetIterator)
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetRangeFilter(@"price", @"010", @"020"), Occur.SHOULD);
             booleanFilter.Add(GetRangeFilter(@"price", @"020", @"030"), Occur.SHOULD);
             booleanFilter.Add(GetWrappedTermQuery(@"inStock", @"N"), Occur.MUST_NOT);
             TstFilterCard(@"Shoulds Ored but AndNot", 4, booleanFilter);
+
             booleanFilter.Add(GetWrappedTermQuery(@"inStock", @"Maybe"), Occur.MUST_NOT);
             TstFilterCard(@"Shoulds Ored but AndNots", 3, booleanFilter);
         }
@@ -197,6 +205,8 @@ namespace Lucene.Net.Tests.Queries
             booleanFilter.Add(GetRangeFilter(@"price", @"020", @"030"), Occur.SHOULD);
             booleanFilter.Add(GetTermsFilter(@"accessRights", @"admin"), Occur.MUST);
             TstFilterCard(@"Shoulds Ored but MUST", 3, booleanFilter);
+
+            // same with a real DISI (no OpenBitSetIterator)
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetRangeFilter(@"price", @"010", @"020"), Occur.SHOULD);
             booleanFilter.Add(GetRangeFilter(@"price", @"020", @"030"), Occur.SHOULD);
@@ -224,6 +234,8 @@ namespace Lucene.Net.Tests.Queries
             booleanFilter.Add(GetRangeFilter(@"date", @"20050101", @"20051231"), Occur.MUST);
             booleanFilter.Add(GetTermsFilter(@"inStock", @"N"), Occur.MUST_NOT);
             TstFilterCard(@"Shoulds Ored but MUSTs ANDED and MustNot", 0, booleanFilter);
+
+            // same with a real DISI (no OpenBitSetIterator)
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetRangeFilter(@"price", @"030", @"040"), Occur.SHOULD);
             booleanFilter.Add(GetWrappedTermQuery(@"accessRights", @"admin"), Occur.MUST);
@@ -238,6 +250,8 @@ namespace Lucene.Net.Tests.Queries
             BooleanFilter booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetTermsFilter(@"accessRights", @"admin"), Occur.MUST);
             TstFilterCard(@"MUST", 3, booleanFilter);
+
+            // same with a real DISI (no OpenBitSetIterator)
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetWrappedTermQuery(@"accessRights", @"admin"), Occur.MUST);
             TstFilterCard(@"MUST", 3, booleanFilter);
@@ -249,6 +263,8 @@ namespace Lucene.Net.Tests.Queries
             BooleanFilter booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetTermsFilter(@"inStock", @"N"), Occur.MUST_NOT);
             TstFilterCard(@"MUST_NOT", 4, booleanFilter);
+
+            // same with a real DISI (no OpenBitSetIterator)
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetWrappedTermQuery(@"inStock", @"N"), Occur.MUST_NOT);
             TstFilterCard(@"MUST_NOT", 4, booleanFilter);
@@ -261,6 +277,8 @@ namespace Lucene.Net.Tests.Queries
             booleanFilter.Add(GetTermsFilter(@"inStock", @"N"), Occur.MUST);
             booleanFilter.Add(GetTermsFilter(@"price", @"030"), Occur.MUST_NOT);
             TstFilterCard(@"MUST_NOT wins over MUST for same docs", 0, booleanFilter);
+
+            // same with a real DISI (no OpenBitSetIterator)
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetWrappedTermQuery(@"inStock", @"N"), Occur.MUST);
             booleanFilter.Add(GetWrappedTermQuery(@"price", @"030"), Occur.MUST_NOT);
@@ -281,22 +299,27 @@ namespace Lucene.Net.Tests.Queries
             booleanFilter.Add(GetTermsFilter(@"price", @"030"), Occur.MUST);
             booleanFilter.Add(GetNullDISFilter(), Occur.MUST);
             TstFilterCard(@"A MUST filter that returns a null DIS should never return documents", 0, booleanFilter);
+
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetTermsFilter(@"price", @"030"), Occur.MUST);
             booleanFilter.Add(GetNullDISIFilter(), Occur.MUST);
             TstFilterCard(@"A MUST filter that returns a null DISI should never return documents", 0, booleanFilter);
+
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetTermsFilter(@"price", @"030"), Occur.SHOULD);
             booleanFilter.Add(GetNullDISFilter(), Occur.SHOULD);
             TstFilterCard(@"A SHOULD filter that returns a null DIS should be invisible", 1, booleanFilter);
+
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetTermsFilter(@"price", @"030"), Occur.SHOULD);
             booleanFilter.Add(GetNullDISIFilter(), Occur.SHOULD);
             TstFilterCard(@"A SHOULD filter that returns a null DISI should be invisible", 1, booleanFilter);
+
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetTermsFilter(@"price", @"030"), Occur.MUST);
             booleanFilter.Add(GetNullDISFilter(), Occur.MUST_NOT);
             TstFilterCard(@"A MUST_NOT filter that returns a null DIS should be invisible", 1, booleanFilter);
+
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetTermsFilter(@"price", @"030"), Occur.MUST);
             booleanFilter.Add(GetNullDISIFilter(), Occur.MUST_NOT);
@@ -309,18 +332,23 @@ namespace Lucene.Net.Tests.Queries
             BooleanFilter booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetNullDISFilter(), Occur.MUST);
             TstFilterCard(@"A MUST filter that returns a null DIS should never return documents", 0, booleanFilter);
+
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetNullDISIFilter(), Occur.MUST);
             TstFilterCard(@"A MUST filter that returns a null DISI should never return documents", 0, booleanFilter);
+
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetNullDISFilter(), Occur.SHOULD);
             TstFilterCard(@"A single SHOULD filter that returns a null DIS should never return documents", 0, booleanFilter);
+
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetNullDISIFilter(), Occur.SHOULD);
             TstFilterCard(@"A single SHOULD filter that returns a null DISI should never return documents", 0, booleanFilter);
+
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetNullDISFilter(), Occur.MUST_NOT);
             TstFilterCard(@"A single MUST_NOT filter that returns a null DIS should be invisible", 5, booleanFilter);
+
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetNullDISIFilter(), Occur.MUST_NOT);
             TstFilterCard(@"A single MUST_NOT filter that returns a null DIS should be invisible", 5, booleanFilter);
@@ -333,10 +361,12 @@ namespace Lucene.Net.Tests.Queries
             booleanFilter.Add(GetEmptyFilter(), Occur.SHOULD);
             booleanFilter.Add(GetTermsFilter(@"accessRights", @"admin"), Occur.MUST);
             TstFilterCard(@">0 shoulds with no matches should return no docs", 0, booleanFilter);
+
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetNullDISFilter(), Occur.SHOULD);
             booleanFilter.Add(GetTermsFilter(@"accessRights", @"admin"), Occur.MUST);
             TstFilterCard(@">0 shoulds with no matches should return no docs", 0, booleanFilter);
+
             booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetNullDISIFilter(), Occur.SHOULD);
             booleanFilter.Add(GetTermsFilter(@"accessRights", @"admin"), Occur.MUST);
@@ -349,6 +379,7 @@ namespace Lucene.Net.Tests.Queries
             BooleanFilter booleanFilter = new BooleanFilter();
             booleanFilter.Add(GetTermsFilter(@"inStock", @"N"), Occur.MUST);
             booleanFilter.Add(GetTermsFilter(@"isFragile", @"Y"), Occur.MUST);
+
             assertEquals(@"BooleanFilter(+inStock:N +isFragile:Y)", booleanFilter.ToString());
         }
 
@@ -356,14 +387,19 @@ namespace Lucene.Net.Tests.Queries
         public void TestToStringOfWrappedBooleanFilters()
         {
             BooleanFilter orFilter = new BooleanFilter();
+
             BooleanFilter stockFilter = new BooleanFilter();
             stockFilter.Add(new FilterClause(GetTermsFilter(@"inStock", @"Y"), Occur.MUST));
             stockFilter.Add(new FilterClause(GetTermsFilter(@"barCode", @"12345678"), Occur.MUST));
+
             orFilter.Add(new FilterClause(stockFilter, Occur.SHOULD));
+
             BooleanFilter productPropertyFilter = new BooleanFilter();
             productPropertyFilter.Add(new FilterClause(GetTermsFilter(@"isHeavy", @"N"), Occur.MUST));
             productPropertyFilter.Add(new FilterClause(GetTermsFilter(@"isDamaged", @"Y"), Occur.MUST));
+
             orFilter.Add(new FilterClause(productPropertyFilter, Occur.SHOULD));
+
             BooleanFilter composedFilter = new BooleanFilter();
             composedFilter.Add(new FilterClause(orFilter, Occur.MUST));
             assertEquals(@"BooleanFilter(+BooleanFilter(BooleanFilter(+inStock:Y +barCode:12345678) BooleanFilter(+isHeavy:N +isDamaged:Y)))", composedFilter.ToString());
diff --git a/src/Lucene.Net.Tests.Queries/BoostingQueryTest.cs b/src/Lucene.Net.Tests.Queries/BoostingQueryTest.cs
index d890a26..56231d7 100644
--- a/src/Lucene.Net.Tests.Queries/BoostingQueryTest.cs
+++ b/src/Lucene.Net.Tests.Queries/BoostingQueryTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Index;
 using Lucene.Net.Queries;
 using Lucene.Net.Search;
 using Lucene.Net.Util;
diff --git a/src/Lucene.Net.Tests.Queries/ChainedFilterTest.cs b/src/Lucene.Net.Tests.Queries/ChainedFilterTest.cs
index 5564420..6290fb4 100644
--- a/src/Lucene.Net.Tests.Queries/ChainedFilterTest.cs
+++ b/src/Lucene.Net.Tests.Queries/ChainedFilterTest.cs
@@ -1,4 +1,5 @@
-using System;
+// Lucene version compatibility level 4.8.1
+using System;
 using System.Globalization;
 using Lucene.Net.Documents;
 using Lucene.Net.Index;
@@ -81,8 +82,10 @@ namespace Lucene.Net.Tests.Queries
             // just treat dates as strings and select the whole range for now...
             dateFilter = TermRangeFilter.NewStringRange("date", "", "ZZZZ", true, true);
 
-            bobFilter = new QueryWrapperFilter(new TermQuery(new Term("owner", "bob")));
-            sueFilter = new QueryWrapperFilter(new TermQuery(new Term("owner", "sue")));
+            bobFilter = new QueryWrapperFilter(
+                new TermQuery(new Term("owner", "bob")));
+            sueFilter = new QueryWrapperFilter(
+                new TermQuery(new Term("owner", "sue")));
         }
 
         [TearDown]
@@ -136,7 +139,8 @@ namespace Lucene.Net.Tests.Queries
         [Test]
         public virtual void TestOR()
         {
-            ChainedFilter chain = GetChainedFilter(new Filter[] { sueFilter, bobFilter }, null);
+            ChainedFilter chain = GetChainedFilter(
+                new Filter[] { sueFilter, bobFilter }, null);
 
             int numHits = searcher.Search(query, chain, 1000).TotalHits;
             assertEquals("OR matches all", Max, numHits);
@@ -145,7 +149,8 @@ namespace Lucene.Net.Tests.Queries
         [Test]
         public virtual void TestAND()
         {
-            ChainedFilter chain = GetChainedFilter(new Filter[] { dateFilter, bobFilter }, ChainedFilter.AND);
+            ChainedFilter chain = GetChainedFilter(
+                new Filter[] { dateFilter, bobFilter }, ChainedFilter.AND);
 
             TopDocs hits = searcher.Search(query, chain, 1000);
             assertEquals("AND matches just bob", Max / 2, hits.TotalHits);
@@ -155,7 +160,8 @@ namespace Lucene.Net.Tests.Queries
         [Test]
         public virtual void TestXOR()
         {
-            ChainedFilter chain = GetChainedFilter(new Filter[] { dateFilter, bobFilter }, ChainedFilter.XOR);
+            ChainedFilter chain = GetChainedFilter(
+                new Filter[] { dateFilter, bobFilter }, ChainedFilter.XOR);
 
             TopDocs hits = searcher.Search(query, chain, 1000);
             assertEquals("XOR matches sue", Max / 2, hits.TotalHits);
@@ -165,7 +171,8 @@ namespace Lucene.Net.Tests.Queries
         [Test]
         public virtual void TestANDNOT()
         {
-            ChainedFilter chain = GetChainedFilter(new Filter[] { dateFilter, sueFilter }, new int[] { ChainedFilter.AND, ChainedFilter.ANDNOT });
+            ChainedFilter chain = GetChainedFilter(
+                new Filter[] { dateFilter, sueFilter }, new int[] { ChainedFilter.AND, ChainedFilter.ANDNOT });
 
             TopDocs hits = searcher.Search(query, chain, 1000);
             assertEquals("ANDNOT matches just bob", Max / 2, hits.TotalHits);
diff --git a/src/Lucene.Net.Tests.Queries/CommonTermsQueryTest.cs b/src/Lucene.Net.Tests.Queries/CommonTermsQueryTest.cs
index ddaf36f..822530e 100644
--- a/src/Lucene.Net.Tests.Queries/CommonTermsQueryTest.cs
+++ b/src/Lucene.Net.Tests.Queries/CommonTermsQueryTest.cs
@@ -1,4 +1,5 @@
-using System;
+// Lucene version compatibility level 4.8.1
+using System;
 using System.Collections.Generic;
 using Lucene.Net.Analysis;
 using Lucene.Net.Documents;
@@ -43,7 +44,8 @@ namespace Lucene.Net.Tests.Queries
                 Random, dir, analyzer);
             var docs = new string[]
             {
-                @"this is the end of the world right", @"is this it or maybe not",
+                @"this is the end of the world right",
+                @"is this it or maybe not",
                 @"this is the end of the universe as we know it",
                 @"there is the famous restaurant at the end of the universe"
             };
@@ -59,7 +61,7 @@ namespace Lucene.Net.Tests.Queries
             IndexReader r = w.GetReader();
             IndexSearcher s = NewSearcher(r);
             {
-                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD, Random.NextBoolean() ? 2F : 0.5F);
+                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD, Random.NextBoolean() ? 2.0f : 0.5f);
                 query.Add(new Term("field", "is"));
                 query.Add(new Term("field", "this"));
                 query.Add(new Term("field", "end"));
@@ -73,8 +75,8 @@ namespace Lucene.Net.Tests.Queries
                 assertEquals(@"3", r.Document(search.ScoreDocs[2].Doc).Get(@"id"));
             }
 
-            {
-                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD, Random.NextBoolean() ? 2F : 0.5F);
+            { // only high freq
+                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD, Random.NextBoolean() ? 2.0f : 0.5f);
                 query.Add(new Term("field", "is"));
                 query.Add(new Term("field", "this"));
                 query.Add(new Term("field", "end"));
@@ -84,21 +86,23 @@ namespace Lucene.Net.Tests.Queries
                 assertEquals(@"2", r.Document(search.ScoreDocs[1].Doc).Get(@"id"));
             }
 
-            {
-                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.MUST, Random.NextBoolean() ? 2F : 0.5F);
+            { // low freq is mandatory
+                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.MUST, Random.NextBoolean() ? 2.0f : 0.5f);
                 query.Add(new Term("field", "is"));
                 query.Add(new Term("field", "this"));
                 query.Add(new Term("field", "end"));
                 query.Add(new Term("field", "world"));
+
                 TopDocs search = s.Search(query, 10);
                 assertEquals(search.TotalHits, 1);
                 assertEquals(@"0", r.Document(search.ScoreDocs[0].Doc).Get(@"id"));
             }
 
-            {
-                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.MUST, Random.NextBoolean() ? 2F : 0.5F);
+            { // low freq is mandatory
+                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.MUST, Random.NextBoolean() ? 2.0f : 0.5f);
                 query.Add(new Term("field", "restaurant"));
                 query.Add(new Term("field", "universe"));
+
                 TopDocs search = s.Search(query, 10);
                 assertEquals(search.TotalHits, 1);
                 assertEquals(@"3", r.Document(search.ScoreDocs[0].Doc).Get(@"id"));
@@ -112,33 +116,40 @@ namespace Lucene.Net.Tests.Queries
         [Test]
         public void TestEqualsHashCode()
         {
-            CommonTermsQuery query = new CommonTermsQuery(RandomOccur(Random), RandomOccur(Random), Random.NextSingle(), Random.NextBoolean());
+            CommonTermsQuery query = new CommonTermsQuery(RandomOccur(Random),
+                RandomOccur(Random), Random.NextSingle(), Random.NextBoolean());
             int terms = AtLeast(2);
             for (int i = 0; i < terms; i++)
             {
-                query.Add(new Term(TestUtil.RandomRealisticUnicodeString(Random), TestUtil.RandomRealisticUnicodeString(Random)));
+                query.Add(new Term(TestUtil.RandomRealisticUnicodeString(Random),
+                    TestUtil.RandomRealisticUnicodeString(Random)));
             }
 
             QueryUtils.CheckHashEquals(query);
-            QueryUtils.CheckUnequal(new CommonTermsQuery(RandomOccur(Random), RandomOccur(Random), Random.NextSingle(), Random.NextBoolean()), query);
+            QueryUtils.CheckUnequal(new CommonTermsQuery(RandomOccur(Random),
+                RandomOccur(Random), Random.NextSingle(), Random.NextBoolean()), query);
             {
                 long seed = Random.NextInt64();
                 Random r = new Random((int)seed);
-                CommonTermsQuery left = new CommonTermsQuery(RandomOccur(r), RandomOccur(r), r.NextSingle(), r.NextBoolean());
+                CommonTermsQuery left = new CommonTermsQuery(RandomOccur(r),
+                    RandomOccur(r), r.NextSingle(), r.NextBoolean());
                 int leftTerms = AtLeast(r, 2);
                 for (int i = 0; i < leftTerms; i++)
                 {
-                    left.Add(new Term(TestUtil.RandomRealisticUnicodeString(r), TestUtil.RandomRealisticUnicodeString(r)));
+                    left.Add(new Term(TestUtil.RandomRealisticUnicodeString(r),
+                        TestUtil.RandomRealisticUnicodeString(r)));
                 }
 
                 left.HighFreqMinimumNumberShouldMatch = r.nextInt(4);
                 left.LowFreqMinimumNumberShouldMatch = r.nextInt(4);
                 r = new Random((int)seed);
-                CommonTermsQuery right = new CommonTermsQuery(RandomOccur(r), RandomOccur(r), r.NextSingle(), r.NextBoolean());
+                CommonTermsQuery right = new CommonTermsQuery(RandomOccur(r),
+                    RandomOccur(r), r.NextSingle(), r.NextBoolean());
                 int rightTerms = AtLeast(r, 2);
                 for (int i = 0; i < rightTerms; i++)
                 {
-                    right.Add(new Term(TestUtil.RandomRealisticUnicodeString(r), TestUtil.RandomRealisticUnicodeString(r)));
+                    right.Add(new Term(TestUtil.RandomRealisticUnicodeString(r),
+                        TestUtil.RandomRealisticUnicodeString(r)));
                 }
 
                 right.HighFreqMinimumNumberShouldMatch = r.nextInt(4);
@@ -156,7 +167,8 @@ namespace Lucene.Net.Tests.Queries
         public void TestNullTerm()
         {
             Random random = Random;
-            CommonTermsQuery query = new CommonTermsQuery(RandomOccur(random), RandomOccur(random), Random.NextSingle());
+            CommonTermsQuery query = new CommonTermsQuery(RandomOccur(random),
+                RandomOccur(random), Random.NextSingle());
             try
             {
                 query.Add(null);
@@ -181,7 +193,8 @@ namespace Lucene.Net.Tests.Queries
                 Random, dir, analyzer);
             string[] docs = new string[]
             {
-                @"this is the end of the world right", @"is this it or maybe not",
+                @"this is the end of the world right",
+                @"is this it or maybe not",
                 @"this is the end of the universe as we know it",
                 @"there is the famous restaurant at the end of the universe"
             };
@@ -197,42 +210,45 @@ namespace Lucene.Net.Tests.Queries
             IndexReader r = w.GetReader();
             IndexSearcher s = NewSearcher(r);
             {
-                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD, Random.NextBoolean() ? 2F : 0.5F);
+                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD,
+                    Random.NextBoolean() ? 2.0f : 0.5f);
                 query.Add(new Term("field", "is"));
                 query.Add(new Term("field", "this"));
                 query.Add(new Term("field", "end"));
                 query.Add(new Term("field", "world"));
                 query.Add(new Term("field", "universe"));
                 query.Add(new Term("field", "right"));
-                query.LowFreqMinimumNumberShouldMatch = 0.5F;
+                query.LowFreqMinimumNumberShouldMatch = 0.5f;
                 TopDocs search = s.Search(query, 10);
                 assertEquals(search.TotalHits, 1);
                 assertEquals(@"0", r.Document(search.ScoreDocs[0].Doc).Get(@"id"));
             }
 
             {
-                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD, Random.NextBoolean() ? 2F : 0.5F);
+                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD,
+                    Random.NextBoolean() ? 2.0f : 0.5f);
                 query.Add(new Term("field", "is"));
                 query.Add(new Term("field", "this"));
                 query.Add(new Term("field", "end"));
                 query.Add(new Term("field", "world"));
                 query.Add(new Term("field", "universe"));
                 query.Add(new Term("field", "right"));
-                query.LowFreqMinimumNumberShouldMatch = 2F;
+                query.LowFreqMinimumNumberShouldMatch = 2.0f;
                 TopDocs search = s.Search(query, 10);
                 assertEquals(search.TotalHits, 1);
                 assertEquals(@"0", r.Document(search.ScoreDocs[0].Doc).Get(@"id"));
             }
 
             {
-                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD, Random.NextBoolean() ? 2F : 0.5F);
+                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD,
+                    Random.NextBoolean() ? 2.0f : 0.5f);
                 query.Add(new Term("field", "is"));
                 query.Add(new Term("field", "this"));
                 query.Add(new Term("field", "end"));
                 query.Add(new Term("field", "world"));
                 query.Add(new Term("field", "universe"));
                 query.Add(new Term("field", "right"));
-                query.LowFreqMinimumNumberShouldMatch = 0.49F;
+                query.LowFreqMinimumNumberShouldMatch = 0.49f;
                 TopDocs search = s.Search(query, 10);
                 assertEquals(search.TotalHits, 3);
                 assertEquals(@"0", r.Document(search.ScoreDocs[0].Doc).Get(@"id"));
@@ -241,14 +257,15 @@ namespace Lucene.Net.Tests.Queries
             }
 
             {
-                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD, Random.NextBoolean() ? 2F : 0.5F);
+                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD,
+                    Random.NextBoolean() ? 2.0f : 0.5f);
                 query.Add(new Term("field", "is"));
                 query.Add(new Term("field", "this"));
                 query.Add(new Term("field", "end"));
                 query.Add(new Term("field", "world"));
                 query.Add(new Term("field", "universe"));
                 query.Add(new Term("field", "right"));
-                query.LowFreqMinimumNumberShouldMatch = 1F;
+                query.LowFreqMinimumNumberShouldMatch = 1.0f;
                 TopDocs search = s.Search(query, 10);
                 assertEquals(search.TotalHits, 3);
                 assertEquals(@"0", r.Document(search.ScoreDocs[0].Doc).Get(@"id"));
@@ -258,48 +275,58 @@ namespace Lucene.Net.Tests.Queries
             }
 
             {
-                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD, Random.NextBoolean() ? 2F : 0.5F);
+                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD,
+                    Random.NextBoolean() ? 2.0f : 0.5f);
                 query.Add(new Term("field", "is"));
                 query.Add(new Term("field", "this"));
                 query.Add(new Term("field", "end"));
                 query.Add(new Term("field", "world"));
                 query.Add(new Term("field", "universe"));
                 query.Add(new Term("field", "right"));
-                query.LowFreqMinimumNumberShouldMatch = 1F;
-                query.HighFreqMinimumNumberShouldMatch = 4F;
+                query.LowFreqMinimumNumberShouldMatch = 1.0f;
+                query.HighFreqMinimumNumberShouldMatch = 4.0f;
                 TopDocs search = s.Search(query, 10);
                 assertEquals(search.TotalHits, 3);
-                assertEquals(search.ScoreDocs[1].Score, search.ScoreDocs[2].Score, 0F);
+                assertEquals(search.ScoreDocs[1].Score, search.ScoreDocs[2].Score, 0.0f);
                 assertEquals(@"0", r.Document(search.ScoreDocs[0].Doc).Get(@"id"));
+                // doc 2 and 3 only get a score from low freq terms
                 assertEquals(
                     new JCG.HashSet<string> { @"2", @"3" },
-                    new JCG.HashSet<string> { r.Document(search.ScoreDocs[1].Doc).Get(@"id"), r.Document(search.ScoreDocs[2].Doc).Get(@"id") },
+                    new JCG.HashSet<string> {
+                        r.Document(search.ScoreDocs[1].Doc).Get(@"id"),
+                        r.Document(search.ScoreDocs[2].Doc).Get(@"id") },
                     aggressive: false);
             }
 
             {
-                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD, Random.NextBoolean() ? 2F : 0.5F);
+                // only high freq terms around - check that min should match is applied
+                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD,
+                    Random.NextBoolean() ? 2.0f : 0.5f);
                 query.Add(new Term("field", "is"));
                 query.Add(new Term("field", "this"));
                 query.Add(new Term("field", "the"));
-                query.LowFreqMinimumNumberShouldMatch = 1F;
-                query.HighFreqMinimumNumberShouldMatch = 2F;
+                query.LowFreqMinimumNumberShouldMatch = 1.0f;
+                query.HighFreqMinimumNumberShouldMatch = 2.0f;
                 TopDocs search = s.Search(query, 10);
                 assertEquals(search.TotalHits, 4);
             }
 
             {
-                CommonTermsQuery query = new CommonTermsQuery(Occur.MUST, Occur.SHOULD, Random.NextBoolean() ? 2F : 0.5F);
+                // only high freq terms around - check that min should match is applied
+                CommonTermsQuery query = new CommonTermsQuery(Occur.MUST, Occur.SHOULD,
+                    Random.NextBoolean() ? 2.0f : 0.5f);
                 query.Add(new Term("field", "is"));
                 query.Add(new Term("field", "this"));
                 query.Add(new Term("field", "the"));
-                query.LowFreqMinimumNumberShouldMatch = 1F;
-                query.HighFreqMinimumNumberShouldMatch = 2F;
+                query.LowFreqMinimumNumberShouldMatch = 1.0f;
+                query.HighFreqMinimumNumberShouldMatch = 2.0f;
                 TopDocs search = s.Search(query, 10);
                 assertEquals(search.TotalHits, 2);
                 assertEquals(
                     new JCG.HashSet<string> { @"0", @"2" },
-                    new JCG.HashSet<string> { r.Document(search.ScoreDocs[0].Doc).Get(@"id"), r.Document(search.ScoreDocs[1].Doc).Get(@"id") },
+                    new JCG.HashSet<string> {
+                        r.Document(search.ScoreDocs[0].Doc).Get(@"id"),
+                        r.Document(search.ScoreDocs[1].Doc).Get(@"id") },
                     aggressive: false);
             }
 
@@ -347,11 +374,11 @@ namespace Lucene.Net.Tests.Queries
                 Random, dir, analyzer);
             var docs = new string[]
             {
-                @"this is the end of the world right", @"is this it or maybe not",
+                @"this is the end of the world right",
+                @"is this it or maybe not",
                 @"this is the end of the universe as we know it",
                 @"there is the famous restaurant at the end of the universe"
             };
-
             for (int i = 0; i < docs.Length; i++)
             {
                 Document doc = new Document();
@@ -363,7 +390,8 @@ namespace Lucene.Net.Tests.Queries
             IndexReader r = w.GetReader();
             IndexSearcher s = NewSearcher(r);
             {
-                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD, Random.NextBoolean() ? 2F : 0.5F);
+                CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD,
+                    Random.NextBoolean() ? 2.0f : 0.5f);
                 query.Add(new Term("field", "is"));
                 query.Add(new Term("field", "this"));
                 query.Add(new Term("field", "end"));
@@ -378,7 +406,9 @@ namespace Lucene.Net.Tests.Queries
             }
 
             {
-                CommonTermsQuery query = new ExtendedCommonTermsQuery(Occur.SHOULD, Occur.SHOULD, Random.NextBoolean() ? 2F : 0.5F);
+                // this one boosts the termQuery("field" "universe") by 10x
+                CommonTermsQuery query = new ExtendedCommonTermsQuery(Occur.SHOULD, Occur.SHOULD,
+                    Random.NextBoolean() ? 2.0f : 0.5f);
                 query.Add(new Term("field", "is"));
                 query.Add(new Term("field", "this"));
                 query.Add(new Term("field", "end"));
@@ -413,8 +443,8 @@ namespace Lucene.Net.Tests.Queries
             AtomicReader wrapper = SlowCompositeReaderWrapper.Wrap(reader);
             string field = @"body";
             Terms terms = wrapper.GetTerms(field);
-            var lowFreqQueue = new AnonymousPriorityQueue(5);
-            Util.PriorityQueue<TermAndFreq> highFreqQueue = new AnonymousPriorityQueue1(5);
+            var lowFreqQueue = new PriorityQueueAnonymousClass(5);
+            var highFreqQueue = new PriorityQueueAnonymousClass1(5);
             try
             {
                 TermsEnum iterator = terms.GetEnumerator();
@@ -422,8 +452,10 @@ namespace Lucene.Net.Tests.Queries
                 {
                     if (highFreqQueue.Count < 5)
                     {
-                        highFreqQueue.Add(new TermAndFreq(BytesRef.DeepCopyOf(iterator.Term), iterator.DocFreq));
-                        lowFreqQueue.Add(new TermAndFreq(BytesRef.DeepCopyOf(iterator.Term), iterator.DocFreq));
+                        highFreqQueue.Add(new TermAndFreq(
+                            BytesRef.DeepCopyOf(iterator.Term), iterator.DocFreq));
+                        lowFreqQueue.Add(new TermAndFreq(
+                            BytesRef.DeepCopyOf(iterator.Term), iterator.DocFreq));
                     }
                     else
                     {
@@ -448,22 +480,25 @@ namespace Lucene.Net.Tests.Queries
                 AssumeTrue(@"unlucky index", highFreq - 1 > lowFreq);
                 List<TermAndFreq> highTerms = QueueToList(highFreqQueue);
                 List<TermAndFreq> lowTerms = QueueToList(lowFreqQueue);
+
                 IndexSearcher searcher = NewSearcher(reader);
                 Occur lowFreqOccur = RandomOccur(Random);
                 BooleanQuery verifyQuery = new BooleanQuery();
-                CommonTermsQuery cq = new CommonTermsQuery(RandomOccur(Random), lowFreqOccur, highFreq - 1, Random.NextBoolean());
+                CommonTermsQuery cq = new CommonTermsQuery(RandomOccur(Random),
+                    lowFreqOccur, highFreq - 1, Random.NextBoolean());
                 foreach (TermAndFreq termAndFreq in lowTerms)
                 {
                     cq.Add(new Term(field, termAndFreq.term));
-                    verifyQuery.Add(new BooleanClause(new TermQuery(new Term(field, termAndFreq.term)), lowFreqOccur));
+                    verifyQuery.Add(new BooleanClause(new TermQuery(new Term(field,
+                        termAndFreq.term)), lowFreqOccur));
                 }
-
                 foreach (TermAndFreq termAndFreq in highTerms)
                 {
                     cq.Add(new Term(field, termAndFreq.term));
                 }
 
                 TopDocs cqSearch = searcher.Search(cq, reader.MaxDoc);
+
                 TopDocs verifySearch = searcher.Search(verifyQuery, reader.MaxDoc);
                 assertEquals(verifySearch.TotalHits, cqSearch.TotalHits);
                 var hits = new JCG.HashSet<int>();
@@ -478,6 +513,13 @@ namespace Lucene.Net.Tests.Queries
                 }
 
                 assertTrue(hits.Count == 0);
+
+                /*
+                 *  need to force merge here since QueryUtils adds checks based
+                 *  on leave readers which have different statistics than the top
+                 *  level reader if we have more than one segment. This could 
+                 *  result in a different query / results.
+                 */
                 w.ForceMerge(1);
                 DirectoryReader reader2 = w.GetReader();
                 QueryUtils.Check(
@@ -496,9 +538,9 @@ namespace Lucene.Net.Tests.Queries
             }
         }
 
-        private sealed class AnonymousPriorityQueue : Util.PriorityQueue<TermAndFreq>
+        private sealed class PriorityQueueAnonymousClass : Util.PriorityQueue<TermAndFreq>
         {
-            public AnonymousPriorityQueue(int maxSize)
+            public PriorityQueueAnonymousClass(int maxSize)
                 : base(maxSize)
             {
             }
@@ -509,9 +551,9 @@ namespace Lucene.Net.Tests.Queries
             }
         }
 
-        private sealed class AnonymousPriorityQueue1 : Util.PriorityQueue<TermAndFreq>
+        private sealed class PriorityQueueAnonymousClass1 : Util.PriorityQueue<TermAndFreq>
         {
-            public AnonymousPriorityQueue1(int maxSize)
+            public PriorityQueueAnonymousClass1(int maxSize)
                 : base(maxSize)
             {
             }
@@ -550,11 +592,19 @@ namespace Lucene.Net.Tests.Queries
             }
         }
 
+        /// <summary>
+        /// populates a writer with random stuff. this must be fully reproducable with
+        /// the seed!
+        /// </summary>
         public static void CreateRandomIndex(int numdocs, RandomIndexWriter writer, long seed)
         {
             Random random = new Random((int)seed);
             // primary source for our data is from linefiledocs, its realistic.
             LineFileDocs lineFileDocs = new LineFileDocs(random, false); // no docvalues in 4x
+
+            // TODO: we should add other fields that use things like docs&freqs but omit
+            // positions,
+            // because linefiledocs doesn't cover all the possibilities.
             for (int i = 0; i < numdocs; i++)
             {
                 writer.AddDocument(lineFileDocs.NextDoc());
@@ -575,7 +625,7 @@ namespace Lucene.Net.Tests.Queries
                 Query query = base.NewTermQuery(term, context);
                 if (term.Text().Equals(@"universe", StringComparison.Ordinal))
                 {
-                    query.Boost = 100F;
+                    query.Boost = 100f;
                 }
 
                 return query;
diff --git a/src/Lucene.Net.Tests.Queries/Function/FunctionTestSetup.cs b/src/Lucene.Net.Tests.Queries/Function/FunctionTestSetup.cs
index e4f3737..c445a72 100644
--- a/src/Lucene.Net.Tests.Queries/Function/FunctionTestSetup.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/FunctionTestSetup.cs
@@ -1,4 +1,5 @@
-using System;
+// Lucene version compatibility level 4.8.1
+using System;
 using Lucene.Net.Analysis;
 using Lucene.Net.Documents;
 using Lucene.Net.Index;
@@ -39,22 +40,22 @@ namespace Lucene.Net.Tests.Queries.Function
         /// Actual score computation order is slightly different than assumptios
         /// this allows for a small amount of variation
         /// </summary>
-        protected internal static float TEST_SCORE_TOLERANCE_DELTA = 0.001f;
+        protected const float TEST_SCORE_TOLERANCE_DELTA = 0.001f;
 
-        protected internal const int N_DOCS = 17; // select a primary number > 2
+        protected const int N_DOCS = 17; // select a primary number > 2
 
-        protected internal const string ID_FIELD = "id";
-        protected internal const string TEXT_FIELD = "text";
-        protected internal const string INT_FIELD = "iii";
-        protected internal const string FLOAT_FIELD = "fff";
+        protected const string ID_FIELD = "id";
+        protected const string TEXT_FIELD = "text";
+        protected const string INT_FIELD = "iii";
+        protected const string FLOAT_FIELD = "fff";
 
 #pragma warning disable 612, 618
-        protected internal ValueSource BYTE_VALUESOURCE = new ByteFieldSource(INT_FIELD);
-        protected internal ValueSource SHORT_VALUESOURCE = new Int16FieldSource(INT_FIELD);
+        protected ValueSource BYTE_VALUESOURCE = new ByteFieldSource(INT_FIELD);
+        protected ValueSource SHORT_VALUESOURCE = new Int16FieldSource(INT_FIELD);
 #pragma warning restore 612, 618
-        protected internal ValueSource INT_VALUESOURCE = new Int32FieldSource(INT_FIELD);
-        protected internal ValueSource INT_AS_FLOAT_VALUESOURCE = new SingleFieldSource(INT_FIELD);
-        protected internal ValueSource FLOAT_VALUESOURCE = new SingleFieldSource(FLOAT_FIELD);
+        protected ValueSource INT_VALUESOURCE = new Int32FieldSource(INT_FIELD);
+        protected ValueSource INT_AS_FLOAT_VALUESOURCE = new SingleFieldSource(INT_FIELD);
+        protected ValueSource FLOAT_VALUESOURCE = new SingleFieldSource(FLOAT_FIELD);
 
         private static readonly string[] DOC_TEXT_LINES =
         {
@@ -74,8 +75,8 @@ namespace Lucene.Net.Tests.Queries.Function
             "text for the test, but oh much much safer. "
         };
 
-        protected internal static Directory dir;
-        protected internal static Analyzer anlzr;
+        protected static Directory dir;
+        protected static Analyzer anlzr;
 
         [TearDown]
         public override void TearDown()
@@ -135,11 +136,7 @@ namespace Lucene.Net.Tests.Queries.Function
             }
         }
 
-        /// <summary>
-        /// LUCENENET specific
-        /// Non-static because NewField is now non-static
-        /// </summary>
-        private void AddDoc(RandomIndexWriter iw, int i)
+        private static void AddDoc(RandomIndexWriter iw, int i)
         {
             Document d = new Document();
             Field f;
@@ -168,7 +165,7 @@ namespace Lucene.Net.Tests.Queries.Function
         }
 
         // 17 --> ID00017
-        protected internal static string Id2String(int scoreAndID)
+        protected static string Id2String(int scoreAndID)
         {
             string s = "000000000" + scoreAndID;
             int n = ("" + N_DOCS).Length + 3;
@@ -183,13 +180,13 @@ namespace Lucene.Net.Tests.Queries.Function
         }
 
         // extract expected doc score from its ID Field: "ID7" --> 7.0
-        protected internal static float ExpectedFieldScore(string docIDFieldVal)
+        protected static float ExpectedFieldScore(string docIDFieldVal)
         {
             return Convert.ToSingle(docIDFieldVal.Substring(2));
         }
 
         // debug messages (change DBG to true for anything to print)
-        protected internal static void Log(object o)
+        protected static void Log(object o)
         {
             if (Verbose)
             {
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestBoostedQuery.cs b/src/Lucene.Net.Tests.Queries/Function/TestBoostedQuery.cs
index dc82e18..70caf92 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestBoostedQuery.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestBoostedQuery.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Analysis;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Analysis;
 using Lucene.Net.Documents;
 using Lucene.Net.Index;
 using Lucene.Net.Index.Extensions;
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs b/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs
index cf27cbd..9afd780 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Analysis;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Analysis;
 using Lucene.Net.Documents;
 using Lucene.Net.Index;
 using Lucene.Net.Queries.Function;
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs b/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs
index bdb2e6b..4cb8df9 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs
@@ -1,4 +1,5 @@
-using J2N.Text;
+// Lucene version compatibility level 4.8.1
+using J2N.Text;
 using Lucene.Net.Index;
 using Lucene.Net.Queries.Function;
 using Lucene.Net.Search;
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestFunctionQuerySort.cs b/src/Lucene.Net.Tests.Queries/Function/TestFunctionQuerySort.cs
index 768dd6f..13848da 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestFunctionQuerySort.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestFunctionQuerySort.cs
@@ -1,4 +1,6 @@
-using System;
+// Lucene version compatibility level 4.8.1
+using System;
+using System.Globalization;
 using Lucene.Net.Documents;
 using Lucene.Net.Index;
 using Lucene.Net.Index.Extensions;
@@ -48,7 +50,7 @@ namespace Lucene.Net.Tests.Queries.Function
             const int NUM_VALS = 5;
             for (int val = NUM_VALS; val > 0; val--)
             {
-                field.SetStringValue(Convert.ToString(val));
+                field.SetStringValue(Convert.ToString(val, CultureInfo.InvariantCulture));
                 writer.AddDocument(doc);
             }
 
@@ -87,7 +89,7 @@ namespace Lucene.Net.Tests.Queries.Function
             int afterValue = (int)((double?)afterHit.Fields[0]);
             foreach (ScoreDoc hit in hits.ScoreDocs)
             {
-                int val = Convert.ToInt32(reader.Document(hit.Doc).Get("value"));
+                int val = Convert.ToInt32(reader.Document(hit.Doc).Get("value"), CultureInfo.InvariantCulture);
                 assertTrue(afterValue <= val);
                 assertFalse(hit.Doc == afterHit.Doc);
             }
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestLongNormValueSource.cs b/src/Lucene.Net.Tests.Queries/Function/TestLongNormValueSource.cs
index 753d06f..19ff987 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestLongNormValueSource.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestLongNormValueSource.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Analysis;
+// Lucene version compatibility level 4.8.1
+using Lucene.Net.Analysis;
 using Lucene.Net.Documents;
 using Lucene.Net.Index;
 using Lucene.Net.Index.Extensions;
@@ -81,7 +82,9 @@ namespace Lucene.Net.Tests.Queries.Function
             {
                 // no norm field (so agnostic to indexed similarity)
                 searcher.Similarity = sim;
-                AssertHits(new FunctionQuery(new NormValueSource("text")), new float[] { 0f, 0f });
+                AssertHits(new FunctionQuery(
+                    new NormValueSource("text")),
+                    new float[] { 0f, 0f });
             }
             finally
             {
@@ -89,7 +92,7 @@ namespace Lucene.Net.Tests.Queries.Function
             }
         }
         
-        protected virtual void AssertHits(Query q, float[] scores)
+        internal void AssertHits(Query q, float[] scores)
         {
             ScoreDoc[] expected = new ScoreDoc[scores.Length];
             int[] expectedDocs = new int[scores.Length];
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs b/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs
index ef5c41b..baadaa5 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs
@@ -1,4 +1,5 @@
-using J2N.Text;
+// Lucene version compatibility level 4.8.1
+using J2N.Text;
 using Lucene.Net.Index;
 using Lucene.Net.Queries.Function;
 using Lucene.Net.Queries.Function.ValueSources;
@@ -91,7 +92,9 @@ namespace Lucene.Net.Tests.Queries.Function
                 Random, q, s);
             ScoreDoc[] h = s.Search(q, null, 1000).ScoreDocs;
             assertEquals("All docs should be matched!", N_DOCS, h.Length);
-            string prevID = inOrder ? "IE" : "IC"; // smaller than all ids of docs in this test ("ID0001", etc.) -  greater than all ids of docs in this test ("ID0001", etc.)
+            string prevID = inOrder
+                ? "IE"  // greater than all ids of docs in this test ("ID0001", etc.)
+                : "IC"; // smaller than all ids of docs in this test ("ID0001", etc.)
 
             for (int i = 0; i < h.Length; i++)
             {
@@ -160,7 +163,9 @@ namespace Lucene.Net.Tests.Queries.Function
                 Log(s.Explain(q, sd[i].Doc));
                 float expectedScore = N_DOCS - i - 1;
                 assertEquals("score of result " + i + " shuould be " + expectedScore + " != " + score, expectedScore, score, TEST_SCORE_TOLERANCE_DELTA);
-                string expectedId = inOrder ? Id2String(N_DOCS - i) : Id2String(i + 1); // reverse  ==> smaller values first -  in-order ==> larger  values first
+                string expectedId = inOrder
+                    ? Id2String(N_DOCS - i) // in-order ==> larger  values first
+                    : Id2String(i + 1);     // reverse  ==> smaller values first
                 assertTrue("id of result " + i + " shuould be " + expectedId + " != " + score, expectedId.Equals(id, StringComparison.Ordinal));
             }
             r.Dispose();
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs b/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs
index 96943f6..07a8fb7 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs
@@ -1,4 +1,5 @@
-using System;
+// Lucene version compatibility level 4.8.1
+using System;
 using System.Collections.Generic;
 using Lucene.Net.Analysis;
 using Lucene.Net.Codecs;
@@ -112,44 +113,53 @@ namespace Lucene.Net.Tests.Queries.Function
         public void TestByte()
         {
 #pragma warning disable 612, 618
-            AssertHits(new FunctionQuery(new ByteFieldSource("byte")), new[] { 5f, 12f });
+            AssertHits(new FunctionQuery(new ByteFieldSource("byte")),
+                new[] { 5f, 12f });
 #pragma warning restore 612, 618
         }
 
         [Test]
         public void TestConst()
         {
-            AssertHits(new FunctionQuery(new ConstValueSource(0.3f)), new[] { 0.3f, 0.3f });
+            AssertHits(new FunctionQuery(new ConstValueSource(0.3f)),
+                new[] { 0.3f, 0.3f });
         }
 
         [Test]
         public void TestDiv()
         {
-            AssertHits(new FunctionQuery(new DivSingleFunction(new ConstValueSource(10f), new ConstValueSource(5f))), new[] { 2f, 2f });
+            AssertHits(new FunctionQuery(new DivSingleFunction(
+                new ConstValueSource(10f), new ConstValueSource(5f))),
+                new[] { 2f, 2f });
         }
 
         [Test]
         public void TestDocFreq()
         {
-            AssertHits(new FunctionQuery(new DocFreqValueSource("bogus", "bogus", "text", new BytesRef("test"))), new[] { 2f, 2f });
+            AssertHits(new FunctionQuery(
+                new DocFreqValueSource("bogus", "bogus", "text", new BytesRef("test"))),
+                new[] { 2f, 2f });
         }
 
         [Test]
         public void TestDoubleConst()
         {
-            AssertHits(new FunctionQuery(new DoubleConstValueSource(0.3d)), new[] { 0.3f, 0.3f });
+            AssertHits(new FunctionQuery(new DoubleConstValueSource(0.3d)),
+                new[] { 0.3f, 0.3f });
         }
 
         [Test]
         public void TestDouble()
         {
-            AssertHits(new FunctionQuery(new DoubleFieldSource("double")), new[] { 3.63f, 5.65f });
+            AssertHits(new FunctionQuery(new DoubleFieldSource("double")),
+                new[] { 3.63f, 5.65f });
         }
 
         [Test]
         public void TestFloat()
         {
-            AssertHits(new FunctionQuery(new SingleFieldSource("float")), new[] { 5.2f, 9.3f });
+            AssertHits(new FunctionQuery(new SingleFieldSource("float")),
+                new[] { 5.2f, 9.3f });
         }
 
         [Test]
@@ -159,7 +169,8 @@ namespace Lucene.Net.Tests.Queries.Function
             try
             {
                 searcher.Similarity = new DefaultSimilarity();
-                AssertHits(new FunctionQuery(new IDFValueSource("bogus", "bogus", "text", new BytesRef("test"))), new[] { 0.5945349f, 0.5945349f });
+                AssertHits(new FunctionQuery(new IDFValueSource("bogus", "bogus", "text", new BytesRef("test"))),
+                    new[] { 0.5945349f, 0.5945349f });
             }
             finally
             {
@@ -170,53 +181,70 @@ namespace Lucene.Net.Tests.Queries.Function
         [Test]
         public void TestIf()
         {
-            AssertHits(new FunctionQuery(new IfFunction(new BytesRefFieldSource("id"), new ConstValueSource(1.0f), new ConstValueSource(2.0f)
-               )), new[] { 1f, 1f });
+            AssertHits(new FunctionQuery(new IfFunction(
+                new BytesRefFieldSource("id"),
+                new ConstValueSource(1.0f),
+                new ConstValueSource(2.0f)
+               )),
+               new[] { 1f, 1f });
             // true just if a value exists...
-            AssertHits(new FunctionQuery(new IfFunction(new LiteralValueSource("false"), new ConstValueSource(1.0f), new ConstValueSource(2.0f)
-               )), new[] { 1f, 1f });
+            AssertHits(new FunctionQuery(new IfFunction(
+                new LiteralValueSource("false"),
+                new ConstValueSource(1.0f),
+                new ConstValueSource(2.0f)
+               )),
+               new[] { 1f, 1f });
         }
 
         [Test]
         public void TestInt()
         {
-            AssertHits(new FunctionQuery(new Int32FieldSource("int")), new[] { 35f, 54f });
+            AssertHits(new FunctionQuery(new Int32FieldSource("int")),
+                new[] { 35f, 54f });
         }
 
         [Test]
         public void TestJoinDocFreq()
         {
-            AssertHits(new FunctionQuery(new JoinDocFreqValueSource("string", "text")), new[] { 2f, 0f });
+            AssertHits(new FunctionQuery(new JoinDocFreqValueSource("string", "text")),
+                new[] { 2f, 0f });
         }
 
         [Test]
         public void TestLinearFloat()
         {
-            AssertHits(new FunctionQuery(new LinearSingleFunction(new ConstValueSource(2.0f), 3, 1)), new[] { 7f, 7f });
+            AssertHits(new FunctionQuery(new LinearSingleFunction(new ConstValueSource(2.0f), 3, 1)),
+                new[] { 7f, 7f });
         }
 
         [Test]
         public void TestLong()
         {
-            AssertHits(new FunctionQuery(new Int64FieldSource("long")), new[] { 4343f, 1954f });
+            AssertHits(new FunctionQuery(new Int64FieldSource("long")),
+                new[] { 4343f, 1954f });
         }
 
         [Test]
         public void TestMaxDoc()
         {
-            AssertHits(new FunctionQuery(new MaxDocValueSource()), new[] { 2f, 2f });
+            AssertHits(new FunctionQuery(new MaxDocValueSource()),
+                new[] { 2f, 2f });
         }
 
         [Test]
         public void TestMaxFloat()
         {
-            AssertHits(new FunctionQuery(new MaxSingleFunction(new ValueSource[] { new ConstValueSource(1f), new ConstValueSource(2f) })), new[] { 2f, 2f });
+            AssertHits(new FunctionQuery(new MaxSingleFunction(new ValueSource[] {
+                new ConstValueSource(1f), new ConstValueSource(2f) })),
+                new[] { 2f, 2f });
         }
 
         [Test]
         public void TestMinFloat()
         {
-            AssertHits(new FunctionQuery(new MinSingleFunction(new ValueSource[] { new ConstValueSource(1f), new ConstValueSource(2f) })), new[] { 1f, 1f });
+            AssertHits(new FunctionQuery(new MinSingleFunction(new ValueSource[] {
+                new ConstValueSource(1f), new ConstValueSource(2f) })),
+                new[] { 1f, 1f });
         }
 
         [Test]
@@ -227,7 +255,8 @@ namespace Lucene.Net.Tests.Queries.Function
             {
                 // no norm field (so agnostic to indexed similarity)
                 searcher.Similarity = new DefaultSimilarity();
-                AssertHits(new FunctionQuery(new NormValueSource("byte")), new[] { 0f, 0f });
+                AssertHits(new FunctionQuery(new NormValueSource("byte")),
+                    new[] { 0f, 0f });
             }
             finally
             {
@@ -238,58 +267,77 @@ namespace Lucene.Net.Tests.Queries.Function
         [Test]
         public void TestNumDocs()
         {
-            AssertHits(new FunctionQuery(new NumDocsValueSource()), new[] { 2f, 2f });
+            AssertHits(new FunctionQuery(new NumDocsValueSource()),
+                new[] { 2f, 2f });
         }
 
         [Test]
         public void TestPow()
         {
-            AssertHits(new FunctionQuery(new PowSingleFunction(new ConstValueSource(2f), new ConstValueSource(3f))), new[] { 8f, 8f });
+            AssertHits(new FunctionQuery(new PowSingleFunction(
+                new ConstValueSource(2f), new ConstValueSource(3f))),
+                new[] { 8f, 8f });
         }
 
         [Test]
         public void TestProduct()
         {
-            AssertHits(new FunctionQuery(new ProductSingleFunction(new ValueSource[] { new ConstValueSource(2f), new ConstValueSource(3f) })), new[] { 6f, 6f });
+            AssertHits(new FunctionQuery(new ProductSingleFunction(
+                new ValueSource[] { new ConstValueSource(2f), new ConstValueSource(3f) })),
+                new[] { 6f, 6f });
         }
 
         [Test]
         public void TestQuery()
         {
-            AssertHits(new FunctionQuery(new QueryValueSource(new FunctionQuery(new ConstValueSource(2f)), 0f)), new[] { 2f, 2f });
+            AssertHits(new FunctionQuery(new QueryValueSource(
+                new FunctionQuery(new ConstValueSource(2f)), 0f)),
+                new[] { 2f, 2f });
         }
 
         [Test]
         public void TestRangeMap()
         {
-            AssertHits(new FunctionQuery(new RangeMapSingleFunction(new SingleFieldSource("float"), 5, 6, 1, 0f)), new[] { 1f, 0f });
-            AssertHits(new FunctionQuery(new RangeMapSingleFunction(new SingleFieldSource("float"), 5, 6, new SumSingleFunction(new ValueSource[] { new ConstValueSource(1f), new ConstValueSource(2f) }), new ConstValueSource(11f))), new[] { 3f, 11f });
+            AssertHits(new FunctionQuery(new RangeMapSingleFunction(new SingleFieldSource("float"),
+                5, 6, 1, 0f)),
+                new[] { 1f, 0f });
+            AssertHits(new FunctionQuery(new RangeMapSingleFunction(new SingleFieldSource("float"),
+                5, 6, new SumSingleFunction(new ValueSource[] { new ConstValueSource(1f), new ConstValueSource(2f) }),
+                new ConstValueSource(11f))),
+                new[] { 3f, 11f });
         }
 
         [Test]
         public void TestReciprocal()
         {
-            AssertHits(new FunctionQuery(new ReciprocalSingleFunction(new ConstValueSource(2f), 3, 1, 4)), new[] { 0.1f, 0.1f });
+            AssertHits(new FunctionQuery(new ReciprocalSingleFunction(new ConstValueSource(2f),
+                3, 1, 4)),
+                new[] { 0.1f, 0.1f });
         }
 
         [Test]
         public void TestScale()
         {
-            AssertHits(new FunctionQuery(new ScaleSingleFunction(new Int32FieldSource("int"), 0, 1)), new[] { 0.0f, 1.0f });
+            AssertHits(new FunctionQuery(new ScaleSingleFunction(new Int32FieldSource("int"),
+                0, 1)),
+                new[] { 0.0f, 1.0f });
         }
 
         [Test]
         public void TestShort()
         {
 #pragma warning disable 612, 618
-            AssertHits(new FunctionQuery(new Int16FieldSource("short")), new[] { 945f, 123f });
+            AssertHits(new FunctionQuery(new Int16FieldSource("short")),
+                new[] { 945f, 123f });
 #pragma warning restore 612, 618
         }
 
         [Test]
         public void TestSumFloat()
         {
-            AssertHits(new FunctionQuery(new SumSingleFunction(new ValueSource[] { new ConstValueSource(1f), new ConstValueSource(2f) })), new[] { 3f, 3f });
+            AssertHits(new FunctionQuery(new SumSingleFunction(new ValueSource[] {
+                new ConstValueSource(1f), new ConstValueSource(2f) })),
+                new[] { 3f, 3f });
         }
 
         [Test]
@@ -297,19 +345,25 @@ namespace Lucene.Net.Tests.Queries.Function
         {
             if (Codec.Default.Name.Equals("Lucene3x", StringComparison.Ordinal))
             {
-                AssertHits(new FunctionQuery(new SumTotalTermFreqValueSource("text")), new[] { -1f, -1f });
+                AssertHits(new FunctionQuery(new SumTotalTermFreqValueSource("text")),
+                    new[] { -1f, -1f });
             }
             else
             {
-                AssertHits(new FunctionQuery(new SumTotalTermFreqValueSource("text")), new[] { 8f, 8f });
+                AssertHits(new FunctionQuery(new SumTotalTermFreqValueSource("text")),
+                    new[] { 8f, 8f });
             }
         }
 
         [Test]
         public void TestTermFreq()
         {
-            AssertHits(new FunctionQuery(new TermFreqValueSource("bogus", "bogus", "text", new BytesRef("test"))), new[] { 3f, 1f });
-            AssertHits(new FunctionQuery(new TermFreqValueSource("bogus", "bogus", "string", new BytesRef("bar"))), new[] { 0f, 1f });
+            AssertHits(new FunctionQuery(
+                new TermFreqValueSource("bogus", "bogus", "text", new BytesRef("test"))),
+                new[] { 3f, 1f });
+            AssertHits(new FunctionQuery(
+                new TermFreqValueSource("bogus", "bogus", "string", new BytesRef("bar"))),
+                new[] { 0f, 1f });
         }
 
         [Test]
@@ -320,8 +374,12 @@ namespace Lucene.Net.Tests.Queries.Function
             {
                 // no norm field (so agnostic to indexed similarity)
                 searcher.Similarity = new DefaultSimilarity();
-                AssertHits(new FunctionQuery(new TFValueSource("bogus", "bogus", "text", new BytesRef("test"))), new[] { (float)Math.Sqrt(3d), (float)Math.Sqrt(1d) });
-                AssertHits(new FunctionQuery(new TFValueSource("bogus", "bogus", "string", new BytesRef("bar"))), new[] { 0f, 1f });
+                AssertHits(new FunctionQuery(
+                    new TFValueSource("bogus", "bogus", "text", new BytesRef("test"))),
+                    new[] { (float)Math.Sqrt(3d), (float)Math.Sqrt(1d) });
+                AssertHits(new FunctionQuery(
+                    new TFValueSource("bogus", "bogus", "string", new BytesRef("bar"))),
+                    new[] { 0f, 1f });
             }
             finally
             {
@@ -334,11 +392,15 @@ namespace Lucene.Net.Tests.Queries.Function
         {
             if (Codec.Default.Name.Equals("Lucene3x", StringComparison.Ordinal))
             {
-                AssertHits(new FunctionQuery(new TotalTermFreqValueSource("bogus", "bogus", "text", new BytesRef("test"))), new[] { -1f, -1f });
+                AssertHits(new FunctionQuery(
+                    new TotalTermFreqValueSource("bogus", "bogus", "text", new BytesRef("test"))),
+                    new[] { -1f, -1f });
             }
             else
             {
-                AssertHits(new FunctionQuery(new TotalTermFreqValueSource("bogus", "bogus", "text", new BytesRef("test"))), new[] { 4f, 4f });
+                AssertHits(new FunctionQuery(
+                    new TotalTermFreqValueSource("bogus", "bogus", "text", new BytesRef("test"))),
+                    new[] { 4f, 4f });
             }
         }
 
@@ -351,7 +413,8 @@ namespace Lucene.Net.Tests.Queries.Function
                 expectedDocs[i] = i;
                 expected[i] = new ScoreDoc(i, scores[i]);
             }
-            TopDocs docs = searcher.Search(q, null, documents.Count, new Sort(new SortField("id", SortFieldType.STRING)), true, false);
+            TopDocs docs = searcher.Search(q, null, documents.Count,
+                new Sort(new SortField("id", SortFieldType.STRING)), true, false);
             CheckHits.DoCheckHits(
 #if FEATURE_INSTANCE_TESTDATA_INITIALIZATION
                 this,
diff --git a/src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs b/src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs
index 2f492e6..0a5fc62 100644
--- a/src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs
+++ b/src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+// Lucene version compatibility level 4.8.1
+using System.Collections.Generic;
 using System.IO;
 using Lucene.Net.Analysis;
 using Lucene.Net.Documents;
@@ -99,7 +100,8 @@ namespace Lucene.Net.Tests.Queries.Mlt
                 assertNotNull("Expected term " + tq.Term.Text(), termBoost);
 
                 float totalBoost = (float) (termBoost * boostFactor);
-                assertEquals("Expected boost of " + totalBoost + " for term '" + tq.Term.Text() + "' got " + tq.Boost, totalBoost, tq.Boost, 0.0001);
+                assertEquals("Expected boost of " + totalBoost + " for term '"
+                    + tq.Term.Text() + "' got " + tq.Boost, totalBoost, tq.Boost, 0.0001);
             }
         }
         
diff --git a/src/Lucene.Net.Tests.Queries/TermFilterTest.cs b/src/Lucene.Net.Tests.Queries/TermFilterTest.cs
index c4a403c..d8cd554 100644
--- a/src/Lucene.Net.Tests.Queries/TermFilterTest.cs
+++ b/src/Lucene.Net.Tests.Queries/TermFilterTest.cs
@@ -1,4 +1,5 @@
-using System;
+// Lucene version compatibility level 4.8.1
+using System;
 using System.Collections.Generic;
 using Lucene.Net.Documents;
 using Lucene.Net.Index;
@@ -58,15 +59,19 @@ namespace Lucene.Net.Tests.Queries
             assertTrue(reader.Context is AtomicReaderContext);
             var context = (AtomicReaderContext)reader.Context;
             w.Dispose();
+
             DocIdSet idSet = TermFilter(fieldName, @"value1").GetDocIdSet(context, context.AtomicReader.LiveDocs);
             assertNotNull(@"must not be null", idSet);
             DocIdSetIterator iter = idSet.GetIterator();
             assertEquals(iter.NextDoc(), 0);
             assertEquals(iter.NextDoc(), DocIdSetIterator.NO_MORE_DOCS);
+
             idSet = TermFilter(fieldName, @"value2").GetDocIdSet(context, context.AtomicReader.LiveDocs);
             assertNull(@"must be null", idSet);
+
             idSet = TermFilter(@"field2", @"value1").GetDocIdSet(context, context.AtomicReader.LiveDocs);
             assertNull(@"must be null", idSet);
+
             reader.Dispose();
             rd.Dispose();
         }
@@ -94,12 +99,15 @@ namespace Lucene.Net.Tests.Queries
 
             IndexReader reader = w.GetReader();
             w.Dispose();
+
             IndexSearcher searcher = NewSearcher(reader);
+
             int numQueries = AtLeast(10);
             for (int i = 0; i < numQueries; i++)
             {
                 Term term = terms[Random.nextInt(num)];
                 TopDocs queryResult = searcher.Search(new TermQuery(term), reader.MaxDoc);
+
                 MatchAllDocsQuery matchAll = new MatchAllDocsQuery();
                 TermFilter filter = TermFilter(term);
                 TopDocs filterResult = searcher.Search(matchAll, filter, reader.MaxDoc);
@@ -124,16 +132,13 @@ namespace Lucene.Net.Tests.Queries
                 string field1 = @"field" + i;
                 string field2 = @"field" + i + num;
                 string value1 = TestUtil.RandomRealisticUnicodeString(Random);
-                string value2 = value1 + @"x";
+                string value2 = value1 + @"x"; // this must be not equal to value1
+
                 TermFilter filter1 = TermFilter(field1, value1);
                 TermFilter filter2 = TermFilter(field1, value2);
                 TermFilter filter3 = TermFilter(field2, value1);
                 TermFilter filter4 = TermFilter(field2, value2);
-                var filters = new TermFilter[]
-                {
-                    filter1, filter2, filter3, filter4
-                };
-
+                var filters = new TermFilter[] { filter1, filter2, filter3, filter4 };
                 for (int j = 0; j < filters.Length; j++)
                 {
                     TermFilter termFilter = filters[j];
diff --git a/src/Lucene.Net.Tests.Queries/TermsFilterTest.cs b/src/Lucene.Net.Tests.Queries/TermsFilterTest.cs
index 7627f18..660b4b7 100644
--- a/src/Lucene.Net.Tests.Queries/TermsFilterTest.cs
+++ b/src/Lucene.Net.Tests.Queries/TermsFilterTest.cs
@@ -1,5 +1,7 @@
-using System;
+// Lucene version compatibility level 4.8.1
+using System;
 using System.Collections.Generic;
+using System.Globalization;
 using System.Linq;
 using J2N.Collections.Generic.Extensions;
 using Lucene.Net.Documents;
@@ -88,7 +90,7 @@ namespace Lucene.Net.Tests.Queries
             reader.Dispose();
             rd.Dispose();
         }
-        
+
         [Test]
         public void TestMissingField()
         {
@@ -171,7 +173,7 @@ namespace Lucene.Net.Tests.Queries
 
 
 
-            AtomicReaderContext context = reader.Leaves.First();
+            AtomicReaderContext context = reader.Leaves[0];
             TermsFilter tf = new TermsFilter(terms);
 
             FixedBitSet bits = (FixedBitSet)tf.GetDocIdSet(context, context.AtomicReader.LiveDocs);
@@ -217,7 +219,7 @@ namespace Lucene.Net.Tests.Queries
             IndexReader reader = w.GetReader();
             w.Dispose();
             assertEquals(1, reader.Leaves.size());
-            AtomicReaderContext context = reader.Leaves.First();
+            AtomicReaderContext context = reader.Leaves[0];
             TermsFilter tf = new TermsFilter(terms.ToList());
 
             FixedBitSet bits = (FixedBitSet)tf.GetDocIdSet(context, context.AtomicReader.LiveDocs);
@@ -240,7 +242,7 @@ namespace Lucene.Net.Tests.Queries
             IList<Term> terms = new List<Term>();
             for (int i = 0; i < num; i++)
             {
-                string field = "field" + (singleField ? "1" : Random.Next(100).ToString());
+                string field = "field" + (singleField ? "1" : Random.Next(100).ToString(CultureInfo.InvariantCulture));
                 string @string = TestUtil.RandomRealisticUnicodeString(Random);
                 terms.Add(new Term(field, @string));
                 Document doc = new Document();
@@ -398,7 +400,10 @@ namespace Lucene.Net.Tests.Queries
         [Test]
         public void TestToString()
         {
-            TermsFilter termsFilter = new TermsFilter(new Term("field1", "a"), new Term("field1", "b"), new Term("field1", "c"));
+            TermsFilter termsFilter = new TermsFilter(
+                new Term("field1", "a"),
+                new Term("field1", "b"),
+                new Term("field1", "c"));
             assertEquals("field1:a field1:b field1:c", termsFilter.ToString());
         }
     }
diff --git a/src/Lucene.Net.Tests.Queries/TestCustomScoreQuery.cs b/src/Lucene.Net.Tests.Queries/TestCustomScoreQuery.cs
index 47d3052..7c60bc0 100644
--- a/src/Lucene.Net.Tests.Queries/TestCustomScoreQuery.cs
+++ b/src/Lucene.Net.Tests.Queries/TestCustomScoreQuery.cs
@@ -1,4 +1,5 @@
-using System;
+// Lucene version compatibility level 4.8.1
+using System;
 using System.Collections.Generic;
 using Lucene.Net.Index;
 using Lucene.Net.Queries;
@@ -89,7 +90,8 @@ namespace Lucene.Net.Tests.Queries
         private class CustomAddQuery : CustomScoreQuery
         {
             // constructor
-            internal CustomAddQuery(Query q, FunctionQuery qValSrc) : base(q, qValSrc)
+            internal CustomAddQuery(Query q, FunctionQuery qValSrc)
+                : base(q, qValSrc)
             {
             }
 
@@ -129,7 +131,8 @@ namespace Lucene.Net.Tests.Queries
         private class CustomMulAddQuery : CustomScoreQuery
         {
             // constructor
-            internal CustomMulAddQuery(Query q, FunctionQuery qValSrc1, FunctionQuery qValSrc2) : base(q, qValSrc1, qValSrc2)
+            internal CustomMulAddQuery(Query q, FunctionQuery qValSrc1, FunctionQuery qValSrc2)
+                : base(q, qValSrc1, qValSrc2)
             {
             }
 
@@ -259,7 +262,8 @@ namespace Lucene.Net.Tests.Queries
 
             r.Dispose();
         }
-        
+
+        // Test that FieldScoreQuery returns docs with expected score.
         private void DoTestCustomScore(ValueSource valueSource, double dboost)
         {
             float boost = (float)dboost;
@@ -310,18 +314,22 @@ namespace Lucene.Net.Tests.Queries
             TopDocs td5CustomMulAdd = s.Search(q5CustomMulAdd, null, 1000);
 
             // put results in map so we can verify the scores although they have changed
-            IDictionary<int, float> h1 = TopDocsToMap(td1);
-            IDictionary<int, float> h2CustomNeutral = TopDocsToMap(td2CustomNeutral);
-            IDictionary<int, float> h3CustomMul = TopDocsToMap(td3CustomMul);
-            IDictionary<int, float> h4CustomAdd = TopDocsToMap(td4CustomAdd);
-            IDictionary<int, float> h5CustomMulAdd = TopDocsToMap(td5CustomMulAdd);
-
-            VerifyResults(boost, s, h1, h2CustomNeutral, h3CustomMul, h4CustomAdd, h5CustomMulAdd, q1, q2CustomNeutral, q3CustomMul, q4CustomAdd, q5CustomMulAdd);
+            IDictionary<int, float> h1               = TopDocsToMap(td1);
+            IDictionary<int, float> h2CustomNeutral  = TopDocsToMap(td2CustomNeutral);
+            IDictionary<int, float> h3CustomMul      = TopDocsToMap(td3CustomMul);
+            IDictionary<int, float> h4CustomAdd      = TopDocsToMap(td4CustomAdd);
+            IDictionary<int, float> h5CustomMulAdd   = TopDocsToMap(td5CustomMulAdd);
+
+            VerifyResults(boost, s,
+                h1, h2CustomNeutral, h3CustomMul, h4CustomAdd, h5CustomMulAdd,
+                q1, q2CustomNeutral, q3CustomMul, q4CustomAdd, q5CustomMulAdd);
             r.Dispose();
         }
 
         // verify results are as expected.
-        private void VerifyResults(float boost, IndexSearcher s, IDictionary<int, float> h1, IDictionary<int, float> h2customNeutral, IDictionary<int, float> h3CustomMul, IDictionary<int, float> h4CustomAdd, IDictionary<int, float> h5CustomMulAdd, Query q1, Query q2, Query q3, Query q4, Query q5)
+        private void VerifyResults(float boost, IndexSearcher s,
+            IDictionary<int, float> h1, IDictionary<int, float> h2customNeutral, IDictionary<int, float> h3CustomMul, IDictionary<int, float> h4CustomAdd, IDictionary<int, float> h5CustomMulAdd,
+            Query q1, Query q2, Query q3, Query q4, Query q5)
         {
 
             // verify numbers of matches


[lucenenet] 04/07: SWEEP: MemberwiseClone() doesn't throw exceptions in .NET, so there is no need to place it in a try/catch block. There is also no need to cast the result if we don't need access to its members. (#259)

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit fc77ea2cd0e24456111bc44cb75d64653473cdfc
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Mon Feb 22 04:26:44 2021 +0700

    SWEEP: MemberwiseClone() doesn't throw exceptions in .NET, so there is no need to place it in a try/catch block. There is also no need to cast the result if we don't need access to its members. (#259)
---
 src/Lucene.Net/Search/Query.cs    | 11 ++---------
 src/Lucene.Net/Util/InfoStream.cs | 11 ++---------
 2 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/src/Lucene.Net/Search/Query.cs b/src/Lucene.Net/Search/Query.cs
index c2825d6..26e86f4 100644
--- a/src/Lucene.Net/Search/Query.cs
+++ b/src/Lucene.Net/Search/Query.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections.Generic;
 
 namespace Lucene.Net.Search
@@ -117,14 +117,7 @@ namespace Lucene.Net.Search
         /// Returns a clone of this query. </summary>
         public virtual object Clone()
         {
-            try
-            {
-                return (Query)base.MemberwiseClone();
-            }
-            catch (Exception e)
-            {
-                throw new Exception("Clone not supported: " + e.Message);
-            }
+            return MemberwiseClone(); // LUCENENET: MemberwiseClone() never throws in .NET and there is no need to cast the result here.
         }
 
         public override int GetHashCode()
diff --git a/src/Lucene.Net/Util/InfoStream.cs b/src/Lucene.Net/Util/InfoStream.cs
index d29a684..30e8014 100644
--- a/src/Lucene.Net/Util/InfoStream.cs
+++ b/src/Lucene.Net/Util/InfoStream.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using Lucene.Net.Diagnostics;
 
 namespace Lucene.Net.Util
@@ -110,14 +110,7 @@ namespace Lucene.Net.Util
         /// </summary>
         public virtual object Clone()
         {
-            try
-            {
-                return (InfoStream)base.MemberwiseClone();
-            }
-            catch (InvalidOperationException e)
-            {
-                throw new Exception(e.ToString(), e);
-            }
+            return MemberwiseClone(); // LUCENENET: No exception can occur in .NET and there is no need to cast.
         }
     }
 }
\ No newline at end of file