lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [17/46] lucenenet git commit: .NETify Facet: Field names should be camelCase. Fields should not be public (changed to properties with PascalCase names).
Date Tue, 04 Oct 2016 20:01:47 GMT
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e0a73b45/src/Lucene.Net.Facet/Taxonomy/WriterCache/CollisionMap.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Taxonomy/WriterCache/CollisionMap.cs b/src/Lucene.Net.Facet/Taxonomy/WriterCache/CollisionMap.cs
index 9e8c1ad..277a166 100644
--- a/src/Lucene.Net.Facet/Taxonomy/WriterCache/CollisionMap.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/WriterCache/CollisionMap.cs
@@ -29,9 +29,9 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
     /// </summary>
     public class CollisionMap
     {
-        private int capacity_Renamed;
+        private int capacity;
         private float loadFactor;
-        private int size_Renamed;
+        private int size;
         private int threshold;
 
         internal class Entry
@@ -68,17 +68,17 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
         {
             this.labelRepository = labelRepository;
             this.loadFactor = loadFactor;
-            this.capacity_Renamed = CompactLabelToOrdinal.DetermineCapacity(2, initialCapacity);
+            this.capacity = CompactLabelToOrdinal.DetermineCapacity(2, initialCapacity);
 
-            this.entries = new Entry[this.capacity_Renamed];
-            this.threshold = (int)(this.capacity_Renamed * this.loadFactor);
+            this.entries = new Entry[this.capacity];
+            this.threshold = (int)(this.capacity * this.loadFactor);
         }
 
         /// <summary>
         /// How many mappings. </summary>
         public virtual int Size()
         {
-            return this.size_Renamed;
+            return this.size;
         }
 
         /// <summary>
@@ -86,12 +86,12 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
         /// </summary>
         public virtual int Capacity()
         {
-            return this.capacity_Renamed;
+            return this.capacity;
         }
 
         private void Grow()
         {
-            int newCapacity = this.capacity_Renamed * 2;
+            int newCapacity = this.capacity * 2;
             Entry[] newEntries = new Entry[newCapacity];
             Entry[] src = this.entries;
 
@@ -113,9 +113,9 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
                 }
             }
 
-            this.capacity_Renamed = newCapacity;
+            this.capacity = newCapacity;
             this.entries = newEntries;
-            this.threshold = (int)(this.capacity_Renamed * this.loadFactor);
+            this.threshold = (int)(this.capacity * this.loadFactor);
         }
 
         /// <summary>
