You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by mh...@apache.org on 2013/09/24 20:32:59 UTC

[23/50] [abbrv] git commit: Some cleanup

Some cleanup


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/2a56f3bd
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/2a56f3bd
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/2a56f3bd

Branch: refs/heads/branch_4x
Commit: 2a56f3bdd16c219f0a61757065991688aa4a7cdb
Parents: 16ff6a7
Author: Paul Irwin <pa...@gmail.com>
Authored: Wed Jul 24 11:03:14 2013 -0400
Committer: Paul Irwin <pa...@gmail.com>
Committed: Wed Jul 24 11:03:14 2013 -0400

----------------------------------------------------------------------
 .../Compressing/GrowableByteArrayDataOutput.cs  |  12 +-
 src/core/Codecs/Lucene3x/Lucene3xCodec.cs       |   5 +-
 src/core/Document/DoubleField.cs                |   7 +-
 src/core/Document/FloatField.cs                 |   7 +-
 src/core/Document/IntField.cs                   |   7 +-
 src/core/Document/LongField.cs                  |   7 +-
 src/core/Document/StringField.cs                |   7 +-
 src/core/Index/CheckIndex.cs                    |   1 +
 src/core/Index/SegmentInfo.cs                   |   1 +
 src/core/Index/SegmentInfos.cs                  |   1 +
 src/core/Index/TieredMergePolicy.cs             |   2 +-
 src/core/Search/MultiTermQuery.cs               | 118 +++++++++++++++----
 src/core/Search/Payloads/PayloadTermQuery.cs    |   2 +-
 src/core/Search/PrefixTermsEnum.cs              |   2 +-
 src/core/Search/ScoringRewrite.cs               |   2 +-
 src/core/Search/Spans/SpanFirstQuery.cs         |   8 +-
 src/core/Search/TermRangeFilter.cs              |   2 +-
 src/core/Search/TermRangeTermEnum.cs            |   2 +-
 src/core/Search/TopTermsRewrite.cs              |   2 +-
 src/core/Store/CompoundFileDirectory.cs         |   3 +-
 src/core/Util/Automaton/CompiledAutomaton.cs    |   1 +
 src/core/Util/Automaton/LevenshteinAutomata.cs  |   4 +-
 src/core/Util/CommandLineUtil.cs                |   2 +-
 23 files changed, 141 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Codecs/Compressing/GrowableByteArrayDataOutput.cs
