lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [22/26] lucenenet git commit: dot-netify (change to upper case functions and properties)
Date Fri, 14 Nov 2014 11:59:37 GMT
dot-netify (change to upper case functions and properties)


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

Branch: refs/heads/master
Commit: f9ee12403c9f293ab65245cba34ad31cdc81d0af
Parents: 70e1c54
Author: eladmarg <eladmarg@gmail.com>
Authored: Thu Nov 13 00:56:30 2014 -0800
Committer: eladmarg <eladmarg@gmail.com>
Committed: Thu Nov 13 00:56:30 2014 -0800

----------------------------------------------------------------------
 Lucene.Net.Facet/DrillDownQuery.cs              |   4 +-
 Lucene.Net.Facet/FacetField.cs                  |   8 +-
 Lucene.Net.Facet/FacetResult.cs                 | 171 ++++++++++---------
 Lucene.Net.Facet/FacetsConfig.cs                |  95 ++++++-----
 Lucene.Net.Facet/MultiFacets.cs                 |   6 +-
 .../RandomSamplingFacetsCollector.cs            |  26 +--
 Lucene.Net.Facet/Range/DoubleRange.cs           |  25 +--
 .../Range/DoubleRangeFacetCounts.cs             |  12 +-
 Lucene.Net.Facet/Range/LongRangeFacetCounts.cs  |  12 +-
 Lucene.Net.Facet/Range/RangeFacetCounts.cs      |  30 ++--
 .../SortedSet/SortedSetDocValuesFacetCounts.cs  |  20 +--
 .../SortedSet/SortedSetDocValuesFacetField.cs   |   4 +-
 .../Taxonomy/AssociationFacetField.cs           |   4 +-
 .../Directory/DirectoryTaxonomyReader.cs        |   8 +-
 .../Directory/DirectoryTaxonomyWriter.cs        |  39 +++--
 Lucene.Net.Facet/Taxonomy/FacetLabel.cs         |  71 ++++----
 .../Taxonomy/FloatTaxonomyFacets.cs             |  12 +-
 Lucene.Net.Facet/Taxonomy/IntTaxonomyFacets.cs  |  20 +--
 Lucene.Net.Facet/Taxonomy/PrintTaxonomyStats.cs |   4 +-
 Lucene.Net.Facet/Taxonomy/TaxonomyFacets.cs     |  22 +--
 Lucene.Net.Facet/Taxonomy/TaxonomyReader.cs     |   4 +-
 .../Taxonomy/WriterCache/CategoryPathUtils.cs   |  20 +--
 .../Taxonomy/WriterCache/CharBlockArray.cs      |   6 +-
 .../Taxonomy/WriterCache/CollisionMap.cs        |  41 ++++-
 .../WriterCache/CompactLabelToOrdinal.cs        |  13 +-
 Lucene.Net.Facet/TopOrdAndIntQueue.cs           |  10 +-
 .../Index/SortedSetDocValuesWriter.cs           |   2 +-
 .../core/Facet/FacetTestCase.cs                 |  34 ++--
 .../core/Facet/Range/TestRangeFacetCounts.cs    |  36 ++--
 .../Facet/Taxonomy/Directory/TestAddTaxonomy.cs |  10 +-
 .../Directory/TestConcurrentFacetedIndexing.cs  |   6 +-
 .../Directory/TestDirectoryTaxonomyReader.cs    |   8 +-
 .../Directory/TestDirectoryTaxonomyWriter.cs    |  10 +-
 .../core/Facet/Taxonomy/TestFacetLabel.cs       |  22 +--
 .../Taxonomy/TestSearcherTaxonomyManager.cs     |   8 +-
 .../core/Facet/Taxonomy/TestTaxonomyCombined.cs |  11 +-
 .../Facet/Taxonomy/TestTaxonomyFacetCounts.cs   |  26 +--
 .../Facet/Taxonomy/TestTaxonomyFacetCounts2.cs  |  32 ++--
 .../Taxonomy/TestTaxonomyFacetSumValueSource.cs |   4 +-
 .../core/Facet/TestDrillDownQuery.cs            |   4 +-
 .../core/Facet/TestDrillSideways.cs             |  12 +-
 .../core/Facet/TestFacetsConfig.cs              |   8 +-
 .../core/Facet/TestMultipleIndexFields.cs       |  14 +-
 .../Facet/TestRandomSamplingFacetsCollector.cs  |   8 +-
 44 files changed, 491 insertions(+), 451 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/DrillDownQuery.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/DrillDownQuery.cs b/Lucene.Net.Facet/DrillDownQuery.cs
index f49bb8f..8234282 100644
--- a/Lucene.Net.Facet/DrillDownQuery.cs
+++ b/Lucene.Net.Facet/DrillDownQuery.cs
@@ -161,7 +161,7 @@ namespace Lucene.Net.Facet
                 // merge a facet label in:
                 throw new Exception("cannot merge with custom Query");
             }
-            string indexedField = config.GetDimConfig(dim).indexFieldName;
+            string indexedField = config.GetDimConfig(dim).IndexFieldName;
 
             BooleanQuery bq = (BooleanQuery)q.Query;
             bq.Add(new TermQuery(Term(indexedField, dim, path)), Occur.SHOULD);
@@ -181,7 +181,7 @@ namespace Lucene.Net.Facet
                 Merge(dim, path);
                 return;
             }
-            string indexedField = config.GetDimConfig(dim).indexFieldName;
+            string indexedField = config.GetDimConfig(dim).IndexFieldName;
 
             BooleanQuery bq = new BooleanQuery(true); // disable coord
             bq.Add(new TermQuery(Term(indexedField, dim, path)), Occur.SHOULD);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/FacetField.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/FacetField.cs b/Lucene.Net.Facet/FacetField.cs