@@ -125,7 +125,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
         /// </summary>
         public virtual int Get(FacetLabel label, int hash)
         {
-            int bucketIndex = IndexFor(hash, this.capacity_Renamed);
+            int bucketIndex = IndexFor(hash, this.capacity);
             Entry e = this.entries[bucketIndex];
 
             while (e != null && !(hash == e.hash && CategoryPathUtils.EqualsToSerialized(label,
labelRepository, e.offset)))
@@ -145,7 +145,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
         /// </summary>
         public virtual int AddLabel(FacetLabel label, int hash, int cid)
         {
-            int bucketIndex = IndexFor(hash, this.capacity_Renamed);
+            int bucketIndex = IndexFor(hash, this.capacity);
             for (Entry e = this.entries[bucketIndex]; e != null; e = e.next)
             {
                 if (e.hash == hash && CategoryPathUtils.EqualsToSerialized(label,
labelRepository, e.offset))
@@ -168,7 +168,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
         /// </summary>
         public virtual void AddLabelOffset(int hash, int offset, int cid)
         {
-            int bucketIndex = IndexFor(hash, this.capacity_Renamed);
+            int bucketIndex = IndexFor(hash, this.capacity);
             AddEntry(offset, cid, hash, bucketIndex);
         }
 
@@ -176,7 +176,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
         {
             Entry e = this.entries[bucketIndex];
             this.entries[bucketIndex] = new Entry(offset, cid, hash, e);
-            if (this.size_Renamed++ >= this.threshold)
+            if (this.size++ >= this.threshold)
             {
                 Grow();
             }
@@ -184,7 +184,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
 
         internal virtual IEnumerator<CollisionMap.Entry> entryIterator()
         {
-            return new EntryIterator(this, entries, size_Renamed);
+            return new EntryIterator(this, entries, size);
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e0a73b45/src/Lucene.Net.Facet/TopOrdAndFloatQueue.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/TopOrdAndFloatQueue.cs b/src/Lucene.Net.Facet/TopOrdAndFloatQueue.cs
index 4b4dad7..9c81f31 100644
--- a/src/Lucene.Net.Facet/TopOrdAndFloatQueue.cs
+++ b/src/Lucene.Net.Facet/TopOrdAndFloatQueue.cs
@@ -31,11 +31,11 @@ namespace Lucene.Net.Facet
         {
             /// <summary>
             /// Ordinal of the entry. </summary>
-            public int ord;
+            public int Ord { get; set; }
 
             /// <summary>
             /// Value associated with the ordinal. </summary>
-            public float value;
+            public float Value { get; set; }
 
             /// <summary>
             /// Default constructor. </summary>
@@ -52,17 +52,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/e0a73b45/src/Lucene.Net.Facet/TopOrdAndIntQueue.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/TopOrdAndIntQueue.cs b/src/Lucene.Net.Facet/TopOrdAndIntQueue.cs
index 80246e5..7016e80 100644
--- a/src/Lucene.Net.Facet/TopOrdAndIntQueue.cs
+++ b/src/Lucene.Net.Facet/TopOrdAndIntQueue.cs
@@ -31,11 +31,11 @@ namespace Lucene.Net.Facet
         {
             /// <summary>
             /// Ordinal of the entry. </summary>
-            public int Ord;
+            public int Ord { get; set; }
 
             /// <summary>
             /// Value associated with the ordinal. </summary>
-            public int Value;
+            public int Value { get; set; }
 
             /// <summary>
             /// Default constructor. </summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e0a73b45/src/Lucene.Net.Tests.Facet/FacetTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/FacetTestCase.cs b/src/Lucene.Net.Tests.Facet/FacetTestCase.cs
index ccc5cdf..7c4b3c1 100644
--- a/src/Lucene.Net.Tests.Facet/FacetTestCase.cs
+++ b/src/Lucene.Net.Tests.Facet/FacetTestCase.cs
@@ -146,7 +146,7 @@ namespace Lucene.Net.Facet
             int i = 0;
             while (i <= labelValues.Length)
             {
-                if (i < labelValues.Length && (double)labelValues[i].value ==
lastValue)
+                if (i < labelValues.Length && (double)labelValues[i].Value ==
lastValue)
                 {
                     numInRow++;
                 }
@@ -159,7 +159,7 @@ namespace Lucene.Net.Facet
                     numInRow = 1;
                     if (i < labelValues.Length)
                     {
-                        lastValue = (double)labelValues[i].value;
+                        lastValue = (double)labelValues[i].Value;
                     }
                 }
                 i++;
@@ -177,8 +177,8 @@ namespace Lucene.Net.Facet
 
             public virtual int Compare(LabelAndValue a, LabelAndValue b)
             {
-                Debug.Assert((double)a.value == (double)b.value);
-                return (new BytesRef(a.label)).CompareTo(new BytesRef(b.label));
+                Debug.Assert((double)a.Value == (double)b.Value);
+                return (new BytesRef(a.Label)).CompareTo(new BytesRef(b.Label));
             }
         }
 
@@ -198,17 +198,17 @@ namespace Lucene.Net.Facet
 
             public virtual int Compare(LabelAndValue a, LabelAndValue b)
             {
-                if ((double)a.value > (double)b.value)
+                if ((double)a.Value > (double)b.Value)
                 {
                     return -1;
                 }
-                else if ((double)a.value < (double)b.value)
+                else if ((double)a.Value < (double)b.Value)
                 {
                     return 1;
                 }
                 else
                 {
-                    return (new BytesRef(a.label)).CompareTo(new BytesRef(b.label));
+                    return (new BytesRef(a.Label)).CompareTo(new BytesRef(b.Label));
                 }
             }
         }
@@ -278,8 +278,8 @@ namespace Lucene.Net.Facet
             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);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e0a73b45/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs b/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
index e3a2623..d39cefd 100644
--- a/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
+++ b/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
@@ -433,11 +433,11 @@ namespace Lucene.Net.Facet.Range
                         LongRange prevRange = ranges[Random().Next(rangeID)];
                         if (Random().NextBoolean())
                         {
-                            min = prevRange.min;
+                            min = prevRange.Min;
                         }
                         else
                         {
-                            min = prevRange.max;
+                            min = prevRange.Max;
                         }
                     }
                     else
@@ -451,11 +451,11 @@ namespace Lucene.Net.Facet.Range
                         LongRange prevRange = ranges[Random().Next(rangeID)];
                         if (Random().NextBoolean())
                         {
-                            max = prevRange.min;
+                            max = prevRange.Min;
                         }
                         else
                         {
-                            max = prevRange.max;
+                            max = prevRange.Max;
                         }
                     }
                     else
@@ -546,8 +546,8 @@ namespace Lucene.Net.Facet.Range
                         Console.WriteLine("  range " + rangeID + " expectedCount=" + expectedCounts[rangeID]);
                     }
                     LabelAndValue subNode = result.LabelValues[rangeID];
-                    Assert.AreEqual("r" + rangeID, subNode.label);
-                    Assert.AreEqual(expectedCounts[rangeID], (int)subNode.value);
+                    Assert.AreEqual("r" + rangeID, subNode.Label);
+                    Assert.AreEqual(expectedCounts[rangeID], (int)subNode.Value);
 
                     LongRange range = ranges[rangeID];
 
@@ -557,11 +557,11 @@ namespace Lucene.Net.Facet.Range
                     {
                         if (Random().NextBoolean())
                         {
-                            ddq.Add("field", NumericRangeFilter.NewLongRange("field", range.min,
range.max, range.minInclusive, range.maxInclusive));
+                            ddq.Add("field", NumericRangeFilter.NewLongRange("field", range.Min,
range.Max, range.MinInclusive, range.MaxInclusive));
                         }
                         else
                         {
-                            ddq.Add("field", NumericRangeQuery.NewLongRange("field", range.min,
range.max, range.minInclusive, range.maxInclusive));
+                            ddq.Add("field", NumericRangeQuery.NewLongRange("field", range.Min,
range.Max, range.MinInclusive, range.MaxInclusive));
                         }
                     }
                     else
@@ -751,8 +751,8 @@ namespace Lucene.Net.Facet.Range
                         Console.WriteLine("TEST: verify range " + rangeID + " expectedCount="
+ expectedCounts[rangeID]);
                     }
                     LabelAndValue subNode = result.LabelValues[rangeID];