----------------------------------------------------------------------
diff --git a/src/core/Codecs/Compressing/GrowableByteArrayDataOutput.cs b/src/core/Codecs/Compressing/GrowableByteArrayDataOutput.cs
index d6b873d..e980736 100644
--- a/src/core/Codecs/Compressing/GrowableByteArrayDataOutput.cs
+++ b/src/core/Codecs/Compressing/GrowableByteArrayDataOutput.cs
@@ -25,8 +25,8 @@ namespace Lucene.Net.Codecs.Compressing
 {
     internal sealed class GrowableByteArrayDataOutput : DataOutput
     {
-        private sbyte[] _bytes;
-        private int _length;
+        private sbyte[] bytes;
+        private int length;
 
         public GrowableByteArrayDataOutput(int cp)
         {
@@ -38,11 +38,11 @@ namespace Lucene.Net.Codecs.Compressing
         {
             get
             {
-                return _bytes;
+                return bytes;
             }
             set
             {
-                _bytes = value;
+                bytes = value;
             }
         }
 
@@ -50,11 +50,11 @@ namespace Lucene.Net.Codecs.Compressing
         {
             get
             {
-                return _length;
+                return length;
             }
             set
             {
-                _length = value;
+                length = value;
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Codecs/Lucene3x/Lucene3xCodec.cs
----------------------------------------------------------------------
diff --git a/src/core/Codecs/Lucene3x/Lucene3xCodec.cs b/src/core/Codecs/Lucene3x/Lucene3xCodec.cs
index ea3986e..bb3cde7 100644
--- a/src/core/Codecs/Lucene3x/Lucene3xCodec.cs
+++ b/src/core/Codecs/Lucene3x/Lucene3xCodec.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+using Lucene.Net.Codecs.Lucene40;
+using Lucene.Net.Index;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -60,7 +61,7 @@ namespace Lucene.Net.Codecs.Lucene3x
 
         public override DocValuesFormat DocValuesFormat
         {
-            get { return docValuesFormat }
+            get { return docValuesFormat; }
         }
 
         public override StoredFieldsFormat StoredFieldsFormat

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Document/DoubleField.cs
----------------------------------------------------------------------
diff --git a/src/core/Document/DoubleField.cs b/src/core/Document/DoubleField.cs
index 5f6860a..3d3b31c 100644
--- a/src/core/Document/DoubleField.cs
+++ b/src/core/Document/DoubleField.cs
@@ -1,4 +1,5 @@
-using System;
+using Lucene.Net.Index;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -15,14 +16,14 @@ namespace Lucene.Net.Documents
             TYPE_NOT_STORED.Indexed = true;
             TYPE_NOT_STORED.Tokenized = true;
             TYPE_NOT_STORED.OmitNorms = true;
-            TYPE_NOT_STORED.IndexOptions = IndexOptions.DOCS_ONLY;
+            TYPE_NOT_STORED.IndexOptions = FieldInfo.IndexOptions.DOCS_ONLY;
             TYPE_NOT_STORED.NumericTypeValue = FieldType.NumericType.DOUBLE;
             TYPE_NOT_STORED.Freeze();
 
             TYPE_STORED.Indexed = true;
             TYPE_STORED.Tokenized = true;
             TYPE_STORED.OmitNorms = true;
-            TYPE_STORED.IndexOptions = IndexOptions.DOCS_ONLY;
+            TYPE_STORED.IndexOptions = FieldInfo.IndexOptions.DOCS_ONLY;
             TYPE_STORED.NumericTypeValue = FieldType.NumericType.DOUBLE;
             TYPE_STORED.Stored = true;
             TYPE_STORED.Freeze();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Document/FloatField.cs
----------------------------------------------------------------------
diff --git a/src/core/Document/FloatField.cs b/src/core/Document/FloatField.cs
index c13f90a..893892a 100644
--- a/src/core/Document/FloatField.cs
+++ b/src/core/Document/FloatField.cs
@@ -1,4 +1,5 @@
-using System;
+using Lucene.Net.Index;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -14,14 +15,14 @@ namespace Lucene.Net.Documents
             TYPE_NOT_STORED.Indexed = true;
             TYPE_NOT_STORED.Tokenized = true;
             TYPE_NOT_STORED.OmitNorms = true;
-            TYPE_NOT_STORED.IndexOptions = IndexOptions.DOCS_ONLY;
+            TYPE_NOT_STORED.IndexOptions = FieldInfo.IndexOptions.DOCS_ONLY;
             TYPE_NOT_STORED.NumericTypeValue = FieldType.NumericType.FLOAT;
             TYPE_NOT_STORED.Freeze();
 
             TYPE_STORED.Indexed = true;
             TYPE_STORED.Tokenized = true;
             TYPE_STORED.OmitNorms = true;
-            TYPE_STORED.IndexOptions = IndexOptions.DOCS_ONLY;
+            TYPE_STORED.IndexOptions = FieldInfo.IndexOptions.DOCS_ONLY;
             TYPE_STORED.NumericTypeValue = FieldType.NumericType.FLOAT;
             TYPE_STORED.Stored = true;
             TYPE_STORED.Freeze();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Document/IntField.cs
----------------------------------------------------------------------
diff --git a/src/core/Document/IntField.cs b/src/core/Document/IntField.cs
index 247f7e0..f525b58 100644
--- a/src/core/Document/IntField.cs
+++ b/src/core/Document/IntField.cs
@@ -1,4 +1,5 @@
-using System;
+using Lucene.Net.Index;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -15,14 +16,14 @@ namespace Lucene.Net.Documents
             TYPE_NOT_STORED.Indexed = true;
             TYPE_NOT_STORED.Tokenized = true;
             TYPE_NOT_STORED.OmitNorms = true;
-            TYPE_NOT_STORED.IndexOptions = IndexOptions.DOCS_ONLY;
+            TYPE_NOT_STORED.IndexOptions = FieldInfo.IndexOptions.DOCS_ONLY;
             TYPE_NOT_STORED.NumericTypeValue = FieldType.NumericType.INT;
             TYPE_NOT_STORED.Freeze();
 
             TYPE_STORED.Indexed = true;
             TYPE_STORED.Tokenized = true;
             TYPE_STORED.OmitNorms = true;
-            TYPE_STORED.IndexOptions = IndexOptions.DOCS_ONLY;
+            TYPE_STORED.IndexOptions = FieldInfo.IndexOptions.DOCS_ONLY;
             TYPE_STORED.NumericTypeValue = FieldType.NumericType.INT;
             TYPE_STORED.Stored = true;
             TYPE_STORED.Freeze();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Document/LongField.cs
----------------------------------------------------------------------
diff --git a/src/core/Document/LongField.cs b/src/core/Document/LongField.cs
index 8b4eb05..3620164 100644
--- a/src/core/Document/LongField.cs
+++ b/src/core/Document/LongField.cs
@@ -1,4 +1,5 @@
-using System;
+using Lucene.Net.Index;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -15,14 +16,14 @@ namespace Lucene.Net.Documents
             TYPE_NOT_STORED.Indexed = true;
             TYPE_NOT_STORED.Tokenized = true;
             TYPE_NOT_STORED.OmitNorms = true;
-            TYPE_NOT_STORED.IndexOptions = IndexOptions.DOCS_ONLY;
+            TYPE_NOT_STORED.IndexOptions = FieldInfo.IndexOptions.DOCS_ONLY;
             TYPE_NOT_STORED.NumericTypeValue = FieldType.NumericType.LONG;
             TYPE_NOT_STORED.Freeze();
 
             TYPE_STORED.Indexed = true;
             TYPE_STORED.Tokenized = true;
             TYPE_STORED.OmitNorms = true;
-            TYPE_STORED.IndexOptions = IndexOptions.DOCS_ONLY;
+            TYPE_STORED.IndexOptions = FieldInfo.IndexOptions.DOCS_ONLY;
             TYPE_STORED.NumericTypeValue = FieldType.NumericType.LONG;
             TYPE_STORED.Stored = true;
             TYPE_STORED.Freeze();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Document/StringField.cs
----------------------------------------------------------------------
diff --git a/src/core/Document/StringField.cs b/src/core/Document/StringField.cs
index ef64e2e..ebe8683 100644
--- a/src/core/Document/StringField.cs
+++ b/src/core/Document/StringField.cs
@@ -1,4 +1,5 @@
-using System;
+using Lucene.Net.Index;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -14,13 +15,13 @@ namespace Lucene.Net.Documents
         {
             TYPE_NOT_STORED.Indexed = true;
             TYPE_NOT_STORED.OmitNorms = true;
-            TYPE_NOT_STORED.IndexOptions = IndexOptions.DOCS_ONLY;
+            TYPE_NOT_STORED.IndexOptions = FieldInfo.IndexOptions.DOCS_ONLY;
             TYPE_NOT_STORED.Tokenized = false;
             TYPE_NOT_STORED.Freeze();
 
             TYPE_STORED.Indexed = true;
             TYPE_STORED.OmitNorms = true;
-            TYPE_STORED.IndexOptions = IndexOptions.DOCS_ONLY;
+            TYPE_STORED.IndexOptions = FieldInfo.IndexOptions.DOCS_ONLY;
             TYPE_STORED.Stored = true;
             TYPE_STORED.Tokenized = true;
             TYPE_STORED.Freeze();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Index/CheckIndex.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/CheckIndex.cs b/src/core/Index/CheckIndex.cs
index f424182..4ea52da 100644
--- a/src/core/Index/CheckIndex.cs
+++ b/src/core/Index/CheckIndex.cs
@@ -16,6 +16,7 @@
  */
 
 using Lucene.Net.Codecs;
+using Lucene.Net.Codecs.Lucene3x;
 using Lucene.Net.Search;
 using Lucene.Net.Store;
 using Lucene.Net.Support;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Index/SegmentInfo.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/SegmentInfo.cs b/src/core/Index/SegmentInfo.cs
index 0831e26..41a0bf0 100644
--- a/src/core/Index/SegmentInfo.cs
+++ b/src/core/Index/SegmentInfo.cs
@@ -24,6 +24,7 @@ using Lucene.Net.Support;
 using Directory = Lucene.Net.Store.Directory;
 using IndexInput = Lucene.Net.Store.IndexInput;
 using IndexOutput = Lucene.Net.Store.IndexOutput;
+using Lucene.Net.Codecs.Lucene3x;
 
 namespace Lucene.Net.Index
 {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Index/SegmentInfos.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/SegmentInfos.cs b/src/core/Index/SegmentInfos.cs
index 569b19e..caf74a3 100644
--- a/src/core/Index/SegmentInfos.cs
+++ b/src/core/Index/SegmentInfos.cs
@@ -16,6 +16,7 @@
  */
 
 using Lucene.Net.Codecs;
+using Lucene.Net.Codecs.Lucene3x;
 using Lucene.Net.Store;
 using Lucene.Net.Support;
 using Lucene.Net.Util;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Index/TieredMergePolicy.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/TieredMergePolicy.cs b/src/core/Index/TieredMergePolicy.cs
index 3d7c76b..1d5953b 100644
--- a/src/core/Index/TieredMergePolicy.cs
+++ b/src/core/Index/TieredMergePolicy.cs
@@ -768,7 +768,7 @@ namespace Lucene.Net.Index
             }
             set
             {
-                SetMaxCFSSegmentSizeMB(v);
+                SetMaxCFSSegmentSizeMB(value);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Search/MultiTermQuery.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/MultiTermQuery.cs b/src/core/Search/MultiTermQuery.cs
index afca8e9..15d4e02 100644
--- a/src/core/Search/MultiTermQuery.cs
+++ b/src/core/Search/MultiTermQuery.cs
@@ -53,25 +53,7 @@ namespace Lucene.Net.Search
     [Serializable]
     public abstract class MultiTermQuery : Query
     {
-        [Serializable]
-        public class AnonymousClassConstantScoreAutoRewrite : ConstantScoreAutoRewrite
-        {
-            public override int TermCountCutoff
-            {
-                set { throw new NotSupportedException("Please create a private instance"); }
-            }
-
-            public override double DocCountPercent
-            {
-                set { throw new NotSupportedException("Please create a private instance"); }
-            }
-
-            // Make sure we are still a singleton even after deserializing
-            protected internal virtual object ReadResolve()
-            {
-                return CONSTANT_SCORE_AUTO_REWRITE_DEFAULT;
-            }
-        }
+        
         protected internal RewriteMethod internalRewriteMethod = CONSTANT_SCORE_AUTO_REWRITE_DEFAULT;
 
         [Serializable]
@@ -140,6 +122,95 @@ namespace Lucene.Net.Search
 	    public static readonly RewriteMethod CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE =
 	        ScoringRewrite<MultiTermQuery>.CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE;
 
+        [Serializable]
+        public sealed class TopTermsScoringBooleanQueryRewrite : TopTermsRewrite<BooleanQuery>
+        {
+            public TopTermsScoringBooleanQueryRewrite(int size)
+                : base(size)
+            {
+            }
+
+            protected override int MaxSize
+            {
+                get { return BooleanQuery.MaxClauseCount; }
+            }
+
+            protected override BooleanQuery TopLevelQuery
+            {
+                get { return new BooleanQuery(true); }
+            }
+
+            protected override void AddClause(BooleanQuery topLevel, Term term, int docCount, float boost, TermContext states)
+            {
+                TermQuery tq = new TermQuery(term, states);
+                tq.Boost = boost;
+                topLevel.Add(tq, Occur.SHOULD);
+            }
+        }
+
+        [Serializable]
+        public sealed class TopTermsBoostOnlyBooleanQueryRewrite : TopTermsRewrite<BooleanQuery>
+        {
+            public TopTermsBoostOnlyBooleanQueryRewrite(int size)
+                : base(size)
+            {
+            }
+
+            protected override int MaxSize
+            {
+                get { return BooleanQuery.MaxClauseCount; }
+            }
+
+            protected override BooleanQuery TopLevelQuery
+            {
+                get { return new BooleanQuery(true); }
+            }
+
+            protected override void AddClause(BooleanQuery topLevel, Term term, int docCount, float boost, TermContext states)
+            {
+                Query q = new ConstantScoreQuery(new TermQuery(term, states));
+                q.Boost = boost;
+                topLevel.Add(q, Occur.SHOULD);
+            }
+        }
+
+        [Serializable]
+        public class ConstantScoreAutoRewrite : Lucene.Net.Search.ConstantScoreAutoRewrite
+        {
+            // Make sure we are still a singleton even after deserializing
+            protected internal virtual object ReadResolve()
+            {
+                return CONSTANT_SCORE_AUTO_REWRITE_DEFAULT;
+            }
+        }
+
+        [Serializable]
+        private sealed class AnonymousConstantScoreAutoRewriteDefault : ConstantScoreAutoRewrite
+        {
+            public override int TermCountCutoff
+            {
+                get
+                {
+                    return base.TermCountCutoff;
+                }
+                set
+                {
+                    throw new NotSupportedException("Please create a private instance");
+                }
+            }
+
+            public override double DocCountPercent
+            {
+                get
+                {
+                    return base.DocCountPercent;
+                }
+                set
+                {
+                    throw new NotSupportedException("Please create a private instance");
+                }
+            }           
+        }
 
         /// <summary>Read-only default instance of <see cref="ConstantScoreAutoRewrite" />
         ///, with <see cref="ConstantScoreAutoRewrite.TermCountCutoff" />
@@ -154,7 +225,7 @@ namespace Lucene.Net.Search
         /// instance; you'll need to create a private instance
         /// instead. 
         /// </summary>
-        public static readonly RewriteMethod CONSTANT_SCORE_AUTO_REWRITE_DEFAULT;
+        public static readonly RewriteMethod CONSTANT_SCORE_AUTO_REWRITE_DEFAULT = new AnonymousConstantScoreAutoRewriteDefault();
 
         /// <summary> Constructs a query matching terms that cannot be represented with a single
         /// Term.
@@ -232,12 +303,7 @@ namespace Lucene.Net.Search
         {
             return GetTermsEnum(terms, new AttributeSource());
         }
-
-        static MultiTermQuery()
-        {
-            CONSTANT_SCORE_AUTO_REWRITE_DEFAULT = new AnonymousClassConstantScoreAutoRewrite();
-        }
-
+        
         /// <summary>Abstract class that defines how the query is rewritten. </summary>
         [Serializable]
         public abstract class RewriteMethod

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Search/Payloads/PayloadTermQuery.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/Payloads/PayloadTermQuery.cs b/src/core/Search/Payloads/PayloadTermQuery.cs
index b74ee81..3426bac 100644
--- a/src/core/Search/Payloads/PayloadTermQuery.cs
+++ b/src/core/Search/Payloads/PayloadTermQuery.cs
@@ -67,7 +67,7 @@ public class PayloadTermQuery : SpanTermQuery {
 
       protected void ProcessPayload(Similarity similarity)  {
         if (termSpans.IsPayloadAvailable()) {
-          DocsAndPositionsEnum postings = termSpans.getPostings();
+          DocsAndPositionsEnum postings = termSpans.Postings;
           payload = postings.Payload;
           if (payload != null) {
             payloadScore = function.CurrentScore(doc, term.field(),

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Search/PrefixTermsEnum.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/PrefixTermsEnum.cs b/src/core/Search/PrefixTermsEnum.cs
index 854b992..c153fe5 100644
--- a/src/core/Search/PrefixTermsEnum.cs
+++ b/src/core/Search/PrefixTermsEnum.cs
@@ -35,7 +35,7 @@ namespace Lucene.Net.Search
         public PrefixTermsEnum(TermsEnum tenum, BytesRef prefixText)
             : base(tenum)
         {
-            SetInitialSeekTerm(this.prefixRef = prefixText);
+            InitialSeekTerm = this.prefixRef = prefixText;
         }
 
         protected override AcceptStatus Accept(BytesRef term)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Search/ScoringRewrite.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/ScoringRewrite.cs b/src/core/Search/ScoringRewrite.cs
index ae5c45a..a4d2d6b 100644
--- a/src/core/Search/ScoringRewrite.cs
+++ b/src/core/Search/ScoringRewrite.cs
@@ -54,7 +54,7 @@ namespace Lucene.Net.Search
 
         public override sealed Query Rewrite(IndexReader reader, MultiTermQuery query)
         {
-            var result = GetTopLevelQuery();
+            var result = TopLevelQuery;
             var col = new ParallelArraysTermCollector(this);
             CollectTerms(reader, query, col);
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Search/Spans/SpanFirstQuery.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/Spans/SpanFirstQuery.cs b/src/core/Search/Spans/SpanFirstQuery.cs
index a0357e6..ddefb22 100644
--- a/src/core/Search/Spans/SpanFirstQuery.cs
+++ b/src/core/Search/Spans/SpanFirstQuery.cs
@@ -56,7 +56,7 @@ namespace Lucene.Net.Search.Spans
 
         public override object Clone()
         {
-            SpanFirstQuery spanFirstQuery = new SpanFirstQuery((SpanQuery) match.clone(), end);
+            SpanFirstQuery spanFirstQuery = new SpanFirstQuery((SpanQuery) match.Clone(), end);
             spanFirstQuery.Boost = Boost;
             return spanFirstQuery;
         }
@@ -68,15 +68,15 @@ namespace Lucene.Net.Search.Spans
 
             SpanFirstQuery other = (SpanFirstQuery) o;
             return this.end == other.end
-                   && this.match.equals(other.match)
+                   && this.match.Equals(other.match)
                    && this.Boost == other.Boost;
         }
 
         public override int GetHashCode()
         {
-            int h = match.hashCode();
+            int h = match.GetHashCode();
             h ^= (h << 8) | Number.URShift(h, 25); // reversible
-            h ^= Float.floatToRawIntBits(Boost) ^ end;
+            h ^= Number.FloatToIntBits(Boost) ^ end;
             return h;
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Search/TermRangeFilter.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/TermRangeFilter.cs b/src/core/Search/TermRangeFilter.cs
index 65914a5..61f3cc3 100644
--- a/src/core/Search/TermRangeFilter.cs
+++ b/src/core/Search/TermRangeFilter.cs
@@ -61,7 +61,7 @@ namespace Lucene.Net.Search
         {
             var lower = lowerTerm == null ? null : new BytesRef(lowerTerm);
             var upper = upperTerm == null ? null : new BytesRef(upperTerm);
-            return new TermRangeFilter(field, lower, uppoer, includeLower, includeUpper);
+            return new TermRangeFilter(field, lower, upper, includeLower, includeUpper);
         }
 		
 		/// <summary> Constructs a filter for field <c>fieldName</c> matching

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Search/TermRangeTermEnum.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/TermRangeTermEnum.cs b/src/core/Search/TermRangeTermEnum.cs
index 4e921c1..4c68e13 100644
--- a/src/core/Search/TermRangeTermEnum.cs
+++ b/src/core/Search/TermRangeTermEnum.cs
@@ -64,7 +64,7 @@ namespace Lucene.Net.Search
                 upperBytesRef = upperTerm;
             }
 
-            SetInitialSeekTerm(lowerBytesRef);
+            InitialSeekTerm = lowerBytesRef;
             termComp = Comparator;
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Search/TopTermsRewrite.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/TopTermsRewrite.cs b/src/core/Search/TopTermsRewrite.cs
index 5c33720..1c1295e 100644
--- a/src/core/Search/TopTermsRewrite.cs
+++ b/src/core/Search/TopTermsRewrite.cs
@@ -138,7 +138,7 @@ namespace Lucene.Net.Search
             var stQueue = new Support.PriorityQueue<ScoreTerm>();
             CollectTerms(reader, query, new AnonymousRewriteTermCollector(this, stQueue));
 
-            var q = GetTopLevelQuery();
+            var q = TopLevelQuery;
             var scoreTerms = stQueue.ToArray();
             ArrayUtil.MergeSort(scoreTerms, scoreTermSortByTermComp);
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Store/CompoundFileDirectory.cs
----------------------------------------------------------------------
diff --git a/src/core/Store/CompoundFileDirectory.cs b/src/core/Store/CompoundFileDirectory.cs
index 76cde01..cb92f8e 100644
--- a/src/core/Store/CompoundFileDirectory.cs
+++ b/src/core/Store/CompoundFileDirectory.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Index;
+using Lucene.Net.Codecs;
+using Lucene.Net.Index;
 using Lucene.Net.Support;
 using Lucene.Net.Util;
 using System;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Util/Automaton/CompiledAutomaton.cs
----------------------------------------------------------------------
diff --git a/src/core/Util/Automaton/CompiledAutomaton.cs b/src/core/Util/Automaton/CompiledAutomaton.cs
index 4d5f729..5fef853 100644
--- a/src/core/Util/Automaton/CompiledAutomaton.cs
+++ b/src/core/Util/Automaton/CompiledAutomaton.cs
@@ -1,4 +1,5 @@
 using Lucene.Net.Index;
+using Lucene.Net.Search;
 using System;
 using System.Collections.Generic;
 using System.Linq;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Util/Automaton/LevenshteinAutomata.cs
----------------------------------------------------------------------
diff --git a/src/core/Util/Automaton/LevenshteinAutomata.cs b/src/core/Util/Automaton/LevenshteinAutomata.cs
index f08d750..e1b07e5 100644
--- a/src/core/Util/Automaton/LevenshteinAutomata.cs
+++ b/src/core/Util/Automaton/LevenshteinAutomata.cs
@@ -76,8 +76,8 @@ namespace Lucene.Net.Util.Automaton
 
             descriptions = new ParametricDescription[] {
                 null, /* for n=0, we do not need to go through the trouble */
-                withTranspositions ? new Lev1TParametricDescription(word.Length) : new Lev1ParametricDescription(word.Length),
-                withTranspositions ? new Lev2TParametricDescription(word.Length) : new Lev2ParametricDescription(word.Length),
+                withTranspositions ? (ParametricDescription)new Lev1TParametricDescription(word.Length) : new Lev1ParametricDescription(word.Length),
+                withTranspositions ? (ParametricDescription)new Lev2TParametricDescription(word.Length) : new Lev2ParametricDescription(word.Length),
             };
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2a56f3bd/src/core/Util/CommandLineUtil.cs
----------------------------------------------------------------------
diff --git a/src/core/Util/CommandLineUtil.cs b/src/core/Util/CommandLineUtil.cs
index d91b41b..4707768 100644
--- a/src/core/Util/CommandLineUtil.cs
+++ b/src/core/Util/CommandLineUtil.cs
@@ -14,7 +14,7 @@ namespace Lucene.Net.Util
             try
             {
                 Type clazz = LoadFSDirectoryClass(clazzName);
-                return NewFSDirectory(clazz, file);
+                return NewFSDirectory(clazz, dir);
 
             }
             catch (TypeLoadException e)