lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [51/53] [abbrv] lucenenet git commit: Lucene.Net.Core.Index.Fields refactor: Renamed Terms() > GetTerms()
Date Wed, 08 Feb 2017 14:32:30 GMT
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/52da783d/src/Lucene.Net.Tests/core/Index/TestStressIndexing2.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestStressIndexing2.cs b/src/Lucene.Net.Tests/core/Index/TestStressIndexing2.cs
index 0135b61..f073cb4 100644
--- a/src/Lucene.Net.Tests/core/Index/TestStressIndexing2.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestStressIndexing2.cs
@@ -366,10 +366,10 @@ namespace Lucene.Net.Index
                 Assert.IsNull(MultiFields.GetFields(r2));
                 return;
             }
-            Terms terms1 = f1.Terms(idField);
+            Terms terms1 = f1.GetTerms(idField);
             if (terms1 == null)
             {
-                Assert.IsTrue(MultiFields.GetFields(r2) == null || MultiFields.GetFields(r2).Terms(idField)
== null);
+                Assert.IsTrue(MultiFields.GetFields(r2) == null || MultiFields.GetFields(r2).GetTerms(idField)
== null);
                 return;
             }
             TermsEnum termsEnum = terms1.GetIterator(null);
@@ -394,7 +394,7 @@ namespace Lucene.Net.Index
                 }
                 return;
             }
-            Terms terms2 = fields.Terms(idField);
+            Terms terms2 = fields.GetTerms(idField);
             TermsEnum termsEnum2 = terms2.GetIterator(null);
 
             DocsEnum termDocs1 = null;