-                    Assert.AreEqual("r" + rangeID, subNode.label);
-                    Assert.AreEqual(expectedCounts[rangeID], (int)subNode.value);
+                    Assert.AreEqual("r" + rangeID, subNode.Label);
+                    Assert.AreEqual(expectedCounts[rangeID], (int)subNode.Value);
 
                     DoubleRange range = ranges[rangeID];
 
@@ -937,8 +937,8 @@ namespace Lucene.Net.Facet.Range
                         Console.WriteLine("  range " + rangeID + " expectedCount=" + expectedCounts[rangeID]);
                     }
                     LabelAndValue subNode = result.LabelValues[rangeID];
-                    Assert.AreEqual("r" + rangeID, subNode.label);
-                    Assert.AreEqual(expectedCounts[rangeID], (int)subNode.value);
+                    Assert.AreEqual("r" + rangeID, subNode.Label);
+                    Assert.AreEqual(expectedCounts[rangeID], (int)subNode.Value);
 
                     DoubleRange range = ranges[rangeID];
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e0a73b45/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestConcurrentFacetedIndexing.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestConcurrentFacetedIndexing.cs
b/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestConcurrentFacetedIndexing.cs
index f2c0fe7..8c36649 100644
--- a/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestConcurrentFacetedIndexing.cs
+++ b/src/Lucene.Net.Tests.Facet/Taxonomy/Directory/TestConcurrentFacetedIndexing.cs
@@ -203,7 +203,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
                             FacetField ff = NewCategory();
                             doc.Add(ff);
 