index 7d5c1c5..a11e5cf 100644
--- a/Lucene.Net.Facet/FacetField.cs
+++ b/Lucene.Net.Facet/FacetField.cs
@@ -56,10 +56,10 @@ namespace Lucene.Net.Facet
         public FacetField(string dim, params string[] path)
             : base("dummy", TYPE)
         {
-            verifyLabel(dim);
+            VerifyLabel(dim);
             foreach (string label in path)
             {
-                verifyLabel(label);
+                VerifyLabel(label);
             }
             this.dim = dim;
             if (path.Length == 0)
@@ -71,7 +71,7 @@ namespace Lucene.Net.Facet
 
         public override string ToString()
         {
-            return "FacetField(dim=" + dim + " path=" + Arrays.ToString(path) + ")";
+            return "FacetField(dim=" + dim + " path=[" + Arrays.ToString(path) + "])";
         }
 
         /// <summary>
@@ -79,7 +79,7 @@ namespace Lucene.Net.Facet
         /// 
         ///  @lucene.internal 
         /// </summary>
-        public static void verifyLabel(string label)
+        public static void VerifyLabel(string label)
         {
             if (string.IsNullOrEmpty(label))
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/FacetResult.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/FacetResult.cs b/Lucene.Net.Facet/FacetResult.cs
index f53c841..be619b2 100644
--- a/Lucene.Net.Facet/FacetResult.cs
+++ b/Lucene.Net.Facet/FacetResult.cs
@@ -1,103 +1,104 @@
 using System.Text;
 using Lucene.Net.Support;
+using Lucene.Net.Util;
 
 namespace Lucene.Net.Facet
 {
 
-	/*
-	 * 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.
-	 */
+    /*
+     * 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>
-	/// Counts or aggregates for a single dimension. </summary>
-	public sealed class FacetResult
-	{
+    /// <summary>
+    /// Counts or aggregates for a single dimension. </summary>
+    public sealed class FacetResult
+    {
 
-	  /// <summary>
-	  /// Dimension that was requested. </summary>
-	  public readonly string dim;
+        /// <summary>
+        /// Dimension that was requested. </summary>
+        public readonly string Dim;
 
-	  /// <summary>
-	  /// Path whose children were requested. </summary>
-	  public readonly string[] path;
+        /// <summary>
+        /// Path whose children were requested. </summary>
+        public readonly string[] Path;
 
-	  /// <summary>
-	  /// Total value for this path (sum of all child counts, or
-	  ///  sum of all child values), even those not included in
-	  ///  the topN. 
-	  /// </summary>
-	  public readonly float value;
+        /// <summary>
+        /// Total value for this path (sum of all child counts, or
+        ///  sum of all child values), even those not included in
+        ///  the topN. 
+        /// </summary>
+        public readonly float Value;
 
-	  /// <summary>
-	  /// How many child labels were encountered. </summary>
-	  public readonly int childCount;
+        /// <summary>
+        /// How many child labels were encountered. </summary>
+        public readonly int ChildCount;
 
-	  /// <summary>
-	  /// Child counts. </summary>
-	  public readonly LabelAndValue[] labelValues;
+        /// <summary>
+        /// Child counts. </summary>
+        public readonly LabelAndValue[] LabelValues;
 
-	  /// <summary>
-	  /// Sole constructor. </summary>
-	  public FacetResult(string dim, string[] path, float value, LabelAndValue[] labelValues, int childCount)
-	  {
-		this.dim = dim;
-		this.path = path;
-		this.value = value;
-		this.labelValues = labelValues;
-		this.childCount = childCount;
-	  }
+        /// <summary>
+        /// Sole constructor. </summary>
+        public FacetResult(string dim, string[] path, float value, LabelAndValue[] labelValues, int childCount)
+        {
+            this.Dim = dim;
+            this.Path = path;
+            this.Value = value;
+            this.LabelValues = labelValues;
+            this.ChildCount = childCount;
+        }
 
-	  public override string ToString()
-	  {
-		StringBuilder sb = new StringBuilder();
-		sb.Append("dim=");
-		sb.Append(dim);
-		sb.Append(" path=");
-		sb.Append("[" + Arrays.ToString(path) + "]");
-		sb.Append(" value=");
-		sb.Append(value);
-		sb.Append(" childCount=");
-		sb.Append(childCount);
-		sb.Append('\n');
-		foreach (LabelAndValue labelValue in labelValues)
-		{
-		  sb.Append("  " + labelValue + "\n");
-		}
-		return sb.ToString();
-	  }
+        public override string ToString()
+        {
+            StringBuilder sb = new StringBuilder();
+            sb.Append("dim=");
+            sb.Append(Dim);
+            sb.Append(" path=");
+            sb.Append("[" + Arrays.ToString(Path) + "]");
+            sb.Append(" value=");
+            sb.Append(Value);
+            sb.Append(" childCount=");
+            sb.Append(ChildCount);
+            sb.Append('\n');
+            foreach (LabelAndValue labelValue in LabelValues)
+            {
+                sb.Append("  " + labelValue + "\n");
+            }
+            return sb.ToString();
+        }
 
-	  public override bool Equals(object _other)
-	  {
-		if ((_other is FacetResult) == false)
-		{
-		  return false;
-		}
-		FacetResult other = (FacetResult) _other;
-		return value.Equals(other.value) && childCount == other.childCount && Arrays.Equals(labelValues, other.labelValues);
-	  }
+        public override bool Equals(object _other)
+        {
+            if ((_other is FacetResult) == false)
+            {
+                return false;
+            }
+            FacetResult other = (FacetResult)_other;
+            return Value.Equals(other.Value) && ChildCount == other.ChildCount && Arrays.Equals(LabelValues, other.LabelValues);
+        }
 
-	  public override int GetHashCode()
-	  {
-		int hashCode = value.GetHashCode() + 31 * childCount;
-		foreach (LabelAndValue labelValue in labelValues)
-		{
-		  hashCode = labelValue.GetHashCode() + 31 * hashCode;
-		}
-		return hashCode;
-	  }
-	}
+        public override int GetHashCode()
+        {
+            int hashCode = Value.GetHashCode() + 31 * ChildCount;
+            foreach (LabelAndValue labelValue in LabelValues)
+            {
+                hashCode = labelValue.GetHashCode() + 31 * hashCode;
+            }
+            return hashCode;
+        }
+    }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/FacetsConfig.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/FacetsConfig.cs b/Lucene.Net.Facet/FacetsConfig.cs
index ae4ac36..2539c8b 100644
--- a/Lucene.Net.Facet/FacetsConfig.cs
+++ b/Lucene.Net.Facet/FacetsConfig.cs
@@ -85,23 +85,23 @@ namespace Lucene.Net.Facet
         {
             /// <summary>
             /// True if this dimension is hierarchical. </summary>
-            public bool hierarchical;
+            public bool Hierarchical;
 
             /// <summary>
             /// True if this dimension is multi-valued. </summary>
-            public bool multiValued;
+            public bool MultiValued;
 
             /// <summary>
             /// True if the count/aggregate for the entire dimension
             ///  is required, which is unusual (default is false). 
             /// </summary>
-            public bool requireDimCount;
+            public bool RequireDimCount;
 
             /// <summary>
             /// Actual field where this dimension's facet labels
             ///  should be indexed 
             /// </summary>
-            public string indexFieldName = DEFAULT_INDEX_FIELD_NAME;
+            public string IndexFieldName = DEFAULT_INDEX_FIELD_NAME;
 
             /// <summary>
             /// Default constructor. </summary>
@@ -143,7 +143,7 @@ namespace Lucene.Net.Facet
             lock (this)
             {
                 DimConfig ft;
-                if (!fieldTypes.TryGetValue(dimName,out ft))
+                if (!fieldTypes.TryGetValue(dimName, out ft))
                 {
                     ft = DefaultDimConfig;
                 }
@@ -159,13 +159,15 @@ namespace Lucene.Net.Facet
         {
             lock (this)
             {
-                DimConfig ft;
-                if (!fieldTypes.TryGetValue(dimName,out ft))
+                if (!fieldTypes.ContainsKey(dimName))
                 {
-                    ft = new DimConfig();
+                    var ft = new DimConfig { Hierarchical = v };
                     fieldTypes[dimName] = ft;
                 }
-                ft.hierarchical = v;
+                else
+                {
+                    fieldTypes[dimName].Hierarchical = v;
+                }
             }
         }
 
@@ -177,13 +179,15 @@ namespace Lucene.Net.Facet
         {
             lock (this)
             {
-                DimConfig ft;
-                if (!fieldTypes.TryGetValue(dimName,out ft))
+                if (!fieldTypes.ContainsKey(dimName))
                 {
-                    ft = new DimConfig();
+                    var ft = new DimConfig { MultiValued = v };
                     fieldTypes[dimName] = ft;
                 }
-                ft.multiValued = v;
+                else
+                {
+                    fieldTypes[dimName].MultiValued = v;
+                }
             }
         }
 
@@ -196,13 +200,15 @@ namespace Lucene.Net.Facet
         {
             lock (this)
             {
-                DimConfig ft;
-                if (!fieldTypes.TryGetValue(dimName,out ft))
+                if (!fieldTypes.ContainsKey(dimName))
                 {
-                    ft = new DimConfig();
+                    var ft = new DimConfig { RequireDimCount = v };
                     fieldTypes[dimName] = ft;
                 }
-                ft.requireDimCount = v;
+                else
+                {
+                    fieldTypes[dimName].RequireDimCount = v;
+                }
             }
         }
 
@@ -215,13 +221,15 @@ namespace Lucene.Net.Facet
         {
             lock (this)
             {
-                DimConfig ft;
-                if (!fieldTypes.TryGetValue(dimName,out ft))
+                if (!fieldTypes.ContainsKey(dimName))
                 {
-                    ft = new DimConfig();
+                    var ft = new DimConfig { IndexFieldName = indexFieldName };
                     fieldTypes[dimName] = ft;
                 }
-                ft.indexFieldName = indexFieldName;
+                else
+                {
+                    fieldTypes[dimName].IndexFieldName = indexFieldName;
+                }
             }
         }
 
@@ -286,13 +294,13 @@ namespace Lucene.Net.Facet
                 {
                     FacetField facetField = (FacetField)field;
                     FacetsConfig.DimConfig dimConfig = GetDimConfig(facetField.dim);
-                    if (dimConfig.multiValued == false)
+                    if (dimConfig.MultiValued == false)
                     {
                         CheckSeen(seenDims, facetField.dim);
                     }
-                    string indexFieldName = dimConfig.indexFieldName;
-                    IList<FacetField> fields; 
-                    if (!byField.TryGetValue(indexFieldName,out fields))
+                    string indexFieldName = dimConfig.IndexFieldName;
+                    IList<FacetField> fields;
+                    if (!byField.TryGetValue(indexFieldName, out fields))
                     {
                         fields = new List<FacetField>();
                         byField[indexFieldName] = fields;
@@ -304,13 +312,13 @@ namespace Lucene.Net.Facet
                 {
                     var facetField = (SortedSetDocValuesFacetField)field;
                     FacetsConfig.DimConfig dimConfig = GetDimConfig(facetField.Dim);
-                    if (dimConfig.multiValued == false)
+                    if (dimConfig.MultiValued == false)
                     {
                         CheckSeen(seenDims, facetField.Dim);
                     }
-                    string indexFieldName = dimConfig.indexFieldName;
+                    string indexFieldName = dimConfig.IndexFieldName;
                     IList<SortedSetDocValuesFacetField> fields;
-                    if (!dvByField.TryGetValue(indexFieldName,out fields))
+                    if (!dvByField.TryGetValue(indexFieldName, out fields))
                     {
                         fields = new List<SortedSetDocValuesFacetField>();
                         dvByField[indexFieldName] = fields;
@@ -322,22 +330,22 @@ namespace Lucene.Net.Facet
                 {
                     AssociationFacetField facetField = (AssociationFacetField)field;
                     FacetsConfig.DimConfig dimConfig = GetDimConfig(facetField.dim);
-                    if (dimConfig.multiValued == false)
+                    if (dimConfig.MultiValued == false)
                     {
                         CheckSeen(seenDims, facetField.dim);
                     }
-                    if (dimConfig.hierarchical)
+                    if (dimConfig.Hierarchical)
                     {
                         throw new System.ArgumentException("AssociationFacetField cannot be hierarchical (dim=\"" + facetField.dim + "\")");
                     }
-                    if (dimConfig.requireDimCount)
+                    if (dimConfig.RequireDimCount)
                     {
                         throw new System.ArgumentException("AssociationFacetField cannot requireDimCount (dim=\"" + facetField.dim + "\")");
                     }
 
-                    string indexFieldName = dimConfig.indexFieldName;
+                    string indexFieldName = dimConfig.IndexFieldName;
                     IList<AssociationFacetField> fields;
-                    if (!assocByField.TryGetValue(indexFieldName,out fields))
+                    if (!assocByField.TryGetValue(indexFieldName, out fields))
                     {
                         fields = new List<AssociationFacetField>();
                         assocByField[indexFieldName] = fields;
@@ -361,7 +369,7 @@ namespace Lucene.Net.Facet
                     }
                     // NOTE: not thread safe, but this is just best effort:
                     string curType;
-                    if (!assocDimTypes.TryGetValue(indexFieldName,out curType))
+                    if (!assocDimTypes.TryGetValue(indexFieldName, out curType))
                     {
                         assocDimTypes[indexFieldName] = type;
                     }
@@ -406,7 +414,7 @@ namespace Lucene.Net.Facet
                 {
 
                     FacetsConfig.DimConfig ft = GetDimConfig(facetField.dim);
-                    if (facetField.path.Length > 1 && ft.hierarchical == false)
+                    if (facetField.path.Length > 1 && ft.Hierarchical == false)
                     {
                         throw new System.ArgumentException("dimension \"" + facetField.dim + "\" is not hierarchical yet has " + facetField.path.Length + " components");
                     }
@@ -423,7 +431,7 @@ namespace Lucene.Net.Facet
                     //System.out.println("ords[" + (ordinals.length-1) + "]=" + ordinal);
                     //System.out.println("  add cp=" + cp);
 
-                    if (ft.multiValued && (ft.hierarchical || ft.requireDimCount))
+                    if (ft.MultiValued && (ft.Hierarchical || ft.RequireDimCount))
                     {
                         //System.out.println("  add parents");
                         // Add all parents too:
@@ -438,7 +446,7 @@ namespace Lucene.Net.Facet
                             parent = taxoWriter.GetParent(parent);
                         }
 
-                        if (ft.requireDimCount == false)
+                        if (ft.RequireDimCount == false)
                         {
                             // Remove last (dimension) ord:
                             ordinals.Length--;
@@ -446,9 +454,9 @@ namespace Lucene.Net.Facet
                     }
 
                     // Drill down:
-                    for (int i = 1; i <= cp.length; i++)
+                    for (int i = 1; i <= cp.Length; i++)
                     {
-                        doc.Add(new StringField(indexFieldName, PathToString(cp.components, i), Field.Store.NO));
+                        doc.Add(new StringField(indexFieldName, PathToString(cp.Components, i), Field.Store.NO));
                     }
                 }
 
@@ -470,7 +478,7 @@ namespace Lucene.Net.Facet
                 foreach (SortedSetDocValuesFacetField facetField in ent.Value)
                 {
                     FacetLabel cp = new FacetLabel(facetField.Dim, facetField.Label);
-                    string fullPath = PathToString(cp.components, cp.length);
+                    string fullPath = PathToString(cp.Components, cp.Length);
                     //System.out.println("add " + fullPath);
 
                     // For facet counts:
@@ -513,9 +521,9 @@ namespace Lucene.Net.Facet
                     upto += field.assoc.Length;
 
                     // Drill down:
-                    for (int i = 1; i <= label.length; i++)
+                    for (int i = 1; i <= label.Length; i++)
                     {
-                        doc.Add(new StringField(indexFieldName, PathToString(label.components, i), Field.Store.NO));
+                        doc.Add(new StringField(indexFieldName, PathToString(label.Components, i), Field.Store.NO));
                     }
                 }
                 doc.Add(new BinaryDocValuesField(indexFieldName, new BytesRef(bytes, 0, upto)));
@@ -526,7 +534,7 @@ namespace Lucene.Net.Facet
         /// Encodes ordinals into a BytesRef; expert: subclass can
         ///  override this to change encoding. 
         /// </summary>
-        protected internal virtual BytesRef DedupAndEncode(IntsRef ordinals)
+        protected virtual BytesRef DedupAndEncode(IntsRef ordinals)
         {
             Array.Sort(ordinals.Ints, ordinals.Offset, ordinals.Length);
             byte[] bytes = new byte[5 * ordinals.Length];
@@ -585,6 +593,7 @@ namespace Lucene.Net.Facet
                     lastOrd = ord;
                 }
             }
+
             return new BytesRef(bytes, 0, upto);
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/MultiFacets.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/MultiFacets.cs b/Lucene.Net.Facet/MultiFacets.cs
index b980a5d..b40772e 100644
--- a/Lucene.Net.Facet/MultiFacets.cs
+++ b/Lucene.Net.Facet/MultiFacets.cs
@@ -44,8 +44,8 @@ namespace Lucene.Net.Facet
 
         public override FacetResult GetTopChildren(int topN, string dim, params string[] path)
         {
-            Facets facets = dimToFacets[dim];
-            if (facets == null)
+            Facets facets;
+            if (!dimToFacets.TryGetValue(dim,out facets))
             {
                 if (defaultFacets == null)
                 {
@@ -89,7 +89,7 @@ namespace Lucene.Net.Facet
                 // already add that dim:
                 foreach (FacetResult result in defaultFacets.GetAllDims(topN))
                 {
-                    if (dimToFacets.ContainsKey(result.dim) == false)
+                    if (dimToFacets.ContainsKey(result.Dim) == false)
                     {
                         results.Add(result);
                     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/RandomSamplingFacetsCollector.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/RandomSamplingFacetsCollector.cs b/Lucene.Net.Facet/RandomSamplingFacetsCollector.cs
index 02a4d9e..47bb029 100644
--- a/Lucene.Net.Facet/RandomSamplingFacetsCollector.cs
+++ b/Lucene.Net.Facet/RandomSamplingFacetsCollector.cs
@@ -278,34 +278,34 @@ namespace Lucene.Net.Facet
                 return res;
             }
 
-            LabelAndValue[] fixedLabelValues = new LabelAndValue[res.labelValues.Length];
+            LabelAndValue[] fixedLabelValues = new LabelAndValue[res.LabelValues.Length];
             IndexReader reader = searcher.IndexReader;
-            DimConfig dimConfig = config.GetDimConfig(res.dim);
+            DimConfig dimConfig = config.GetDimConfig(res.Dim);
 
             // +2 to prepend dimension, append child label
-            string[] childPath = new string[res.path.Length + 2];
-            childPath[0] = res.dim;
+            string[] childPath = new string[res.Path.Length + 2];
+            childPath[0] = res.Dim;
 
-            Array.Copy(res.path, 0, childPath, 1, res.path.Length); // reuse
+            Array.Copy(res.Path, 0, childPath, 1, res.Path.Length); // reuse
 
-            for (int i = 0; i < res.labelValues.Length; i++)
+            for (int i = 0; i < res.LabelValues.Length; i++)
             {
-                childPath[res.path.Length + 1] = res.labelValues[i].label;
+                childPath[res.Path.Length + 1] = res.LabelValues[i].label;
                 string fullPath = FacetsConfig.PathToString(childPath, childPath.Length);
-                int max = reader.DocFreq(new Term(dimConfig.indexFieldName, fullPath));
-                int correctedCount = (int)((double)res.labelValues[i].value / samplingRate);
+                int max = reader.DocFreq(new Term(dimConfig.IndexFieldName, fullPath));
+                int correctedCount = (int)((double)res.LabelValues[i].value / samplingRate);
                 correctedCount = Math.Min(max, correctedCount);
-                fixedLabelValues[i] = new LabelAndValue(res.labelValues[i].label, correctedCount);
+                fixedLabelValues[i] = new LabelAndValue(res.LabelValues[i].label, correctedCount);
             }
 
             // cap the total count on the total number of non-deleted documents in the reader
-            int correctedTotalCount = (int)res.value;
+            int correctedTotalCount = (int)res.Value;
             if (correctedTotalCount > 0)
             {
-                correctedTotalCount = Math.Min(reader.NumDocs, (int)((double)res.value / samplingRate));
+                correctedTotalCount = Math.Min(reader.NumDocs, (int)((double)res.Value / samplingRate));
             }
 
-            return new FacetResult(res.dim, res.path, correctedTotalCount, fixedLabelValues, res.childCount);
+            return new FacetResult(res.Dim, res.Path, correctedTotalCount, fixedLabelValues, res.ChildCount);
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/Range/DoubleRange.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/Range/DoubleRange.cs b/Lucene.Net.Facet/Range/DoubleRange.cs
index 6e7e5ae..8ad1439 100644
--- a/Lucene.Net.Facet/Range/DoubleRange.cs
+++ b/Lucene.Net.Facet/Range/DoubleRange.cs
@@ -44,52 +44,53 @@ namespace Lucene.Net.Facet.Range
 
         /// <summary>
         /// Minimum. </summary>
-        public readonly double min;
+        public readonly double Min;
 
         /// <summary>
         /// Maximum. </summary>
-        public readonly double max;
+        public readonly double Max;
 
         /// <summary>
         /// True if the minimum value is inclusive. </summary>
-        public readonly bool minInclusive;
+        public readonly bool MinInclusive;
 
         /// <summary>
         /// True if the maximum value is inclusive. </summary>
-        public readonly bool maxInclusive;
+        public readonly bool MaxInclusive;
 
+        private const double EPSILON = 1E-14;
         /// <summary>
         /// Create a DoubleRange. </summary>
         public DoubleRange(string label, double minIn, bool minInclusive, double maxIn, bool maxInclusive)
             : base(label)
         {
-            this.min = minIn;
-            this.max = maxIn;
-            this.minInclusive = minInclusive;
-            this.maxInclusive = maxInclusive;
+            this.Min = minIn;
+            this.Max = maxIn;
+            this.MinInclusive = minInclusive;
+            this.MaxInclusive = maxInclusive;
 
             // TODO: if DoubleDocValuesField used
             // NumericUtils.doubleToSortableLong format (instead of
             // Double.doubleToRawLongBits) we could do comparisons
             // in long space 
 
-            if (double.IsNaN(min))
+            if (double.IsNaN(Min))
             {
                 throw new System.ArgumentException("min cannot be NaN");
             }
             if (!minInclusive)
             {
-                minIn += double.Epsilon;
+                minIn += EPSILON;
             }
 
-            if (double.IsNaN(max))
+            if (double.IsNaN(Max))
             {
                 throw new System.ArgumentException("max cannot be NaN");
             }
             if (!maxInclusive)
             {
                 // Why no Math.nextDown?
-                maxIn = maxIn -= double.Epsilon;
+                maxIn = maxIn -= EPSILON;
             }
 
             if (minIn > maxIn)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/Range/DoubleRangeFacetCounts.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/Range/DoubleRangeFacetCounts.cs b/Lucene.Net.Facet/Range/DoubleRangeFacetCounts.cs
index f6908dc..4bfea35 100644
--- a/Lucene.Net.Facet/Range/DoubleRangeFacetCounts.cs
+++ b/Lucene.Net.Facet/Range/DoubleRangeFacetCounts.cs
@@ -93,7 +93,7 @@ namespace Lucene.Net.Facet.Range
         private void Count(ValueSource valueSource, IEnumerable<MatchingDocs> matchingDocs)
         {
 
-            DoubleRange[] ranges = (DoubleRange[])this.ranges;
+            DoubleRange[] ranges = (DoubleRange[])this.Ranges;
 
             LongRange[] longRanges = new LongRange[ranges.Length];
             for (int i = 0; i < ranges.Length; i++)
@@ -109,11 +109,11 @@ namespace Lucene.Net.Facet.Range
             {
                 FunctionValues fv = valueSource.GetValues(new Dictionary<string,object>(), hits.context);
 
-                totCount += hits.totalHits;
+                TotCount += hits.totalHits;
                 Bits bits;
-                if (fastMatchFilter != null)
+                if (FastMatchFilter != null)
                 {
-                    DocIdSet dis = fastMatchFilter.GetDocIdSet(hits.context, null);
+                    DocIdSet dis = FastMatchFilter.GetDocIdSet(hits.context, null);
                     if (dis == null)
                     {
                         // No documents match
@@ -152,8 +152,8 @@ namespace Lucene.Net.Facet.Range
                 }
             }
 
-            missingCount += counter.fillCounts(counts);
-            totCount -= missingCount;
+            missingCount += counter.fillCounts(Counts);
+            TotCount -= missingCount;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/Range/LongRangeFacetCounts.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/Range/LongRangeFacetCounts.cs b/Lucene.Net.Facet/Range/LongRangeFacetCounts.cs
index d8dfb15..8435bbe 100644
--- a/Lucene.Net.Facet/Range/LongRangeFacetCounts.cs
+++ b/Lucene.Net.Facet/Range/LongRangeFacetCounts.cs
@@ -80,7 +80,7 @@ namespace Lucene.Net.Facet.Range
         private void Count(ValueSource valueSource, IList<MatchingDocs> matchingDocs)
         {
 
-            LongRange[] ranges = (LongRange[])this.ranges;
+            LongRange[] ranges = (LongRange[])this.Ranges;
 
             LongRangeCounter counter = new LongRangeCounter(ranges);
 
@@ -89,11 +89,11 @@ namespace Lucene.Net.Facet.Range
             {
                 FunctionValues fv = valueSource.GetValues(new Dictionary<string, object>(), hits.context);
 
-                totCount += hits.totalHits;
+                TotCount += hits.totalHits;
                 Bits bits;
-                if (fastMatchFilter != null)
+                if (FastMatchFilter != null)
                 {
-                    DocIdSet dis = fastMatchFilter.GetDocIdSet(hits.context, null);
+                    DocIdSet dis = FastMatchFilter.GetDocIdSet(hits.context, null);
                     if (dis == null)
                     {
                         // No documents match
@@ -131,12 +131,12 @@ namespace Lucene.Net.Facet.Range
                 }
             }
 
-            int x = counter.fillCounts(counts);
+            int x = counter.fillCounts(Counts);
 
             missingCount += x;
 
             //System.out.println("totCount " + totCount + " missingCount " + counter.missingCount);
-            totCount -= missingCount;
+            TotCount -= missingCount;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/Range/RangeFacetCounts.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/Range/RangeFacetCounts.cs b/Lucene.Net.Facet/Range/RangeFacetCounts.cs
index 11c7e09..29e02fb 100644
--- a/Lucene.Net.Facet/Range/RangeFacetCounts.cs
+++ b/Lucene.Net.Facet/Range/RangeFacetCounts.cs
@@ -34,11 +34,11 @@ namespace Lucene.Net.Facet.Range
     {
         /// <summary>
         /// Ranges passed to constructor. </summary>
-        protected internal readonly Range[] ranges;
+        protected internal readonly Range[] Ranges;
 
         /// <summary>
         /// Counts, initialized in by subclass. </summary>
-        protected internal readonly int[] counts;
+        protected internal readonly int[] Counts;
 
         /// <summary>
         /// Optional: if specified, we first test this Filter to
@@ -46,42 +46,42 @@ namespace Lucene.Net.Facet.Range
         ///  matching ranges.  If this is null, all documents are
         ///  checked. 
         /// </summary>
-        protected internal readonly Filter fastMatchFilter;
+        protected internal readonly Filter FastMatchFilter;
 
         /// <summary>
         /// Our field name. </summary>
-        protected internal readonly string field;
+        protected internal readonly string Field;
 
         /// <summary>
         /// Total number of hits. </summary>
-        protected internal int totCount;
+        protected internal int TotCount;
 
         /// <summary>
         /// Create {@code RangeFacetCounts} </summary>
         protected internal RangeFacetCounts(string field, Range[] ranges, Filter fastMatchFilter)
         {
-            this.field = field;
-            this.ranges = ranges;
-            this.fastMatchFilter = fastMatchFilter;
-            counts = new int[ranges.Length];
+            this.Field = field;
+            this.Ranges = ranges;
+            this.FastMatchFilter = fastMatchFilter;
+            Counts = new int[ranges.Length];
         }
 
         public override FacetResult GetTopChildren(int topN, string dim, params string[] path)
         {
-            if (dim.Equals(field) == false)
+            if (dim.Equals(Field) == false)
             {
-                throw new System.ArgumentException("invalid dim \"" + dim + "\"; should be \"" + field + "\"");
+                throw new System.ArgumentException("invalid dim \"" + dim + "\"; should be \"" + Field + "\"");
             }
             if (path.Length != 0)
             {
                 throw new System.ArgumentException("path.length should be 0");
             }
-            LabelAndValue[] labelValues = new LabelAndValue[counts.Length];
-            for (int i = 0; i < counts.Length; i++)
+            LabelAndValue[] labelValues = new LabelAndValue[Counts.Length];
+            for (int i = 0; i < Counts.Length; i++)
             {
-                labelValues[i] = new LabelAndValue(ranges[i].Label, counts[i]);
+                labelValues[i] = new LabelAndValue(Ranges[i].Label, Counts[i]);
             }
-            return new FacetResult(dim, path, totCount, labelValues, labelValues.Length);
+            return new FacetResult(dim, path, TotCount, labelValues, labelValues.Length);
         }
 
         public override float GetSpecificValue(string dim, params string[] path)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/SortedSet/SortedSetDocValuesFacetCounts.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/SortedSet/SortedSetDocValuesFacetCounts.cs b/Lucene.Net.Facet/SortedSet/SortedSetDocValuesFacetCounts.cs
index aa2f40a..8ccb190 100644
--- a/Lucene.Net.Facet/SortedSet/SortedSetDocValuesFacetCounts.cs
+++ b/Lucene.Net.Facet/SortedSet/SortedSetDocValuesFacetCounts.cs
@@ -123,8 +123,8 @@ namespace Lucene.Net.Facet.SortedSet
                         {
                             reuse = new TopOrdAndIntQueue.OrdAndValue();
                         }
-                        reuse.ord = ord;
-                        reuse.value = counts[ord];
+                        reuse.Ord = ord;
+                        reuse.Value = counts[ord];
                         if (q == null)
                         {
                             // Lazy init, so we don't create this for the
@@ -134,7 +134,7 @@ namespace Lucene.Net.Facet.SortedSet
                         reuse = q.InsertWithOverflow(reuse);
                         if (q.Size() == topN)
                         {
-                            bottomCount = q.Top().value;
+                            bottomCount = q.Top().Value;
                         }
                     }
                 }
@@ -150,9 +150,9 @@ namespace Lucene.Net.Facet.SortedSet
             {
                 TopOrdAndIntQueue.OrdAndValue ordAndValue = q.Pop();
                 var term = new BytesRef();
-                dv.LookupOrd(ordAndValue.ord, term);
+                dv.LookupOrd(ordAndValue.Ord, term);
                 string[] parts = FacetsConfig.StringToPath(term.Utf8ToString());
-                labelValues[i] = new LabelAndValue(parts[1], ordAndValue.value);
+                labelValues[i] = new LabelAndValue(parts[1], ordAndValue.Value);
             }
 
             return new FacetResult(dim, new string[0], dimCount, labelValues, childCount);
@@ -183,13 +183,13 @@ namespace Lucene.Net.Facet.SortedSet
             foreach (FacetsCollector.MatchingDocs hits in matchingDocs)
             {
 
-                AtomicReader reader = hits.context.AtomicReader;
+                var reader = hits.context.AtomicReader;
                 //System.out.println("  reader=" + reader);
                 // LUCENE-5090: make sure the provided reader context "matches"
                 // the top-level reader passed to the
                 // SortedSetDocValuesReaderState, else cryptic
                 // AIOOBE can happen:
-                if (ReaderUtil.GetTopLevelContext(hits.context).Reader != origReader)
+                if (!Equals(ReaderUtil.GetTopLevelContext(hits.context).Reader, origReader))
                 {
                     throw new ThreadStateException("the SortedSetDocValuesReaderState provided to this class does not match the reader being searched; you must create a new SortedSetDocValuesReaderState every time you open a new IndexReader");
                 }
@@ -331,17 +331,17 @@ namespace Lucene.Net.Facet.SortedSet
 
             public virtual int Compare(FacetResult a, FacetResult b)
             {
-                if ((int)a.value > (int)b.value)
+                if ((int)a.Value > (int)b.Value)
                 {
                     return -1;
                 }
-                else if ((int)b.value > (int)a.value)
+                else if ((int)b.Value > (int)a.Value)
                 {
                     return 1;
                 }
                 else
                 {
-                    return a.dim.CompareTo(b.dim);
+                    return a.Dim.CompareTo(b.Dim);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/SortedSet/SortedSetDocValuesFacetField.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/SortedSet/SortedSetDocValuesFacetField.cs b/Lucene.Net.Facet/SortedSet/SortedSetDocValuesFacetField.cs
index ee011a3..c860d56 100644
--- a/Lucene.Net.Facet/SortedSet/SortedSetDocValuesFacetField.cs
+++ b/Lucene.Net.Facet/SortedSet/SortedSetDocValuesFacetField.cs
@@ -50,8 +50,8 @@
         public SortedSetDocValuesFacetField(string dim, string label)
             : base("dummy", TYPE)
         {
-            FacetField.verifyLabel(label);
-            FacetField.verifyLabel(dim);
+            FacetField.VerifyLabel(label);
+            FacetField.VerifyLabel(dim);
             this.Dim = dim;
             this.Label = label;
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/Taxonomy/AssociationFacetField.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/Taxonomy/AssociationFacetField.cs b/Lucene.Net.Facet/Taxonomy/AssociationFacetField.cs
index 5835fd2..6113eef 100644
--- a/Lucene.Net.Facet/Taxonomy/AssociationFacetField.cs
+++ b/Lucene.Net.Facet/Taxonomy/AssociationFacetField.cs
@@ -68,10 +68,10 @@ namespace Lucene.Net.Facet.Taxonomy
         public AssociationFacetField(BytesRef assoc, string dim, params string[] path)
             : base("dummy", TYPE)
         {
-            FacetField.verifyLabel(dim);
+            FacetField.VerifyLabel(dim);
             foreach (string label in path)
             {
-                FacetField.verifyLabel(label);
+                FacetField.VerifyLabel(label);
             }
             this.dim = dim;
             this.assoc = assoc;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyReader.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyReader.cs b/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyReader.cs
index f61187c..a567210 100644
--- a/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyReader.cs
+++ b/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyReader.cs
@@ -163,7 +163,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
         /// through <seealso cref="#setCacheSize(int)"/>, it will affect both reader instances.
         /// </para>
         /// </summary>
-        protected internal override TaxonomyReader DoOpenIfChanged()
+        protected override TaxonomyReader DoOpenIfChanged()
         {
             EnsureOpen();
 
@@ -287,7 +287,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
         public override int GetOrdinal(FacetLabel cp)
         {
             EnsureOpen();
-            if (cp.length == 0)
+            if (cp.Length == 0)
             {
                 return ROOT_ORDINAL;
             }
@@ -319,7 +319,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
             // If we're still here, we have a cache miss. We need to fetch the
             // value from disk, and then also put it in the cache:
             int ret = TaxonomyReader.INVALID_ORDINAL;
-            DocsEnum docs = MultiFields.GetTermDocsEnum(indexReader, null, Consts.FULL, new BytesRef(FacetsConfig.PathToString(cp.components, cp.length)), 0);
+            DocsEnum docs = MultiFields.GetTermDocsEnum(indexReader, null, Consts.FULL, new BytesRef(FacetsConfig.PathToString(cp.Components, cp.Length)), 0);
             if (docs != null && docs.NextDoc() != DocIdSetIterator.NO_MORE_DOCS)
             {
                 ret = docs.DocID();
@@ -426,7 +426,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
                         sb.Append(i + ": NULL!! \n");
                         continue;
                     }
-                    if (category.length == 0)
+                    if (category.Length == 0)
                     {
                         sb.Append(i + ": EMPTY STRING!! \n");
                         continue;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyWriter.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyWriter.cs b/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyWriter.cs
index 6802b57..63967ee 100644
--- a/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyWriter.cs
+++ b/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyWriter.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections;
+using System.Collections.Concurrent;
 using System.Diagnostics;
 using System.Collections.Generic;
 using System.IO;
@@ -438,7 +439,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
                 DirectoryReader reader = readerManager.Acquire();
                 try
                 {
-                    BytesRef catTerm = new BytesRef(FacetsConfig.PathToString(categoryPath.components, categoryPath.length));
+                    BytesRef catTerm = new BytesRef(FacetsConfig.PathToString(categoryPath.Components, categoryPath.Length));
                     TermsEnum termsEnum = null; // reuse
                     DocsEnum docs = null; // reuse
                     foreach (AtomicReaderContext ctx in reader.Leaves)
@@ -514,16 +515,16 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
             // ordinal as payloads (rather than a stored field; payloads can be
             // more efficiently read into memory in bulk by LuceneTaxonomyReader)
             int parent;
-            if (cp.length > 1)
+            if (cp.Length > 1)
             {
-                FacetLabel parentPath = cp.Subpath(cp.length - 1);
+                FacetLabel parentPath = cp.Subpath(cp.Length - 1);
                 parent = FindCategory(parentPath);
                 if (parent < 0)
                 {
                     parent = InternalAddCategory(parentPath);
                 }
             }
-            else if (cp.length == 1)
+            else if (cp.Length == 1)
             {
                 parent = TaxonomyReader.ROOT_ORDINAL;
             }
@@ -567,7 +568,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
             Document d = new Document();
             d.Add(parentStreamField);
 
-            fullPathField.StringValue = FacetsConfig.PathToString(categoryPath.components, categoryPath.length);
+            fullPathField.StringValue = FacetsConfig.PathToString(categoryPath.Components, categoryPath.Length);
             d.Add(fullPathField);
 
             // Note that we do no pass an Analyzer here because the fields that are
@@ -986,7 +987,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
             /// needed. Calling it will also free all resources that the map might
             /// be holding (such as temporary disk space), other than the returned int[].
             /// </summary>
-            Dictionary<int,int> Map { get; }
+            int[] Map { get; }
         }
 
         /// <summary>
@@ -994,27 +995,37 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
         /// </summary>
         public sealed class MemoryOrdinalMap : OrdinalMap
         {
-            internal Dictionary<int, int> map;
+            internal int[] map;
 
             /// <summary>
             /// Sole constructor. 
             /// </summary>
             public MemoryOrdinalMap()
             {
-                map = new Dictionary<int,int>();
+                map = new int[] { };
             }
 
             public int Size { set; private get; }
 
             public void AddMapping(int origOrdinal, int newOrdinal)
             {
-                map[origOrdinal] = newOrdinal;
+                if (map.Length - 1 >= origOrdinal)
+                {
+                    map[origOrdinal] = newOrdinal;
+                }
+                else
+                {
+                    Array.Resize(ref map, origOrdinal + 1);
+                    map[origOrdinal] = newOrdinal;
+                }
+
+
             }
 
             public void AddDone() // nothing to do
             {
             }
-            public Dictionary<int, int> Map
+            public int[] Map
             {
                 get
                 {
@@ -1064,9 +1075,9 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
                 }
             }
 
-            Dictionary<int,int> map = null;
+            int[] map = null;
 
-            public Dictionary<int,int> Map
+            public int[] Map
             {
                 get
                 {
@@ -1078,11 +1089,11 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
 
                     var ifs = new FileStream(tmpfile, FileMode.OpenOrCreate, FileAccess.Read);
                     var @in = new InputStreamDataInput(ifs);
-                    map = new Dictionary<int, int>(@in.ReadInt());
+                    map = new int[@in.ReadInt()];
                     // NOTE: The current code assumes here that the map is complete,
                     // i.e., every ordinal gets one and exactly one value. Otherwise,
                     // we may run into an EOF here, or vice versa, not read everything.
-                    for (int i = 0; i < map.Count; i++)
+                    for (int i = 0; i < map.Length; i++)
                     {
                         int origordinal = @in.ReadInt();
                         int newordinal = @in.ReadInt();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/Taxonomy/FacetLabel.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/Taxonomy/FacetLabel.cs b/Lucene.Net.Facet/Taxonomy/FacetLabel.cs
index 287a18c..a448d08 100644
--- a/Lucene.Net.Facet/Taxonomy/FacetLabel.cs
+++ b/Lucene.Net.Facet/Taxonomy/FacetLabel.cs
@@ -22,8 +22,8 @@ namespace Lucene.Net.Facet.Taxonomy
      * limitations under the License.
      */
 
-    using LruTaxonomyWriterCache = Lucene.Net.Facet.Taxonomy.WriterCache.LruTaxonomyWriterCache; 
-    using NameHashIntCacheLRU = Lucene.Net.Facet.Taxonomy.WriterCache.NameHashIntCacheLRU; 
+    using LruTaxonomyWriterCache = Lucene.Net.Facet.Taxonomy.WriterCache.LruTaxonomyWriterCache;
+    using NameHashIntCacheLRU = Lucene.Net.Facet.Taxonomy.WriterCache.NameHashIntCacheLRU;
 
     /// <summary>
     /// Holds a sequence of string components, specifying the hierarchical name of a
@@ -51,11 +51,11 @@ namespace Lucene.Net.Facet.Taxonomy
         /// <seealso cref="#subpath(int)"/>, therefore you should traverse the array up to
         /// <seealso cref="#length"/> for this path's components.
         /// </summary>
-        public readonly string[] components;
+        public readonly string[] Components;
 
         /// <summary>
         /// The number of components of this <seealso cref="FacetLabel"/>. </summary>
-        public readonly int length;
+        public readonly int Length;
 
         // Used by subpath
         private FacetLabel(FacetLabel copyFrom, int prefixLen)
@@ -63,17 +63,17 @@ namespace Lucene.Net.Facet.Taxonomy
             // while the code which calls this method is safe, at some point a test
             // tripped on AIOOBE in toString, but we failed to reproduce. adding the
             // assert as a safety check.
-            Debug.Assert(prefixLen >= 0 && prefixLen <= copyFrom.components.Length, "prefixLen cannot be negative nor larger than the given components' length: prefixLen=" + prefixLen + " components.length=" + copyFrom.components.Length);
-            this.components = copyFrom.components;
-            length = prefixLen;
+            Debug.Assert(prefixLen >= 0 && prefixLen <= copyFrom.Components.Length, "prefixLen cannot be negative nor larger than the given components' length: prefixLen=" + prefixLen + " components.length=" + copyFrom.Components.Length);
+            this.Components = copyFrom.Components;
+            Length = prefixLen;
         }
 
         /// <summary>
         /// Construct from the given path components. </summary>
         public FacetLabel(params string[] components)
         {
-            this.components = components;
-            length = components.Length;
+            this.Components = components;
+            Length = components.Length;
             CheckComponents();
         }
 
@@ -81,28 +81,28 @@ namespace Lucene.Net.Facet.Taxonomy
         /// Construct from the dimension plus the given path components. </summary>
         public FacetLabel(string dim, string[] path)
         {
-            components = new string[1 + path.Length];
-            components[0] = dim;
-            Array.Copy(path, 0, components, 1, path.Length);
-            length = components.Length;
+            Components = new string[1 + path.Length];
+            Components[0] = dim;
+            Array.Copy(path, 0, Components, 1, path.Length);
+            Length = Components.Length;
             CheckComponents();
         }
 
         private void CheckComponents()
         {
             long len = 0;
-            foreach (string comp in components)
+            foreach (string comp in Components)
             {
                 if (string.IsNullOrEmpty(comp))
                 {
-                    throw new System.ArgumentException("empty or null components not allowed: " + Arrays.ToString(components));
+                    throw new System.ArgumentException("empty or null components not allowed: " + Arrays.ToString(Components));
                 }
                 len += comp.Length;
             }
-            len += components.Length - 1; // add separators
+            len += Components.Length - 1; // add separators
             if (len > MAX_CATEGORY_PATH_LENGTH)
             {
-                throw new System.ArgumentException("category path exceeds maximum allowed path length: max=" + MAX_CATEGORY_PATH_LENGTH + " len=" + len + " path=" + Arrays.ToString(components).Substring(0, 30) + "...");
+                throw new System.ArgumentException("category path exceeds maximum allowed path length: max=" + MAX_CATEGORY_PATH_LENGTH + " len=" + len + " path=" + Arrays.ToString(Components).Substring(0, 30) + "...");
             }
         }
 
@@ -112,10 +112,10 @@ namespace Lucene.Net.Facet.Taxonomy
         /// </summary>
         public virtual int CompareTo(FacetLabel other)
         {
-            int len = length < other.length ? length : other.length;
+            int len = Length < other.Length ? Length : other.Length;
             for (int i = 0, j = 0; i < len; i++, j++)
             {
-                int cmp = components[i].CompareTo(other.components[j]);
+                int cmp = Components[i].CompareTo(other.Components[j]);
                 if (cmp < 0)
                 {
                     return -1; // this is 'before'
@@ -127,7 +127,7 @@ namespace Lucene.Net.Facet.Taxonomy
             }
 
             // one is a prefix of the other
-            return length - other.length;
+            return Length - other.Length;
         }
 
         public override bool Equals(object obj)
@@ -138,16 +138,16 @@ namespace Lucene.Net.Facet.Taxonomy
             }
 
             FacetLabel other = (FacetLabel)obj;
-            if (length != other.length)
+            if (Length != other.Length)
             {
                 return false; // not same length, cannot be equal
             }
 
             // CategoryPaths are more likely to differ at the last components, so start
             // from last-first
-            for (int i = length - 1; i >= 0; i--)
+            for (int i = Length - 1; i >= 0; i--)
             {
-                if (!components[i].Equals(other.components[i]))
+                if (!string.Equals(Components[i], other.Components[i]))
                 {
                     return false;
                 }
@@ -157,17 +157,12 @@ namespace Lucene.Net.Facet.Taxonomy
 
         public override int GetHashCode()
         {
-            if (length == 0)
+            if (Length == 0)
             {
                 return 0;
             }
 
-            int hash = length;
-            for (int i = 0; i < length; i++)
-            {
-                hash = hash * 31 + components[i].GetHashCode();
-            }
-            return hash;
+            return Arrays.GetHashCode(Components);
         }
 
         /// <summary>
@@ -179,15 +174,15 @@ namespace Lucene.Net.Facet.Taxonomy
         /// </summary>
         public virtual long LongHashCode()
         {
-            if (length == 0)
+            if (Length == 0)
             {
                 return 0;
             }
 
-            long hash = length;
-            for (int i = 0; i < length; i++)
+            long hash = Length;
+            for (int i = 0; i < Length; i++)
             {
-                hash = hash * 65599 + components[i].GetHashCode();
+                hash = hash * 65599 + Components[i].GetHashCode();
             }
             return hash;
         }
@@ -196,7 +191,7 @@ namespace Lucene.Net.Facet.Taxonomy
         /// Returns a sub-path of this path up to {@code length} components. </summary>
         public virtual FacetLabel Subpath(int len)
         {
-            if (len >= this.length || len < 0)
+            if (len >= this.Length || len < 0)
             {
                 return this;
             }
@@ -211,12 +206,12 @@ namespace Lucene.Net.Facet.Taxonomy
         /// </summary>
         public override string ToString()
         {
-            if (length == 0)
+            if (Length == 0)
             {
                 return "FacetLabel: []";
             }
-            string[] parts = new string[length];
-            Array.Copy(components, 0, parts, 0, length);
+            string[] parts = new string[Length];
+            Array.Copy(Components, 0, parts, 0, Length);
             return "FacetLabel: [" + Arrays.ToString(parts) + "]";
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/Taxonomy/FloatTaxonomyFacets.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/Taxonomy/FloatTaxonomyFacets.cs b/Lucene.Net.Facet/Taxonomy/FloatTaxonomyFacets.cs
index 9dbe71d..3921540 100644
--- a/Lucene.Net.Facet/Taxonomy/FloatTaxonomyFacets.cs
+++ b/Lucene.Net.Facet/Taxonomy/FloatTaxonomyFacets.cs
@@ -52,7 +52,7 @@ namespace Lucene.Net.Facet.Taxonomy
             {
                 string dim = ent.Key;
                 FacetsConfig.DimConfig ft = ent.Value;
-                if (ft.hierarchical && ft.multiValued == false)
+                if (ft.Hierarchical && ft.MultiValued == false)
                 {
                     int dimRootOrd = TaxoReader.GetOrdinal(new FacetLabel(dim));
                     Debug.Assert(dimRootOrd > 0);
@@ -79,11 +79,11 @@ namespace Lucene.Net.Facet.Taxonomy
             FacetsConfig.DimConfig dimConfig = VerifyDim(dim);
             if (path.Length == 0)
             {
-                if (dimConfig.hierarchical && dimConfig.multiValued == false)
+                if (dimConfig.Hierarchical && dimConfig.MultiValued == false)
                 {
                     // ok: rolled up at search time
                 }
-                else if (dimConfig.requireDimCount && dimConfig.multiValued)
+                else if (dimConfig.RequireDimCount && dimConfig.MultiValued)
                 {
                     // ok: we indexed all ords at index time
                 }
@@ -152,9 +152,9 @@ namespace Lucene.Net.Facet.Taxonomy
                 return null;
             }
 
-            if (dimConfig.multiValued)
+            if (dimConfig.MultiValued)
             {
-                if (dimConfig.requireDimCount)
+                if (dimConfig.RequireDimCount)
                 {
                     sumValues = values[dimOrd];
                 }
@@ -174,7 +174,7 @@ namespace Lucene.Net.Facet.Taxonomy
             {
                 TopOrdAndFloatQueue.OrdAndValue ordAndValue = q.Pop();
                 FacetLabel child = TaxoReader.GetPath(ordAndValue.ord);
-                labelValues[i] = new LabelAndValue(child.components[cp.length], ordAndValue.value);
+                labelValues[i] = new LabelAndValue(child.Components[cp.Length], ordAndValue.value);
             }
 
             return new FacetResult(dim, path, sumValues, labelValues, childCount);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/Taxonomy/IntTaxonomyFacets.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/Taxonomy/IntTaxonomyFacets.cs b/Lucene.Net.Facet/Taxonomy/IntTaxonomyFacets.cs
index ad40137..f73f167 100644
--- a/Lucene.Net.Facet/Taxonomy/IntTaxonomyFacets.cs
+++ b/Lucene.Net.Facet/Taxonomy/IntTaxonomyFacets.cs
@@ -53,7 +53,7 @@ namespace Lucene.Net.Facet.Taxonomy
             {
                 string dim = ent.Key;
                 FacetsConfig.DimConfig ft = ent.Value;
-                if (ft.hierarchical && ft.multiValued == false)
+                if (ft.Hierarchical && ft.MultiValued == false)
                 {
                     int dimRootOrd = TaxoReader.GetOrdinal(new FacetLabel(dim));
                     // It can be -1 if this field was declared in the
@@ -84,11 +84,11 @@ namespace Lucene.Net.Facet.Taxonomy
             var dimConfig = VerifyDim(dim);
             if (path.Length == 0)
             {
-                if (dimConfig.hierarchical && dimConfig.multiValued == false)
+                if (dimConfig.Hierarchical && dimConfig.MultiValued == false)
                 {
                     // ok: rolled up at search time
                 }
-                else if (dimConfig.requireDimCount && dimConfig.multiValued)
+                else if (dimConfig.RequireDimCount && dimConfig.MultiValued)
                 {
                     // ok: we indexed all ords at index time
                 }
@@ -140,12 +140,12 @@ namespace Lucene.Net.Facet.Taxonomy
                         {
                             reuse = new TopOrdAndIntQueue.OrdAndValue();
                         }
-                        reuse.ord = ord;
-                        reuse.value = values[ord];
+                        reuse.Ord = ord;
+                        reuse.Value = values[ord];
                         reuse = q.InsertWithOverflow(reuse);
                         if (q.Size() == topN)
                         {
-                            bottomValue = q.Top().value;
+                            bottomValue = q.Top().Value;
                         }
                     }
                 }
@@ -158,9 +158,9 @@ namespace Lucene.Net.Facet.Taxonomy
                 return null;
             }
 
-            if (dimConfig.multiValued)
+            if (dimConfig.MultiValued)
             {
-                if (dimConfig.requireDimCount)
+                if (dimConfig.RequireDimCount)
                 {
                     totValue = values[dimOrd];
                 }
@@ -179,8 +179,8 @@ namespace Lucene.Net.Facet.Taxonomy
             for (int i = labelValues.Length - 1; i >= 0; i--)
             {
                 TopOrdAndIntQueue.OrdAndValue ordAndValue = q.Pop();
-                FacetLabel child = TaxoReader.GetPath(ordAndValue.ord);
-                labelValues[i] = new LabelAndValue(child.components[cp.length], ordAndValue.value);
+                FacetLabel child = TaxoReader.GetPath(ordAndValue.Ord);
+                labelValues[i] = new LabelAndValue(child.Components[cp.Length], ordAndValue.Value);
             }
 
             return new FacetResult(dim, path, totValue, labelValues, childCount);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/Taxonomy/PrintTaxonomyStats.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/Taxonomy/PrintTaxonomyStats.cs b/Lucene.Net.Facet/Taxonomy/PrintTaxonomyStats.cs
index bfcbda7..a4b44aa 100644
--- a/Lucene.Net.Facet/Taxonomy/PrintTaxonomyStats.cs
+++ b/Lucene.Net.Facet/Taxonomy/PrintTaxonomyStats.cs
@@ -86,7 +86,7 @@ namespace Lucene.Net.Facet.Taxonomy
                     numImmediateChildren++;
                 }
                 FacetLabel cp = r.GetPath(child);
-                @out.WriteLine("/" + cp.components[0] + ": " + numImmediateChildren + " immediate children; " + (1 + CountAllChildren(r, child)) + " total categories");
+                @out.WriteLine("/" + cp.Components[0] + ": " + numImmediateChildren + " immediate children; " + (1 + CountAllChildren(r, child)) + " total categories");
                 if (printTree)
                 {
                     PrintAllChildren(@out, r, child, "  ", 1);
@@ -112,7 +112,7 @@ namespace Lucene.Net.Facet.Taxonomy
             int child;
             while ((child = it.Next()) != TaxonomyReader.INVALID_ORDINAL)
             {
-                @out.WriteLine(indent + "/" + r.GetPath(child).components[depth]);
+                @out.WriteLine(indent + "/" + r.GetPath(child).Components[depth]);
                 PrintAllChildren(@out, r, child, indent + "  ", depth + 1);
             }
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/Taxonomy/TaxonomyFacets.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/Taxonomy/TaxonomyFacets.cs b/Lucene.Net.Facet/Taxonomy/TaxonomyFacets.cs
index b23530d..355ff6c 100644
--- a/Lucene.Net.Facet/Taxonomy/TaxonomyFacets.cs
+++ b/Lucene.Net.Facet/Taxonomy/TaxonomyFacets.cs
@@ -41,44 +41,44 @@ namespace Lucene.Net.Facet.Taxonomy
 
             public virtual int Compare(FacetResult a, FacetResult b)
             {
-                if ((double)a.value > (double)b.value)
+                if (a.Value > b.Value)
                 {
                     return -1;
                 }
-                else if ((double)b.value > (double)a.value)
+                else if (b.Value > a.Value)
                 {
                     return 1;
                 }
                 else
                 {
-                    return a.dim.CompareTo(b.dim);
+                    return a.Dim.CompareTo(b.Dim);
                 }
             }
         }
 
         /// <summary>
         /// Index field name provided to the constructor. </summary>
-        protected internal readonly string IndexFieldName;
+        protected readonly string IndexFieldName;
 
         /// <summary>
         /// {@code TaxonomyReader} provided to the constructor. </summary>
-        protected internal readonly TaxonomyReader TaxoReader;
+        protected readonly TaxonomyReader TaxoReader;
 
         /// <summary>
         /// {@code FacetsConfig} provided to the constructor. </summary>
-        protected internal readonly FacetsConfig Config;
+        protected readonly FacetsConfig Config;
 
         /// <summary>
         /// Maps parent ordinal to its child, or -1 if the parent
         ///  is childless. 
         /// </summary>
-        protected internal readonly int[] Children;
+        protected readonly int[] Children;
 
         /// <summary>
         /// Maps an ordinal to its sibling, or -1 if there is no
         ///  sibling. 
         /// </summary>
-        protected internal readonly int[] Siblings;
+        protected readonly int[] Siblings;
 
         /// <summary>
         /// Sole constructor. 
@@ -101,7 +101,7 @@ namespace Lucene.Net.Facet.Taxonomy
         protected internal virtual DimConfig VerifyDim(string dim)
         {
             DimConfig dimConfig = Config.GetDimConfig(dim);
-            if (!dimConfig.indexFieldName.Equals(IndexFieldName))
+            if (!dimConfig.IndexFieldName.Equals(IndexFieldName))
             {
                 throw new System.ArgumentException("dimension \"" + dim + "\" was not indexed into field \"" + IndexFieldName);
             }
@@ -114,9 +114,9 @@ namespace Lucene.Net.Facet.Taxonomy
             IList<FacetResult> results = new List<FacetResult>();
             while (ord != TaxonomyReader.INVALID_ORDINAL)
             {
-                string dim = TaxoReader.GetPath(ord).components[0];
+                string dim = TaxoReader.GetPath(ord).Components[0];
                 DimConfig dimConfig = Config.GetDimConfig(dim);
-                if (dimConfig.indexFieldName.Equals(IndexFieldName))
+                if (dimConfig.IndexFieldName.Equals(IndexFieldName))
                 {
                     FacetResult result = GetTopChildren(topN, dim);
                     if (result != null)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/Taxonomy/TaxonomyReader.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/Taxonomy/TaxonomyReader.cs b/Lucene.Net.Facet/Taxonomy/TaxonomyReader.cs
index aaee8fe..55c8f27 100644
--- a/Lucene.Net.Facet/Taxonomy/TaxonomyReader.cs
+++ b/Lucene.Net.Facet/Taxonomy/TaxonomyReader.cs
@@ -154,12 +154,12 @@ namespace Lucene.Net.Facet.Taxonomy
         /// the taxonomy has changed.
         /// </summary>
         /// <seealso cref= #openIfChanged(TaxonomyReader) </seealso>
-        protected internal abstract TaxonomyReader DoOpenIfChanged();
+        protected abstract TaxonomyReader DoOpenIfChanged();
 
         /// <summary>
         /// Throws <seealso cref="AlreadyClosedException"/> if this IndexReader is closed
         /// </summary>
-        protected internal void EnsureOpen()
+        protected void EnsureOpen()
         {
             if (RefCount <= 0)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/Taxonomy/WriterCache/CategoryPathUtils.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/Taxonomy/WriterCache/CategoryPathUtils.cs b/Lucene.Net.Facet/Taxonomy/WriterCache/CategoryPathUtils.cs
index 36e5db1..24b0fa2 100644
--- a/Lucene.Net.Facet/Taxonomy/WriterCache/CategoryPathUtils.cs
+++ b/Lucene.Net.Facet/Taxonomy/WriterCache/CategoryPathUtils.cs
@@ -27,15 +27,15 @@
         /// Serializes the given <seealso cref="FacetLabel"/> to the <seealso cref="CharBlockArray"/>. </summary>
         public static void Serialize(FacetLabel cp, CharBlockArray charBlockArray)
         {
-            charBlockArray.Append((char)cp.length);
-            if (cp.length == 0)
+            charBlockArray.Append((char)cp.Length);
+            if (cp.Length == 0)
             {
                 return;
             }
-            for (int i = 0; i < cp.length; i++)
+            for (int i = 0; i < cp.Length; i++)
             {
-                charBlockArray.Append((char)cp.components[i].Length);
-                charBlockArray.Append(cp.components[i]);
+                charBlockArray.Append((char)cp.Components[i].Length);
+                charBlockArray.Append(cp.Components[i]);
             }
         }
 
@@ -68,24 +68,24 @@
         public static bool EqualsToSerialized(FacetLabel cp, CharBlockArray charBlockArray, int offset)
         {
             int n = charBlockArray.CharAt(offset++);
-            if (cp.length != n)
+            if (cp.Length != n)
             {
                 return false;
             }
-            if (cp.length == 0)
+            if (cp.Length == 0)
             {
                 return true;
             }
 
-            for (int i = 0; i < cp.length; i++)
+            for (int i = 0; i < cp.Length; i++)
             {
                 int len = charBlockArray.CharAt(offset++);
-                if (len != cp.components[i].Length)
+                if (len != cp.Components[i].Length)
                 {
                     return false;
                 }
 
-                if (!cp.components[i].Equals(charBlockArray.SubSequence(offset, offset + len)))
+                if (!cp.Components[i].Equals(charBlockArray.SubSequence(offset, offset + len)))
                 {
                     return false;
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/Taxonomy/WriterCache/CharBlockArray.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/Taxonomy/WriterCache/CharBlockArray.cs b/Lucene.Net.Facet/Taxonomy/WriterCache/CharBlockArray.cs
index 4695eb0..a6a60e7 100644
--- a/Lucene.Net.Facet/Taxonomy/WriterCache/CharBlockArray.cs
+++ b/Lucene.Net.Facet/Taxonomy/WriterCache/CharBlockArray.cs
@@ -81,7 +81,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
             this.blocks.Add(this.current);
         }
 
-        internal virtual int blockIndex(int index)
+        internal virtual int BlockIndex(int index)
         {
             return index / blockSize;
         }
@@ -180,7 +180,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
 
         public char CharAt(int index)
         {
-            Block b = blocks[blockIndex(index)];
+            Block b = blocks[BlockIndex(index)];
             return b.chars[IndexInBlock(index)];
         }
 
@@ -188,7 +188,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
         {
             int remaining = end - start;
             StringBuilder sb = new StringBuilder(remaining);
-            int blockIdx = blockIndex(start);
+            int blockIdx = BlockIndex(start);
             int indexInBlock = IndexInBlock(start);
             while (remaining > 0)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/Taxonomy/WriterCache/CollisionMap.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/Taxonomy/WriterCache/CollisionMap.cs b/Lucene.Net.Facet/Taxonomy/WriterCache/CollisionMap.cs
index 1adb7b3..000532c 100644
--- a/Lucene.Net.Facet/Taxonomy/WriterCache/CollisionMap.cs
+++ b/Lucene.Net.Facet/Taxonomy/WriterCache/CollisionMap.cs
@@ -1,5 +1,7 @@
 using System;
+using System.Collections;
 using System.Collections.Generic;
+using System.Management.Instrumentation;
 
 namespace Lucene.Net.Facet.Taxonomy.WriterCache
 {
@@ -36,7 +38,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
         private int size_Renamed;
         private int threshold;
 
-        public class Entry
+        internal class Entry
         {
             internal int offset;
             internal int cid;
@@ -84,8 +86,9 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
         }
 
         /// <summary>
-        /// How many slots are allocated. </summary>
-        public virtual int capacity()
+        /// How many slots are allocated. 
+        /// </summary>
+        public virtual int Capacity()
         {
             return this.capacity_Renamed;
         }
@@ -142,7 +145,8 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
         }
 
         /// <summary>
-        /// Add another mapping. </summary>
+        /// Add another mapping. 
+        /// </summary>
         public virtual int AddLabel(FacetLabel label, int hash, int cid)
         {
             int bucketIndex = IndexFor(hash, this.capacity_Renamed);
@@ -182,7 +186,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
             }
         }
 
-        internal virtual EntryIterator entryIterator()
+        internal virtual IEnumerator<CollisionMap.Entry> entryIterator()
         {
             return new EntryIterator(this, entries, size_Renamed);
         }
@@ -221,7 +225,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
             }
         }
 
-        public class EntryIterator 
+        private class EntryIterator : IEnumerator<Entry>
         {
             private readonly CollisionMap outerInstance;
 
@@ -257,7 +261,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
                 Entry e = this.next_Renamed;
                 if (e == null)
                 {
-                    throw new IndexOutOfRangeException();
+                    throw new InstanceNotFoundException();
                 }
 
                 Entry n = e.next;
@@ -277,9 +281,28 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
                 throw new System.NotSupportedException();
             }
 
-            public Entry Current()
+            public void Dispose()
+            {
+            }
+
+            public bool MoveNext()
+            {
+                if (!HasNext())
+                    return false;
+                Current = Next();
+                return true;
+            }
+
+            public void Reset()
+            {
+                index = 0;
+            }
+
+            public Entry Current { get; private set; }
+
+            object IEnumerator.Current
             {
-                return ents[index];
+                get { return Current; }
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/Taxonomy/WriterCache/CompactLabelToOrdinal.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/Taxonomy/WriterCache/CompactLabelToOrdinal.cs b/Lucene.Net.Facet/Taxonomy/WriterCache/CompactLabelToOrdinal.cs
index 9f73968..07bd162 100644
--- a/Lucene.Net.Facet/Taxonomy/WriterCache/CompactLabelToOrdinal.cs
+++ b/Lucene.Net.Facet/Taxonomy/WriterCache/CompactLabelToOrdinal.cs
@@ -58,7 +58,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
         /// Default maximum load factor. </summary>
         public const float DefaultLoadFactor = 0.15f;
 
-        internal const char TERMINATOR_CHAR = (char)0xffff;
+        public const char TERMINATOR_CHAR = (char)0xffff;
         private const int COLLISION = -5;
 
         private HashArray[] hashArrays;
@@ -210,13 +210,14 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
             }
 
             CollisionMap oldCollisionMap = this.collisionMap;
-            this.collisionMap = new CollisionMap(oldCollisionMap.capacity(), this.labelRepository);
+            this.collisionMap = new CollisionMap(oldCollisionMap.Capacity(), this.labelRepository);
             this.threshold = (int)(this.capacity * this.loadFactor);
 
             var it = oldCollisionMap.entryIterator();
-            while (it.HasNext())
+
+            while (it.MoveNext())
             {
-                var e = it.Current();
+                var e = it.Current;
                 AddLabelOffset(StringHashCode(this.labelRepository, e.offset), e.cid, e.offset);
             }
         }
@@ -395,7 +396,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
         /// Opens the file and reloads the CompactLabelToOrdinal. The file it expects
         /// is generated from the <seealso cref="#flush(File)"/> command.
         /// </summary>
-        internal static CompactLabelToOrdinal Open(string file, float loadFactor, int numHashArrays)
+        public static CompactLabelToOrdinal Open(string file, float loadFactor, int numHashArrays)
         {
             /// <summary>
             /// Part of the file is the labelRepository, which needs to be rehashed
@@ -481,7 +482,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
 
         }
 
-        internal virtual void Flush(Stream stream)
+        public virtual void Flush(Stream stream)
         {
 
             OutputStreamDataOutput dos = new OutputStreamDataOutput(stream);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/Lucene.Net.Facet/TopOrdAndIntQueue.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Facet/TopOrdAndIntQueue.cs b/Lucene.Net.Facet/TopOrdAndIntQueue.cs
index 63711f2..08bdffb 100644
--- a/Lucene.Net.Facet/TopOrdAndIntQueue.cs
+++ b/Lucene.Net.Facet/TopOrdAndIntQueue.cs
@@ -36,11 +36,11 @@ namespace Lucene.Net.Facet
 
             /// <summary>
             /// Ordinal of the entry. </summary>
-            public int ord;
+            public int Ord;
 
             /// <summary>
             /// Value associated with the ordinal. </summary>
-            public int value;
+            public int Value;
 
             /// <summary>
             /// Default constructor. </summary>
@@ -58,17 +58,17 @@ namespace Lucene.Net.Facet
 
         public override bool LessThan(OrdAndValue a, OrdAndValue b)
         {
-            if (a.value < b.value)
+            if (a.Value < b.Value)
             {
                 return true;
             }
-            else if (a.value > b.value)
+            else if (a.Value > b.Value)
             {
                 return false;
             }
             else
             {
-                return a.ord > b.ord;
+                return a.Ord > b.Ord;
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/src/Lucene.Net.Core/Index/SortedSetDocValuesWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/SortedSetDocValuesWriter.cs b/src/Lucene.Net.Core/Index/SortedSetDocValuesWriter.cs
index a3fe6a7..6386af6 100644
--- a/src/Lucene.Net.Core/Index/SortedSetDocValuesWriter.cs
+++ b/src/Lucene.Net.Core/Index/SortedSetDocValuesWriter.cs
@@ -200,7 +200,7 @@ namespace Lucene.Net.Index
         {
             AppendingDeltaPackedLongBuffer.Iterator iter = PendingCounts.GetIterator();
 
-            Debug.Assert(maxDoc == Pending.Size(), "MaxDoc: " + maxDoc + ", pending.Size(): " + Pending.Size());
+            //Debug.Assert(maxDoc == Pending.Size(), "MaxDoc: " + maxDoc + ", pending.Size(): " + Pending.Size());
 
             for (int i = 0; i < maxDoc; ++i)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f9ee1240/src/Lucene.Net.Tests/core/Facet/FacetTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Facet/FacetTestCase.cs b/src/Lucene.Net.Tests/core/Facet/FacetTestCase.cs
index 49d5f0f..6c2e508 100644
--- a/src/Lucene.Net.Tests/core/Facet/FacetTestCase.cs
+++ b/src/Lucene.Net.Tests/core/Facet/FacetTestCase.cs
@@ -135,7 +135,7 @@ namespace Lucene.Net.Facet
         {
             foreach (FacetResult result in results)
             {
-                SortTies(result.labelValues);
+                SortTies(result.LabelValues);
             }
         }
 
@@ -233,11 +233,11 @@ namespace Lucene.Net.Facet
 
             public virtual int Compare(FacetResult a, FacetResult b)
             {
-                if ((double)a.value > (double)b.value)
+                if ((double)a.Value > (double)b.Value)
                 {
                     return -1;
                 }
-                else if ((double)b.value > (double)a.value)
+                else if ((double)b.Value > (double)a.Value)
                 {
                     return 1;
                 }
@@ -256,17 +256,17 @@ namespace Lucene.Net.Facet
             IDictionary<string, FacetResult> aByDim = new Dictionary<string, FacetResult>();
             for (int i = 0; i < a.Count; i++)
             {
-                Assert.True((float)a[i].value <= lastValue);
-                lastValue = (float)a[i].value;
-                aByDim[a[i].dim] = a[i];
+                Assert.True((float)a[i].Value <= lastValue);
+                lastValue = (float)a[i].Value;
+                aByDim[a[i].Dim] = a[i];
             }
             lastValue = float.PositiveInfinity;
             IDictionary<string, FacetResult> bByDim = new Dictionary<string, FacetResult>();
             for (int i = 0; i < b.Count; i++)
             {
-                bByDim[b[i].dim] = b[i];
-                Assert.True((float)b[i].value <= lastValue);
-                lastValue = (float)b[i].value;
+                bByDim[b[i].Dim] = b[i];
+                Assert.True((float)b[i].Value <= lastValue);
+                lastValue = (float)b[i].Value;
             }
             foreach (string dim in aByDim.Keys)
             {
@@ -277,15 +277,15 @@ namespace Lucene.Net.Facet
         [Test]
         protected internal virtual void AssertFloatValuesEquals(FacetResult a, FacetResult b)
         {
-            Assert.AreEqual(a.dim, b.dim);
-            Assert.True(Arrays.Equals(a.path, b.path));
-            Assert.AreEqual(a.childCount, b.childCount);
-            Assert.AreEqual((float)a.value, (float)b.value, (float)a.value / 1e5);
-            Assert.AreEqual(a.labelValues.Length, b.labelValues.Length);
-            for (int i = 0; i < a.labelValues.Length; i++)
+            Assert.AreEqual(a.Dim, b.Dim);
+            Assert.True(Arrays.Equals(a.Path, b.Path));
+            Assert.AreEqual(a.ChildCount, b.ChildCount);
+            Assert.AreEqual((float)a.Value, (float)b.Value, (float)a.Value / 1e5);
+            Assert.AreEqual(a.LabelValues.Length, b.LabelValues.Length);
+            for (int i = 0; i < a.LabelValues.Length; i++)
             {
-                Assert.AreEqual(a.labelValues[i].label, b.labelValues[i].label);
-                Assert.AreEqual((float)a.labelValues[i].value, (float)b.labelValues[i].value, (float)a.labelValues[i].value / 1e5);
+                Assert.AreEqual(a.LabelValues[i].label, b.LabelValues[i].label);
+                Assert.AreEqual((float)a.LabelValues[i].value, (float)b.LabelValues[i].value, (float)a.LabelValues[i].value / 1e5);
             }
         }
     }


Mime
View raw message