lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [01/50] [abbrv] lucenenet git commit: Lucene.Net.Facet.FacetsConfig.DimConfig refactor: Hierarchical > IsHierarchical, MultiValued >IsMultiValued
Date Wed, 15 Mar 2017 23:49:43 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/api-work 00c134df0 -> 467a488ce


Lucene.Net.Facet.FacetsConfig.DimConfig refactor: Hierarchical > IsHierarchical, MultiValued
>IsMultiValued


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

Branch: refs/heads/api-work
Commit: 6c71672a5cd4df26eb8271334f64ff11f0fd0653
Parents: 3c9ac97
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Mon Mar 13 23:27:39 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Tue Mar 14 07:49:30 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Facet/FacetsConfig.cs            | 24 ++++++++++----------
 .../Taxonomy/FloatTaxonomyFacets.cs             |  8 +++----
 .../Taxonomy/IntTaxonomyFacets.cs               |  8 +++----
 src/Lucene.Net.Tests.Facet/TestFacetsConfig.cs  |  4 ++--
 4 files changed, 22 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6c71672a/src/Lucene.Net.Facet/FacetsConfig.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/FacetsConfig.cs b/src/Lucene.Net.Facet/FacetsConfig.cs
index ae6775d..f855a84 100644
--- a/src/Lucene.Net.Facet/FacetsConfig.cs
+++ b/src/Lucene.Net.Facet/FacetsConfig.cs
@@ -81,11 +81,11 @@ namespace Lucene.Net.Facet
         {
             /// <summary>
             /// True if this dimension is hierarchical. </summary>
-            public bool Hierarchical { get; set; }
+            public bool IsHierarchical { get; set; }
 
             /// <summary>
             /// True if this dimension is multi-valued. </summary>
-            public bool MultiValued { get; set; }
+            public bool IsMultiValued { get; set; }
 
             /// <summary>
             /// True if the count/aggregate for the entire dimension
@@ -162,12 +162,12 @@ namespace Lucene.Net.Facet
             {
                 if (!fieldTypes.ContainsKey(dimName))
                 {
-                    var ft = new DimConfig { Hierarchical = v };
+                    var ft = new DimConfig { IsHierarchical = v };
                     fieldTypes[dimName] = ft;
                 }
                 else
                 {
-                    fieldTypes[dimName].Hierarchical = v;
+                    fieldTypes[dimName].IsHierarchical = v;
                 }
             }
         }
@@ -182,12 +182,12 @@ namespace Lucene.Net.Facet
             {
                 if (!fieldTypes.ContainsKey(dimName))
                 {
-                    var ft = new DimConfig { MultiValued = v };
+                    var ft = new DimConfig { IsMultiValued = v };
                     fieldTypes[dimName] = ft;
                 }
                 else
                 {
-                    fieldTypes[dimName].MultiValued = v;
+                    fieldTypes[dimName].IsMultiValued = v;
                 }
             }
         }
