You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2017/01/28 10:15:48 UTC

[05/22] lucenenet git commit: Lucene.Net.Queries.Function.DocValues.DocTermsIndexDocValues refactor: toTerm() > ToTerm(), NumOrd() > NumOrd (property)

Lucene.Net.Queries.Function.DocValues.DocTermsIndexDocValues refactor: toTerm() > ToTerm(), NumOrd() > NumOrd (property)


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

Branch: refs/heads/api-work
Commit: a1e84947b0ccb2933a32042138b82999f43dd540
Parents: fd254c8
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Sat Jan 28 07:38:45 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Sat Jan 28 07:47:12 2017 +0700

----------------------------------------------------------------------
 .../Function/DocValues/DocTermsIndexDocValues.cs          | 10 +++++-----
 src/Lucene.Net.Queries/Function/FunctionValues.cs         |  4 ++--
 .../Function/ValueSources/BytesRefFieldSource.cs          |  2 +-
 .../Function/ValueSources/OrdFieldSource.cs               |  4 ++--
 .../Function/TestDocValuesFieldSources.cs                 |  2 +-
 5 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a1e84947/src/Lucene.Net.Queries/Function/DocValues/DocTermsIndexDocValues.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/DocValues/DocTermsIndexDocValues.cs b/src/Lucene.Net.Queries/Function/DocValues/DocTermsIndexDocValues.cs
index 4cf5e94..728f62b 100644
--- a/src/Lucene.Net.Queries/Function/DocValues/DocTermsIndexDocValues.cs
+++ b/src/Lucene.Net.Queries/Function/DocValues/DocTermsIndexDocValues.cs
@@ -48,7 +48,7 @@ namespace Lucene.Net.Queries.Function.DocValues
             this.vs = vs;
         }
 
-        protected abstract string toTerm(string readableValue); // LUCENENET TODO: Rename ToTerm(string readableValue)
+        protected abstract string ToTerm(string readableValue);
 
         public override bool Exists(int doc)
         {
@@ -60,9 +60,9 @@ namespace Lucene.Net.Queries.Function.DocValues
             return termsIndex.GetOrd(doc);
         }
 
-        public override int NumOrd() // LUCENENET TODO: Make property
+        public override int NumOrd
         {
-            return termsIndex.ValueCount;
+            get { return termsIndex.ValueCount; }
         }
 
         public override bool BytesVal(int doc, BytesRef target)
@@ -92,8 +92,8 @@ namespace Lucene.Net.Queries.Function.DocValues
         public override ValueSourceScorer GetRangeScorer(IndexReader reader, string lowerVal, string upperVal, bool includeLower, bool includeUpper)
         {
             // TODO: are lowerVal and upperVal in indexed form or not?
-            lowerVal = lowerVal == null ? null : toTerm(lowerVal);
-            upperVal = upperVal == null ? null : toTerm(upperVal);
+            lowerVal = lowerVal == null ? null : ToTerm(lowerVal);
+            upperVal = upperVal == null ? null : ToTerm(upperVal);
 
             int lower = int.MinValue;
             if (lowerVal != null)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a1e84947/src/Lucene.Net.Queries/Function/FunctionValues.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/FunctionValues.cs b/src/Lucene.Net.Queries/Function/FunctionValues.cs
index b282657..a14ce75 100644
--- a/src/Lucene.Net.Queries/Function/FunctionValues.cs
+++ b/src/Lucene.Net.Queries/Function/FunctionValues.cs
@@ -117,9 +117,9 @@ namespace Lucene.Net.Queries.Function
         }
 
         /// <returns> the number of unique sort ordinals this instance has </returns>
-        public virtual int NumOrd() // LUCENENET TODO: Make property ?
+        public virtual int NumOrd
         {
-            throw new System.NotSupportedException();
+            get { throw new System.NotSupportedException(); }
         }
 
         public abstract string ToString(int doc);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a1e84947/src/Lucene.Net.Queries/Function/ValueSources/BytesRefFieldSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/BytesRefFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/BytesRefFieldSource.cs
index d796419..9199cd4 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/BytesRefFieldSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/BytesRefFieldSource.cs
@@ -104,7 +104,7 @@ namespace Lucene.Net.Queries.Function.ValueSources
             }
 
 
-            protected override string toTerm(string readableValue)
+            protected override string ToTerm(string readableValue)
             {
                 return readableValue;
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a1e84947/src/Lucene.Net.Queries/Function/ValueSources/OrdFieldSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/OrdFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/OrdFieldSource.cs
index 4867a00..035c3f3 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/OrdFieldSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/OrdFieldSource.cs
@@ -94,9 +94,9 @@ namespace Lucene.Net.Queries.Function.ValueSources
             {
                 return sindex.GetOrd(doc + off);
             }
-            public override int NumOrd()
+            public override int NumOrd
             {
-                return sindex.ValueCount;
+                get { return sindex.ValueCount; }
             }
 
             public override bool Exists(int doc)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a1e84947/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs b/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs
index 32fd58a..b8afb3f 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestDocValuesFieldSources.cs
@@ -113,7 +113,7 @@ namespace Lucene.Net.Tests.Queries.Function
                     {
                         case DocValuesType.SORTED:
                             values.OrdVal(i); // no exception
-                            assertTrue(values.NumOrd() >= 1);
+                            assertTrue(values.NumOrd >= 1);
                             goto case DocValuesType.BINARY;
                         case DocValuesType.BINARY:
                             assertEquals(expected, values.ObjectVal(i));