-                            FacetLabel label = new FacetLabel(ff.dim, ff.path);
+                            FacetLabel label = new FacetLabel(ff.Dim, ff.Path);
                             // add all prefixes to values
                             int level = label.Length;
                             while (level > 0)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e0a73b45/src/Lucene.Net.Tests.Facet/Taxonomy/TestSearcherTaxonomyManager.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/TestSearcherTaxonomyManager.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/TestSearcherTaxonomyManager.cs
index 0d02696..79f8b80 100644
--- a/src/Lucene.Net.Tests.Facet/Taxonomy/TestSearcherTaxonomyManager.cs
+++ b/src/Lucene.Net.Tests.Facet/Taxonomy/TestSearcherTaxonomyManager.cs
@@ -175,10 +175,10 @@ namespace Lucene.Net.Facet.Taxonomy
                     {
                         //System.out.println("search maxOrd=" + pair.taxonomyReader.getSize());
                         FacetsCollector sfc = new FacetsCollector();
-                        pair.searcher.Search(new MatchAllDocsQuery(), sfc);
-                        Facets facets = GetTaxonomyFacetCounts(pair.taxonomyReader, config,
sfc);
+                        pair.Searcher.Search(new MatchAllDocsQuery(), sfc);
+                        Facets facets = GetTaxonomyFacetCounts(pair.TaxonomyReader, config,
sfc);
                         FacetResult result = facets.GetTopChildren(10, "field");
-                        if (pair.searcher.IndexReader.NumDocs > 0)
+                        if (pair.Searcher.IndexReader.NumDocs > 0)
                         {
                             //System.out.println(pair.taxonomyReader.getSize());
                             Assert.True(result.ChildCount > 0);
@@ -283,10 +283,10 @@ namespace Lucene.Net.Facet.Taxonomy
                     {
                         //System.out.println("search maxOrd=" + pair.taxonomyReader.getSize());
                         FacetsCollector sfc = new FacetsCollector();
-                        pair.searcher.Search(new MatchAllDocsQuery(), sfc);
-                        Facets facets = GetTaxonomyFacetCounts(pair.taxonomyReader, config,
sfc);
+                        pair.Searcher.Search(new MatchAllDocsQuery(), sfc);
+                        Facets facets = GetTaxonomyFacetCounts(pair.TaxonomyReader, config,
sfc);
                         FacetResult result = facets.GetTopChildren(10, "field");
-                        if (pair.searcher.IndexReader.NumDocs > 0)
+                        if (pair.Searcher.IndexReader.NumDocs > 0)
                         {
                             //System.out.println(pair.taxonomyReader.getSize());
                             Assert.True(result.ChildCount > 0);
@@ -365,7 +365,7 @@ namespace Lucene.Net.Facet.Taxonomy
             SearcherAndTaxonomy pair = mgr.Acquire();
             try
             {
-                Assert.AreEqual(1, pair.taxonomyReader.Size);
+                Assert.AreEqual(1, pair.TaxonomyReader.Size);
             }
             finally
             {
@@ -382,7 +382,7 @@ namespace Lucene.Net.Facet.Taxonomy
             pair = mgr.Acquire();
             try
             {
-                Assert.AreEqual(3, pair.taxonomyReader.Size);
+                Assert.AreEqual(3, pair.TaxonomyReader.Size);
             }
             finally
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e0a73b45/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs
index 263a1d2..6bee101 100644
--- a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs
+++ b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs
@@ -362,7 +362,7 @@ namespace Lucene.Net.Facet.Taxonomy
 
             FacetResult result = facets.GetTopChildren(10, "a");
             Assert.AreEqual(1, result.LabelValues.Length);
-            Assert.AreEqual(1, (int)result.LabelValues[0].value);
+            Assert.AreEqual(1, (int)result.LabelValues[0].Value);
 
             IOUtils.Close(writer, taxoWriter, searcher.IndexReader, taxoReader, dir, taxoDir);
         }
@@ -502,8 +502,8 @@ namespace Lucene.Net.Facet.Taxonomy
             var allLabels = new HashSet<string>();
             foreach (LabelAndValue labelValue in result.LabelValues)
             {
-                allLabels.Add(labelValue.label);
-                Assert.AreEqual(1, (int)labelValue.value);
+                allLabels.Add(labelValue.Label);
+                Assert.AreEqual(1, (int)labelValue.Value);
             }
             Assert.AreEqual(numLabels, allLabels.Count);
 
@@ -744,7 +744,7 @@ namespace Lucene.Net.Facet.Taxonomy
             Assert.AreEqual(2, result.LabelValues.Length, "wrong number of children");
             foreach (LabelAndValue labelValue in result.LabelValues)
             {
-                Assert.AreEqual(2, (int)labelValue.value, "wrong weight for child " + labelValue.label);
+                Assert.AreEqual(2, (int)labelValue.Value, "wrong weight for child " + labelValue.Label);
             }
 
             IOUtils.Close(indexReader, taxoReader, indexDir, taxoDir);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e0a73b45/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts2.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts2.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts2.cs
index 6f4cb8b..09d1119 100644
--- a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts2.cs
+++ b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts2.cs
@@ -126,7 +126,7 @@ namespace Lucene.Net.Facet.Taxonomy
             foreach (FacetField ff in docCategories)
             {
                 doc.Add(ff);
-                string cp = ff.dim + "/" + ff.path[0];
+                string cp = ff.Dim + "/" + ff.Path[0];
                 allExpectedCounts[cp] = allExpectedCounts[cp] + 1;
                 if (updateTermExpectedCounts)
                 {
@@ -228,19 +228,19 @@ namespace Lucene.Net.Facet.Taxonomy
             counts[CP_D] = 0;
             foreach (FacetField ff in CATEGORIES_A)
             {
-                counts[ff.dim + "/" + ff.path[0]] = 0;
+                counts[ff.Dim + "/" + ff.Path[0]] = 0;
             }
             foreach (FacetField ff in CATEGORIES_B)
             {
-                counts[ff.dim + "/" + ff.path[0]] = 0;
+                counts[ff.Dim + "/" + ff.Path[0]] = 0;
             }
             foreach (FacetField ff in CATEGORIES_C)
             {
-                counts[ff.dim + "/" + ff.path[0]] = 0;
+                counts[ff.Dim + "/" + ff.Path[0]] = 0;
             }
             foreach (FacetField ff in CATEGORIES_D)
             {
-                counts[ff.dim + "/" + ff.path[0]] = 0;
+                counts[ff.Dim + "/" + ff.Path[0]] = 0;
             }
             return counts;
         }
@@ -296,13 +296,13 @@ namespace Lucene.Net.Facet.Taxonomy
             Assert.AreEqual(-1, (int)result.Value);
             foreach (LabelAndValue labelValue in result.LabelValues)
             {
-                Assert.AreEqual(termExpectedCounts[CP_A + "/" + labelValue.label], labelValue.value);
+                Assert.AreEqual(termExpectedCounts[CP_A + "/" + labelValue.Label], labelValue.Value);
             }
             result = facets.GetTopChildren(NUM_CHILDREN_CP_B, CP_B);
             Assert.AreEqual(termExpectedCounts[CP_B], result.Value);
             foreach (LabelAndValue labelValue in result.LabelValues)
             {
-                Assert.AreEqual(termExpectedCounts[CP_B + "/" + labelValue.label], labelValue.value);
+                Assert.AreEqual(termExpectedCounts[CP_B + "/" + labelValue.Label], labelValue.Value);
             }
 
             IOUtils.Close(indexReader, taxoReader);
@@ -325,9 +325,9 @@ namespace Lucene.Net.Facet.Taxonomy
             int prevValue = int.MaxValue;
             foreach (LabelAndValue labelValue in result.LabelValues)
             {
-                Assert.AreEqual(allExpectedCounts[CP_A + "/" + labelValue.label], labelValue.value);
-                Assert.True((int)labelValue.value <= prevValue, "wrong sort order of sub
results: labelValue.value=" + labelValue.value + " prevValue=" + prevValue);
-                prevValue = (int)labelValue.value;
+                Assert.AreEqual(allExpectedCounts[CP_A + "/" + labelValue.Label], labelValue.Value);
+                Assert.True((int)labelValue.Value <= prevValue, "wrong sort order of sub
results: labelValue.value=" + labelValue.Value + " prevValue=" + prevValue);
+                prevValue = (int)labelValue.Value;
             }
 
             result = facets.GetTopChildren(NUM_CHILDREN_CP_B, CP_B);
@@ -335,9 +335,9 @@ namespace Lucene.Net.Facet.Taxonomy
             prevValue = int.MaxValue;
             foreach (LabelAndValue labelValue in result.LabelValues)
             {
-                Assert.AreEqual(allExpectedCounts[CP_B + "/" + labelValue.label], labelValue.value);
-                Assert.True((int)labelValue.value <= prevValue, "wrong sort order of sub
results: labelValue.value=" + labelValue.value + " prevValue=" + prevValue);
-                prevValue = (int)labelValue.value;
+                Assert.AreEqual(allExpectedCounts[CP_B + "/" + labelValue.Label], labelValue.Value);
+                Assert.True((int)labelValue.Value <= prevValue, "wrong sort order of sub
results: labelValue.value=" + labelValue.Value + " prevValue=" + prevValue);
+                prevValue = (int)labelValue.Value;
             }
 
             IOUtils.Close(indexReader, taxoReader);
@@ -359,13 +359,13 @@ namespace Lucene.Net.Facet.Taxonomy
             Assert.AreEqual(-1, (int)result.Value);
             foreach (LabelAndValue labelValue in result.LabelValues)
             {
-                Assert.AreEqual(allExpectedCounts[CP_A + "/" + labelValue.label], labelValue.value);
+                Assert.AreEqual(allExpectedCounts[CP_A + "/" + labelValue.Label], labelValue.Value);
             }
             result = facets.GetTopChildren(int.MaxValue, CP_B);
             Assert.AreEqual(allExpectedCounts[CP_B], result.Value);
             foreach (LabelAndValue labelValue in result.LabelValues)
             {
-                Assert.AreEqual(allExpectedCounts[CP_B + "/" + labelValue.label], labelValue.value);
+                Assert.AreEqual(allExpectedCounts[CP_B + "/" + labelValue.Label], labelValue.Value);
             }
 
             IOUtils.Close(indexReader, taxoReader);
@@ -387,13 +387,13 @@ namespace Lucene.Net.Facet.Taxonomy
             Assert.AreEqual(allExpectedCounts[CP_C], result.Value);
             foreach (LabelAndValue labelValue in result.LabelValues)
             {
-                Assert.AreEqual(allExpectedCounts[CP_C + "/" + labelValue.label], labelValue.value);
+                Assert.AreEqual(allExpectedCounts[CP_C + "/" + labelValue.Label], labelValue.Value);
             }
             result = facets.GetTopChildren(NUM_CHILDREN_CP_D, CP_D);
             Assert.AreEqual(allExpectedCounts[CP_C], result.Value);
             foreach (LabelAndValue labelValue in result.LabelValues)
             {
-                Assert.AreEqual(allExpectedCounts[CP_D + "/" + labelValue.label], labelValue.value);
+                Assert.AreEqual(allExpectedCounts[CP_D + "/" + labelValue.Label], labelValue.Value);
             }
 
             IOUtils.Close(indexReader, taxoReader);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e0a73b45/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs b/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
index 719e212..e32693d 100644
--- a/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
+++ b/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
@@ -1213,10 +1213,10 @@ namespace Lucene.Net.Facet
                 {
                     foreach (LabelAndValue labelValue in fr.LabelValues)
                     {
-                        actualValues[labelValue.label] = (int)labelValue.value;
+                        actualValues[labelValue.Label] = (int)labelValue.Value;
                         if (VERBOSE)
                         {
-                            Console.WriteLine("        " + idx + ": " + new BytesRef(labelValue.label)
+ ": " + labelValue.value);
+                            Console.WriteLine("        " + idx + ": " + new BytesRef(labelValue.Label)
+ ": " + labelValue.Value);
                             idx++;
                         }
                     }
@@ -1254,12 +1254,12 @@ namespace Lucene.Net.Facet
                     for (int i = 0; i < topNIDs.Length; i++)
                     {
                         int expectedOrd = topNIDs[i];
-                        Assert.AreEqual(expected.Counts[dim][expectedOrd], (int)fr.LabelValues[i].value);
+                        Assert.AreEqual(expected.Counts[dim][expectedOrd], (int)fr.LabelValues[i].Value);
                         if (isSortedSetDV)
                         {
                             // Tie-break facet labels are only in unicode
                             // order with SortedSetDVFacets:
-                            assertEquals("value @ idx=" + i, dimValues[dim][expectedOrd],
fr.LabelValues[i].label);
+                            assertEquals("value @ idx=" + i, dimValues[dim][expectedOrd],
fr.LabelValues[i].Label);
                         }
                     }
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e0a73b45/src/Lucene.Net.Tests.Facet/TestFacetsConfig.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/TestFacetsConfig.cs b/src/Lucene.Net.Tests.Facet/TestFacetsConfig.cs
index 9c14f79..73a4123 100644
--- a/src/Lucene.Net.Tests.Facet/TestFacetsConfig.cs
+++ b/src/Lucene.Net.Tests.Facet/TestFacetsConfig.cs
@@ -90,7 +90,7 @@ namespace Lucene.Net.Facet
             Facets facets = GetTaxonomyFacetCounts(taxoReader, facetsConfig, fc);
             FacetResult res = facets.GetTopChildren(10, "a");
             Assert.AreEqual(1, res.LabelValues.Length);
-            Assert.AreEqual(2, res.LabelValues[0].value);
+            Assert.AreEqual(2, res.LabelValues[0].Value);
             IOUtils.Close(indexReader, taxoReader);
 
             IOUtils.Close(indexDir, taxoDir);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e0a73b45/src/Lucene.Net.Tests.Facet/TestRandomSamplingFacetsCollector.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/TestRandomSamplingFacetsCollector.cs b/src/Lucene.Net.Tests.Facet/TestRandomSamplingFacetsCollector.cs
index 7b5915b..2969436 100644
--- a/src/Lucene.Net.Tests.Facet/TestRandomSamplingFacetsCollector.cs
+++ b/src/Lucene.Net.Tests.Facet/TestRandomSamplingFacetsCollector.cs
@@ -80,7 +80,7 @@ namespace Lucene.Net.Facet
             // There should be no results at all
             foreach (MatchingDocs doc in collectRandomZeroResults.GetMatchingDocs)
             {
-                Assert.AreEqual(0, doc.totalHits);
+                Assert.AreEqual(0, doc.TotalHits);
             }
 
             // Now start searching and retrieve results.
@@ -125,14 +125,14 @@ namespace Lucene.Net.Facet
             int sum = 0;
             foreach (LabelAndValue lav in random10Result.LabelValues)
             {
-                sum += (int)lav.value;
+                sum += (int)lav.Value;
             }
             float mu = (float)sum / (float)maxNumChildren;
 
             float variance = 0;
             foreach (LabelAndValue lav in random10Result.LabelValues)
             {
-                variance += (float)Math.Pow((mu - (int)lav.value), 2);
+                variance += (float)Math.Pow((mu - (int)lav.Value), 2);
             }
             variance = variance / maxNumChildren;
             float sigma = (float)Math.Sqrt(variance);


Mime
View raw message