@@ -296,7 +296,7 @@ namespace Lucene.Net.Facet
                 {
                     FacetField facetField = (FacetField)field;
                     FacetsConfig.DimConfig dimConfig = GetDimConfig(facetField.Dim);
-                    if (dimConfig.MultiValued == false)
+                    if (dimConfig.IsMultiValued == false)
                     {
                         CheckSeen(seenDims, facetField.Dim);
                     }
@@ -314,7 +314,7 @@ namespace Lucene.Net.Facet
                 {
                     var facetField = (SortedSetDocValuesFacetField)field;
                     FacetsConfig.DimConfig dimConfig = GetDimConfig(facetField.Dim);
-                    if (dimConfig.MultiValued == false)
+                    if (dimConfig.IsMultiValued == false)
                     {
                         CheckSeen(seenDims, facetField.Dim);
                     }
@@ -332,11 +332,11 @@ namespace Lucene.Net.Facet
                 {
                     AssociationFacetField facetField = (AssociationFacetField)field;
                     FacetsConfig.DimConfig dimConfig = GetDimConfig(facetField.Dim);
-                    if (dimConfig.MultiValued == false)
+                    if (dimConfig.IsMultiValued == false)
                     {
                         CheckSeen(seenDims, facetField.Dim);
                     }
-                    if (dimConfig.Hierarchical)
+                    if (dimConfig.IsHierarchical)
                     {
                         throw new System.ArgumentException("AssociationFacetField cannot
be hierarchical (dim=\"" + facetField.Dim + "\")");
                     }
@@ -416,7 +416,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.IsHierarchical == false)
                     {
                         throw new System.ArgumentException("dimension \"" + facetField.Dim
+ "\" is not hierarchical yet has " + facetField.Path.Length + " components");
                     }
@@ -433,7 +433,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.IsMultiValued && (ft.IsHierarchical || ft.RequireDimCount))
                     {
                         //System.out.println("  add parents");
                         // Add all parents too:

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6c71672a/src/Lucene.Net.Facet/Taxonomy/FloatTaxonomyFacets.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Taxonomy/FloatTaxonomyFacets.cs b/src/Lucene.Net.Facet/Taxonomy/FloatTaxonomyFacets.cs
index 3549c6f..f15559f 100644
--- a/src/Lucene.Net.Facet/Taxonomy/FloatTaxonomyFacets.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/FloatTaxonomyFacets.cs
@@ -54,7 +54,7 @@ namespace Lucene.Net.Facet.Taxonomy
             {
                 string dim = ent.Key;
                 FacetsConfig.DimConfig ft = ent.Value;
-                if (ft.Hierarchical && ft.MultiValued == false)
+                if (ft.IsHierarchical && ft.IsMultiValued == false)
                 {
                     int dimRootOrd = m_taxoReader.GetOrdinal(new FacetLabel(dim));
                     Debug.Assert(dimRootOrd > 0);
@@ -81,11 +81,11 @@ namespace Lucene.Net.Facet.Taxonomy
             FacetsConfig.DimConfig dimConfig = VerifyDim(dim);
             if (path.Length == 0)
             {
-                if (dimConfig.Hierarchical && dimConfig.MultiValued == false)
+                if (dimConfig.IsHierarchical && dimConfig.IsMultiValued == false)
                 {
                     // ok: rolled up at search time
                 }
-                else if (dimConfig.RequireDimCount && dimConfig.MultiValued)
+                else if (dimConfig.RequireDimCount && dimConfig.IsMultiValued)
                 {
                     // ok: we indexed all ords at index time
                 }
@@ -154,7 +154,7 @@ namespace Lucene.Net.Facet.Taxonomy
                 return null;
             }
 
-            if (dimConfig.MultiValued)
+            if (dimConfig.IsMultiValued)
             {
                 if (dimConfig.RequireDimCount)
                 {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6c71672a/src/Lucene.Net.Facet/Taxonomy/IntTaxonomyFacets.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Taxonomy/IntTaxonomyFacets.cs b/src/Lucene.Net.Facet/Taxonomy/IntTaxonomyFacets.cs
index f1ac66f..47899dc 100644
--- a/src/Lucene.Net.Facet/Taxonomy/IntTaxonomyFacets.cs
+++ b/src/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.IsHierarchical && ft.IsMultiValued == false)
                 {
                     int dimRootOrd = m_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.IsHierarchical && dimConfig.IsMultiValued == false)
                 {
                     // ok: rolled up at search time
                 }
-                else if (dimConfig.RequireDimCount && dimConfig.MultiValued)
+                else if (dimConfig.RequireDimCount && dimConfig.IsMultiValued)
                 {
                     // ok: we indexed all ords at index time
                 }
@@ -158,7 +158,7 @@ namespace Lucene.Net.Facet.Taxonomy
                 return null;
             }
 
-            if (dimConfig.MultiValued)
+            if (dimConfig.IsMultiValued)
             {
                 if (dimConfig.RequireDimCount)
                 {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6c71672a/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 73a4123..a0772dc 100644
--- a/src/Lucene.Net.Tests.Facet/TestFacetsConfig.cs
+++ b/src/Lucene.Net.Tests.Facet/TestFacetsConfig.cs
@@ -104,7 +104,7 @@ namespace Lucene.Net.Facet
         {
             FacetsConfig config = new FacetsConfigAnonymousInnerClassHelper(this);
 
-            Assert.True(config.GetDimConfig("foobar").Hierarchical);
+            Assert.True(config.GetDimConfig("foobar").IsHierarchical);
         }
 
         private class FacetsConfigAnonymousInnerClassHelper : FacetsConfig
@@ -121,7 +121,7 @@ namespace Lucene.Net.Facet
                 get
                 {
                     DimConfig config = new DimConfig();
-                    config.Hierarchical = true;
+                    config.IsHierarchical = true;
                     return config;
                 }
             }


Mime
View raw message