@@ -465,7 +465,7 @@ namespace Lucene.Net.Index
                         foreach (string field in tv1)
                         {
                             Console.WriteLine("    " + field + ":");
-                            Terms terms3 = tv1.Terms(field);
+                            Terms terms3 = tv1.GetTerms(field);
                             Assert.IsNotNull(terms3);
                             TermsEnum termsEnum3 = terms3.GetIterator(null);
                             BytesRef term2;
@@ -504,7 +504,7 @@ namespace Lucene.Net.Index
                         foreach (string field in tv2)
                         {
                             Console.WriteLine("    " + field + ":");
-                            Terms terms3 = tv2.Terms(field);
+                            Terms terms3 = tv2.GetTerms(field);
                             Assert.IsNotNull(terms3);
                             TermsEnum termsEnum3 = terms3.GetIterator(null);
                             BytesRef term2;
@@ -572,7 +572,7 @@ namespace Lucene.Net.Index
                             break;
                         }
                         field1 = fields1Enum.Current;
-                        Terms terms = fields1.Terms(field1);
+                        Terms terms = fields1.GetTerms(field1);
                         if (terms == null)
                         {
                             continue;
@@ -614,7 +614,7 @@ namespace Lucene.Net.Index
                             break;
                         }
                         field2 = fields2Enum.Current;
-                        Terms terms = fields2.Terms(field2);
+                        Terms terms = fields2.GetTerms(field2);
                         if (terms == null)
                         {
                             continue;
@@ -715,11 +715,11 @@ namespace Lucene.Net.Index
                 string field2 = fieldsEnum2.Current;
                 Assert.AreEqual(field1, field2);
 
-                Terms terms1 = d1.Terms(field1);
+                Terms terms1 = d1.GetTerms(field1);
                 Assert.IsNotNull(terms1);
                 TermsEnum termsEnum1 = terms1.GetIterator(null);
 
-                Terms terms2 = d2.Terms(field2);
+                Terms terms2 = d2.GetTerms(field2);
                 Assert.IsNotNull(terms2);
                 TermsEnum termsEnum2 = terms2.GetIterator(null);
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/52da783d/src/Lucene.Net.Tests/core/Index/TestSumDocFreq.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestSumDocFreq.cs b/src/Lucene.Net.Tests/core/Index/TestSumDocFreq.cs
index c18ef01..66f88c2 100644
--- a/src/Lucene.Net.Tests/core/Index/TestSumDocFreq.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestSumDocFreq.cs
@@ -88,7 +88,7 @@ namespace Lucene.Net.Index
 
             foreach (string f in fields)
             {
-                Terms terms = fields.Terms(f);
+                Terms terms = fields.GetTerms(f);
                 long sumDocFreq = terms.SumDocFreq;
                 if (sumDocFreq == -1)
                 {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/52da783d/src/Lucene.Net.Tests/core/Index/TestTermVectorsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestTermVectorsReader.cs b/src/Lucene.Net.Tests/core/Index/TestTermVectorsReader.cs
index 694005c..8426151 100644
--- a/src/Lucene.Net.Tests/core/Index/TestTermVectorsReader.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestTermVectorsReader.cs
@@ -247,7 +247,7 @@ namespace Lucene.Net.Index
             TermVectorsReader reader = Codec.Default.TermVectorsFormat.VectorsReader(Dir,
Seg.Info, FieldInfos, NewIOContext(Random()));
             for (int j = 0; j < 5; j++)
             {
-                Terms vector = reader.Get(j).Terms(TestFields[0]);
+                Terms vector = reader.Get(j).GetTerms(TestFields[0]);
                 Assert.IsNotNull(vector);
                 Assert.AreEqual(TestTerms.Length, vector.Count);
                 TermsEnum termsEnum = vector.GetIterator(null);
@@ -270,7 +270,7 @@ namespace Lucene.Net.Index
             TermVectorsReader reader = Codec.Default.TermVectorsFormat.VectorsReader(Dir,
Seg.Info, FieldInfos, NewIOContext(Random()));
             for (int j = 0; j < 5; j++)
             {
-                Terms vector = reader.Get(j).Terms(TestFields[0]);
+                Terms vector = reader.Get(j).GetTerms(TestFields[0]);
                 Assert.IsNotNull(vector);
                 Assert.AreEqual(TestTerms.Length, vector.Count);
                 TermsEnum termsEnum = vector.GetIterator(null);
@@ -300,7 +300,7 @@ namespace Lucene.Net.Index
         {
             TermVectorsReader reader = Codec.Default.TermVectorsFormat.VectorsReader(Dir,
Seg.Info, FieldInfos, NewIOContext(Random()));
             //BytesRef[] terms; // LUCENENET NOTE: Not used in Lucene
-            Terms vector = reader.Get(0).Terms(TestFields[0]);
+            Terms vector = reader.Get(0).GetTerms(TestFields[0]);
             Assert.IsNotNull(vector);
             Assert.AreEqual(TestTerms.Length, vector.Count);
             TermsEnum termsEnum = vector.GetIterator(null);
@@ -340,7 +340,7 @@ namespace Lucene.Net.Index
                 Assert.AreEqual(DocIdSetIterator.NO_MORE_DOCS, dpEnum.NextDoc());
             }
 
-            Terms freqVector = reader.Get(0).Terms(TestFields[1]); //no pos, no offset
+            Terms freqVector = reader.Get(0).GetTerms(TestFields[1]); //no pos, no offset
             Assert.IsNotNull(freqVector);
             Assert.AreEqual(TestTerms.Length, freqVector.Count);
             termsEnum = freqVector.GetIterator(null);
@@ -362,7 +362,7 @@ namespace Lucene.Net.Index
         public virtual void TestOffsetReader()
         {
             TermVectorsReader reader = Codec.Default.TermVectorsFormat.VectorsReader(Dir,
Seg.Info, FieldInfos, NewIOContext(Random()));
-            Terms vector = reader.Get(0).Terms(TestFields[0]);
+            Terms vector = reader.Get(0).GetTerms(TestFields[0]);
             Assert.IsNotNull(vector);
             TermsEnum termsEnum = vector.GetIterator(null);
             Assert.IsNotNull(termsEnum);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/52da783d/src/Lucene.Net.Tests/core/Index/TestTermVectorsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestTermVectorsWriter.cs b/src/Lucene.Net.Tests/core/Index/TestTermVectorsWriter.cs
index 9cd1989..355249e 100644
--- a/src/Lucene.Net.Tests/core/Index/TestTermVectorsWriter.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestTermVectorsWriter.cs
@@ -67,7 +67,7 @@ namespace Lucene.Net.Index
             w.Dispose();
 
             IndexReader r = DirectoryReader.Open(dir);
-            Terms vector = r.GetTermVectors(0).Terms("field");
+            Terms vector = r.GetTermVectors(0).GetTerms("field");
             Assert.IsNotNull(vector);
             TermsEnum termsEnum = vector.GetIterator(null);
             Assert.IsNotNull(termsEnum.Next());
@@ -125,7 +125,7 @@ namespace Lucene.Net.Index
             w.Dispose();
 
             IndexReader r = DirectoryReader.Open(dir);
-            TermsEnum termsEnum = r.GetTermVectors(0).Terms("field").GetIterator(null);
+            TermsEnum termsEnum = r.GetTermVectors(0).GetTerms("field").GetIterator(null);
             Assert.IsNotNull(termsEnum.Next());
             DocsAndPositionsEnum dpEnum = termsEnum.DocsAndPositions(null, null);
             Assert.AreEqual(2, termsEnum.TotalTermFreq);
@@ -162,7 +162,7 @@ namespace Lucene.Net.Index
             w.Dispose();
 
             IndexReader r = DirectoryReader.Open(dir);
-            TermsEnum termsEnum = r.GetTermVectors(0).Terms("field").GetIterator(null);
+            TermsEnum termsEnum = r.GetTermVectors(0).GetTerms("field").GetIterator(null);
             Assert.IsNotNull(termsEnum.Next());
             DocsAndPositionsEnum dpEnum = termsEnum.DocsAndPositions(null, null);
             Assert.AreEqual(2, termsEnum.TotalTermFreq);
@@ -215,7 +215,7 @@ namespace Lucene.Net.Index
             w.Dispose();
 
             IndexReader r = DirectoryReader.Open(dir);
-            TermsEnum termsEnum = r.GetTermVectors(0).Terms("field").GetIterator(null);
+            TermsEnum termsEnum = r.GetTermVectors(0).GetTerms("field").GetIterator(null);
             Assert.IsNotNull(termsEnum.Next());
             DocsAndPositionsEnum dpEnum = termsEnum.DocsAndPositions(null, null);
             Assert.AreEqual(2, termsEnum.TotalTermFreq);
@@ -252,7 +252,7 @@ namespace Lucene.Net.Index
             w.Dispose();
 
             IndexReader r = DirectoryReader.Open(dir);
-            TermsEnum termsEnum = r.GetTermVectors(0).Terms("field").GetIterator(null);
+            TermsEnum termsEnum = r.GetTermVectors(0).GetTerms("field").GetIterator(null);
             Assert.IsNotNull(termsEnum.Next());
             DocsAndPositionsEnum dpEnum = termsEnum.DocsAndPositions(null, null);
             Assert.AreEqual(2, termsEnum.TotalTermFreq);
@@ -290,7 +290,7 @@ namespace Lucene.Net.Index
             w.Dispose();
 
             IndexReader r = DirectoryReader.Open(dir);
-            TermsEnum termsEnum = r.GetTermVectors(0).Terms("field").GetIterator(null);
+            TermsEnum termsEnum = r.GetTermVectors(0).GetTerms("field").GetIterator(null);
             Assert.IsNotNull(termsEnum.Next());
             DocsAndPositionsEnum dpEnum = termsEnum.DocsAndPositions(null, null);
 
@@ -336,7 +336,7 @@ namespace Lucene.Net.Index
             w.Dispose();
 
             IndexReader r = DirectoryReader.Open(dir);
-            TermsEnum termsEnum = r.GetTermVectors(0).Terms("field").GetIterator(null);
+            TermsEnum termsEnum = r.GetTermVectors(0).GetTerms("field").GetIterator(null);
             Assert.IsNotNull(termsEnum.Next());
             DocsAndPositionsEnum dpEnum = termsEnum.DocsAndPositions(null, null);
 
@@ -380,7 +380,7 @@ namespace Lucene.Net.Index
             w.Dispose();
 
             IndexReader r = DirectoryReader.Open(dir);
-            TermsEnum termsEnum = r.GetTermVectors(0).Terms("field").GetIterator(null);
+            TermsEnum termsEnum = r.GetTermVectors(0).GetTerms("field").GetIterator(null);
             Assert.IsNotNull(termsEnum.Next());
             DocsAndPositionsEnum dpEnum = termsEnum.DocsAndPositions(null, null);
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/52da783d/src/Lucene.Net.Tests/core/Index/TestTermsEnum.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestTermsEnum.cs b/src/Lucene.Net.Tests/core/Index/TestTermsEnum.cs
index 54f2747..ed848b3 100644
--- a/src/Lucene.Net.Tests/core/Index/TestTermsEnum.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestTermsEnum.cs
@@ -899,7 +899,7 @@ namespace Lucene.Net.Index
             DirectoryReader r = w.Reader;
             w.Dispose();
             AtomicReader sub = GetOnlySegmentReader(r);
-            Terms terms = sub.Fields.Terms("field");
+            Terms terms = sub.Fields.GetTerms("field");
             Automaton automaton = (new RegExp(".*", RegExp.NONE)).ToAutomaton();
             CompiledAutomaton ca = new CompiledAutomaton(automaton, false, false);
             TermsEnum te = terms.Intersect(ca, null);
@@ -957,7 +957,7 @@ namespace Lucene.Net.Index
             DirectoryReader r = w.Reader;
             w.Dispose();
             AtomicReader sub = GetOnlySegmentReader(r);
-            Terms terms = sub.Fields.Terms("field");
+            Terms terms = sub.Fields.GetTerms("field");
 
             Automaton automaton = (new RegExp(".*d", RegExp.NONE)).ToAutomaton();
             CompiledAutomaton ca = new CompiledAutomaton(automaton, false, false);
@@ -1013,7 +1013,7 @@ namespace Lucene.Net.Index
             DirectoryReader r = w.Reader;
             w.Dispose();
             AtomicReader sub = GetOnlySegmentReader(r);
-            Terms terms = sub.Fields.Terms("field");
+            Terms terms = sub.Fields.GetTerms("field");
 
             Automaton automaton = (new RegExp(".*", RegExp.NONE)).ToAutomaton(); // accept
ALL
             CompiledAutomaton ca = new CompiledAutomaton(automaton, false, false);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/52da783d/src/Lucene.Net.Tests/core/Search/TestMultiPhraseQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestMultiPhraseQuery.cs b/src/Lucene.Net.Tests/core/Search/TestMultiPhraseQuery.cs
index a27562a..0995c13 100644
--- a/src/Lucene.Net.Tests/core/Search/TestMultiPhraseQuery.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestMultiPhraseQuery.cs
@@ -78,7 +78,7 @@ namespace Lucene.Net.Search
 
             // this TermEnum gives "piccadilly", "pie" and "pizza".
             string prefix = "pi";
-            TermsEnum te = MultiFields.GetFields(reader).Terms("body").GetIterator(null);
+            TermsEnum te = MultiFields.GetFields(reader).GetTerms("body").GetIterator(null);
             te.SeekCeil(new BytesRef(prefix));
             do
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/52da783d/src/Lucene.Net.Tests/core/Search/TestMultiThreadTermVectors.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestMultiThreadTermVectors.cs b/src/Lucene.Net.Tests/core/Search/TestMultiThreadTermVectors.cs
index 501a84c..89607cf 100644
--- a/src/Lucene.Net.Tests/core/Search/TestMultiThreadTermVectors.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestMultiThreadTermVectors.cs
@@ -211,7 +211,7 @@ namespace Lucene.Net.Search
                 VerifyVectors(vectors, docId);
 
                 start = Environment.TickCount;
-                Terms vector = Reader.GetTermVectors(docId).Terms("field");
+                Terms vector = Reader.GetTermVectors(docId).GetTerms("field");
                 TimeElapsed += Environment.TickCount - start;
 
                 VerifyVector(vector.GetIterator(null), docId);
@@ -222,7 +222,7 @@ namespace Lucene.Net.Search
         {
             foreach (string field in vectors)
             {
-                Terms terms = vectors.Terms(field);
+                Terms terms = vectors.GetTerms(field);
                 Debug.Assert(terms != null);
                 VerifyVector(terms.GetIterator(null), num);
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/52da783d/src/Lucene.Net.Tests/core/Search/TestPhrasePrefixQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestPhrasePrefixQuery.cs b/src/Lucene.Net.Tests/core/Search/TestPhrasePrefixQuery.cs
index 9a0864e..d143f18 100644
--- a/src/Lucene.Net.Tests/core/Search/TestPhrasePrefixQuery.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestPhrasePrefixQuery.cs
@@ -77,7 +77,7 @@ namespace Lucene.Net.Search
 
             // this TermEnum gives "piccadilly", "pie" and "pizza".
             string prefix = "pi";
-            TermsEnum te = MultiFields.GetFields(reader).Terms("body").GetIterator(null);
+            TermsEnum te = MultiFields.GetFields(reader).GetTerms("body").GetIterator(null);
             te.SeekCeil(new BytesRef(prefix));
             do
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/52da783d/src/Lucene.Net.Tests/core/Search/TestSameScoresWithThreads.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestSameScoresWithThreads.cs b/src/Lucene.Net.Tests/core/Search/TestSameScoresWithThreads.cs
index f3dcf52..361e17e 100644
--- a/src/Lucene.Net.Tests/core/Search/TestSameScoresWithThreads.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestSameScoresWithThreads.cs
@@ -65,7 +65,7 @@ namespace Lucene.Net.Search
             w.Dispose();
 
             IndexSearcher s = NewSearcher(r);
-            Terms terms = MultiFields.GetFields(r).Terms("body");
+            Terms terms = MultiFields.GetFields(r).GetTerms("body");
             int termCount = 0;
             TermsEnum termsEnum = terms.GetIterator(null);
             while (termsEnum.Next() != null)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/52da783d/src/Lucene.Net.Tests/core/Search/TestTermVectors.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestTermVectors.cs b/src/Lucene.Net.Tests/core/Search/TestTermVectors.cs
index 0170ab4..ff49de1 100644
--- a/src/Lucene.Net.Tests/core/Search/TestTermVectors.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestTermVectors.cs
@@ -144,7 +144,7 @@ namespace Lucene.Net.Search
             Fields vectors = searcher.IndexReader.GetTermVectors(hits[0].Doc);
             Assert.IsNotNull(vectors);
             Assert.AreEqual(1, vectors.Count);
-            Terms vector = vectors.Terms("field");
+            Terms vector = vectors.GetTerms("field");
             Assert.IsNotNull(vector);
             Assert.AreEqual(1, vector.Count);
             TermsEnum termsEnum = vector.GetIterator(null);
@@ -202,7 +202,7 @@ namespace Lucene.Net.Search
             int numDocs = r.NumDocs;
             for (int i = 0; i < numDocs; i++)
             {
-                Assert.IsNotNull(r.GetTermVectors(i).Terms("c"), "term vectors should not
have been null for document " + i);
+                Assert.IsNotNull(r.GetTermVectors(i).GetTerms("c"), "term vectors should
not have been null for document " + i);
             }
             r.Dispose();
         }


Mime
View raw message