lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r882654 - in /incubator/lucene.net/trunk/C#/src: Lucene.Net/QueryParser/ Lucene.Net/Search/ Test/Index/ Test/Search/ Test/Search/Spans/
Date Fri, 20 Nov 2009 17:54:01 GMT
Author: digy
Date: Fri Nov 20 17:53:56 2009
New Revision: 882654

URL: http://svn.apache.org/viewvc?rev=882654&view=rev
Log:
LUCENENET-293 Improper casing on PhraseQuery.Add overload

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/QueryParser.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/PhraseQuery.cs
    incubator/lucene.net/trunk/C#/src/Test/Index/TestAddIndexesNoOptimize.cs
    incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs
    incubator/lucene.net/trunk/C#/src/Test/Index/TestLazyProxSkipping.cs
    incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestBasics.cs
    incubator/lucene.net/trunk/C#/src/Test/Search/TestPhraseQuery.cs
    incubator/lucene.net/trunk/C#/src/Test/Search/TestPositionIncrement.cs
    incubator/lucene.net/trunk/C#/src/Test/Search/TestSimilarity.cs
    incubator/lucene.net/trunk/C#/src/Test/Search/TestSloppyPhraseQuery.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/QueryParser.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/QueryParser/QueryParser.cs?rev=882654&r1=882653&r2=882654&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/QueryParser.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/QueryParser.cs Fri Nov 20 17:53:56
2009
@@ -821,7 +821,7 @@
 						}
 						else
 						{
-							pq.add(new Term(field, term));
+							pq.Add(new Term(field, term));
 						}
 					}
 					return pq;

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/PhraseQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/PhraseQuery.cs?rev=882654&r1=882653&r2=882654&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/PhraseQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/PhraseQuery.cs Fri Nov 20 17:53:56
2009
@@ -70,7 +70,7 @@
 		/// <summary> Adds a term to the end of the query phrase.
 		/// The relative position of the term is the one immediately after the last term added.
 		/// </summary>
-		public virtual void  add(Term term)
+		public virtual void  Add(Term term)
 		{
 			int position = 0;
 			if (positions.Count > 0)

Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestAddIndexesNoOptimize.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestAddIndexesNoOptimize.cs?rev=882654&r1=882653&r2=882654&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestAddIndexesNoOptimize.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestAddIndexesNoOptimize.cs Fri Nov 20 17:53:56
2009
@@ -151,8 +151,8 @@
 			}
 			// Deletes one of the 10 added docs, leaving 9:
 			PhraseQuery q = new PhraseQuery();
-			q.add(new Term("content", "bbb"));
-			q.add(new Term("content", "14"));
+			q.Add(new Term("content", "bbb"));
+			q.Add(new Term("content", "14"));
 			writer.DeleteDocuments(q);
 			
 			writer.Optimize();
@@ -191,8 +191,8 @@
 			
 			// Deletes one of the 10 added docs, leaving 9:
 			PhraseQuery q = new PhraseQuery();
-			q.add(new Term("content", "bbb"));
-			q.add(new Term("content", "14"));
+			q.Add(new Term("content", "bbb"));
+			q.Add(new Term("content", "14"));
 			writer.DeleteDocuments(q);
 			
 			writer.Optimize();
@@ -229,8 +229,8 @@
 			
 			// Deletes one of the 10 added docs, leaving 9:
 			PhraseQuery q = new PhraseQuery();
-			q.add(new Term("content", "bbb"));
-			q.add(new Term("content", "14"));
+			q.Add(new Term("content", "bbb"));
+			q.Add(new Term("content", "14"));
 			writer.DeleteDocuments(q);
 			
 			writer.AddIndexesNoOptimize(new Directory[]{aux});

Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestIndexWriter.cs?rev=882654&r1=882653&r2=882654&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs Fri Nov 20 17:53:56 2009
@@ -4348,9 +4348,9 @@
 			
 			IndexSearcher s = new IndexSearcher(dir);
 			PhraseQuery pq = new PhraseQuery();
-			pq.add(new Term("field", "a"));
-			pq.add(new Term("field", "b"));
-			pq.add(new Term("field", "c"));
+			pq.Add(new Term("field", "a"));
+			pq.Add(new Term("field", "b"));
+			pq.Add(new Term("field", "c"));
 			ScoreDoc[] hits = s.Search(pq, null, 1000).scoreDocs;
 			Assert.AreEqual(1, hits.Length);
 			

Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestLazyProxSkipping.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestLazyProxSkipping.cs?rev=882654&r1=882653&r2=882654&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestLazyProxSkipping.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestLazyProxSkipping.cs Fri Nov 20 17:53:56
2009
@@ -125,8 +125,8 @@
 		{
 			// create PhraseQuery "term1 term2" and search
 			PhraseQuery pq = new PhraseQuery();
-			pq.add(new Term(this.field, this.term1));
-			pq.add(new Term(this.field, this.term2));
+			pq.Add(new Term(this.field, this.term1));
+			pq.Add(new Term(this.field, this.term2));
 			return this.searcher.Search(pq, null, 1000).scoreDocs;
 		}
 		

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestBasics.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/Spans/TestBasics.cs?rev=882654&r1=882653&r2=882654&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestBasics.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestBasics.cs Fri Nov 20 17:53:56
2009
@@ -92,8 +92,8 @@
 		public virtual void  TestPhrase()
 		{
 			PhraseQuery query = new PhraseQuery();
-			query.add(new Term("field", "seventy"));
-			query.add(new Term("field", "seven"));
+			query.Add(new Term("field", "seventy"));
+			query.Add(new Term("field", "seven"));
 			CheckHits(query, new int[]{77, 177, 277, 377, 477, 577, 677, 777, 877, 977});
 		}
 		
@@ -101,8 +101,8 @@
 		public virtual void  TestPhrase2()
 		{
 			PhraseQuery query = new PhraseQuery();
-			query.add(new Term("field", "seventish"));
-			query.add(new Term("field", "sevenon"));
+			query.Add(new Term("field", "seventish"));
+			query.Add(new Term("field", "sevenon"));
 			CheckHits(query, new int[]{});
 		}
 		

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/TestPhraseQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestPhraseQuery.cs?rev=882654&r1=882653&r2=882654&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestPhraseQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestPhraseQuery.cs Fri Nov 20 17:53:56 2009
@@ -119,8 +119,8 @@
 		public virtual void  TestNotCloseEnough()
 		{
 			query.SetSlop(2);
-			query.add(new Term("field", "one"));
-			query.add(new Term("field", "five"));
+			query.Add(new Term("field", "one"));
+			query.Add(new Term("field", "five"));
 			ScoreDoc[] hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(0, hits.Length);
 			QueryUtils.Check(query, searcher);
@@ -130,8 +130,8 @@
 		public virtual void  TestBarelyCloseEnough()
 		{
 			query.SetSlop(3);
-			query.add(new Term("field", "one"));
-			query.add(new Term("field", "five"));
+			query.Add(new Term("field", "one"));
+			query.Add(new Term("field", "five"));
 			ScoreDoc[] hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(1, hits.Length);
 			QueryUtils.Check(query, searcher);
@@ -142,16 +142,16 @@
 		public virtual void  TestExact()
 		{
 			// slop is zero by default
-			query.add(new Term("field", "four"));
-			query.add(new Term("field", "five"));
+			query.Add(new Term("field", "four"));
+			query.Add(new Term("field", "five"));
 			ScoreDoc[] hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(1, hits.Length, "exact match");
 			QueryUtils.Check(query, searcher);
 			
 			
 			query = new PhraseQuery();
-			query.add(new Term("field", "two"));
-			query.add(new Term("field", "one"));
+			query.Add(new Term("field", "two"));
+			query.Add(new Term("field", "one"));
 			hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(0, hits.Length, "reverse not exact");
 			QueryUtils.Check(query, searcher);
@@ -162,8 +162,8 @@
 		{
 			// Ensures slop of 1 works with terms in order.
 			query.SetSlop(1);
-			query.add(new Term("field", "one"));
-			query.add(new Term("field", "two"));
+			query.Add(new Term("field", "one"));
+			query.Add(new Term("field", "two"));
 			ScoreDoc[] hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(1, hits.Length, "in order");
 			QueryUtils.Check(query, searcher);
@@ -173,8 +173,8 @@
 			// must be at least 2.
 			query = new PhraseQuery();
 			query.SetSlop(1);
-			query.add(new Term("field", "two"));
-			query.add(new Term("field", "one"));
+			query.Add(new Term("field", "two"));
+			query.Add(new Term("field", "one"));
 			hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(0, hits.Length, "reversed, slop not 2 or more");
 			QueryUtils.Check(query, searcher);
@@ -185,8 +185,8 @@
 		public virtual void  TestOrderDoesntMatter()
 		{
 			query.SetSlop(2); // must be at least two for reverse order match
-			query.add(new Term("field", "two"));
-			query.add(new Term("field", "one"));
+			query.Add(new Term("field", "two"));
+			query.Add(new Term("field", "one"));
 			ScoreDoc[] hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(1, hits.Length, "just sloppy enough");
 			QueryUtils.Check(query, searcher);
@@ -194,8 +194,8 @@
 			
 			query = new PhraseQuery();
 			query.SetSlop(2);
-			query.add(new Term("field", "three"));
-			query.add(new Term("field", "one"));
+			query.Add(new Term("field", "three"));
+			query.Add(new Term("field", "one"));
 			hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(0, hits.Length, "not sloppy enough");
 			QueryUtils.Check(query, searcher);
@@ -208,9 +208,9 @@
 		public virtual void  TestMulipleTerms()
 		{
 			query.SetSlop(2);
-			query.add(new Term("field", "one"));
-			query.add(new Term("field", "three"));
-			query.add(new Term("field", "five"));
+			query.Add(new Term("field", "one"));
+			query.Add(new Term("field", "three"));
+			query.Add(new Term("field", "five"));
 			ScoreDoc[] hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(1, hits.Length, "two total moves");
 			QueryUtils.Check(query, searcher);
@@ -218,9 +218,9 @@
 			
 			query = new PhraseQuery();
 			query.SetSlop(5); // it takes six moves to match this phrase
-			query.add(new Term("field", "five"));
-			query.add(new Term("field", "three"));
-			query.add(new Term("field", "one"));
+			query.Add(new Term("field", "five"));
+			query.Add(new Term("field", "three"));
+			query.Add(new Term("field", "one"));
 			hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(0, hits.Length, "slop of 5 not close enough");
 			QueryUtils.Check(query, searcher);
@@ -247,8 +247,8 @@
 			
 			// valid exact phrase query
 			PhraseQuery query = new PhraseQuery();
-			query.add(new Term("field", "stop"));
-			query.add(new Term("field", "words"));
+			query.Add(new Term("field", "stop"));
+			query.Add(new Term("field", "words"));
 			ScoreDoc[] hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(1, hits.Length);
 			QueryUtils.Check(query, searcher);
@@ -256,8 +256,8 @@
 			
 			// currently StopAnalyzer does not leave "holes", so this matches.
 			query = new PhraseQuery();
-			query.add(new Term("field", "words"));
-			query.add(new Term("field", "here"));
+			query.Add(new Term("field", "words"));
+			query.Add(new Term("field", "here"));
 			hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(1, hits.Length);
 			QueryUtils.Check(query, searcher);
@@ -287,8 +287,8 @@
 			IndexSearcher searcher = new IndexSearcher(directory);
 			
 			PhraseQuery phraseQuery = new PhraseQuery();
-			phraseQuery.add(new Term("source", "marketing"));
-			phraseQuery.add(new Term("source", "info"));
+			phraseQuery.Add(new Term("source", "marketing"));
+			phraseQuery.Add(new Term("source", "info"));
 			ScoreDoc[] hits = searcher.Search(phraseQuery, null, 1000).scoreDocs;
 			Assert.AreEqual(2, hits.Length);
 			QueryUtils.Check(phraseQuery, searcher);
@@ -325,8 +325,8 @@
 			
 			termQuery = new TermQuery(new Term("contents", "woo"));
 			phraseQuery = new PhraseQuery();
-			phraseQuery.add(new Term("contents", "map"));
-			phraseQuery.add(new Term("contents", "entry"));
+			phraseQuery.Add(new Term("contents", "map"));
+			phraseQuery.Add(new Term("contents", "entry"));
 			
 			hits = searcher.Search(termQuery, null, 1000).scoreDocs;
 			Assert.AreEqual(3, hits.Length);
@@ -375,8 +375,8 @@
 			
 			Searcher searcher = new IndexSearcher(directory);
 			PhraseQuery query = new PhraseQuery();
-			query.add(new Term("field", "firstname"));
-			query.add(new Term("field", "lastname"));
+			query.Add(new Term("field", "firstname"));
+			query.Add(new Term("field", "lastname"));
 			query.SetSlop(System.Int32.MaxValue);
 			ScoreDoc[] hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(3, hits.Length);
@@ -407,10 +407,10 @@
 		[Test]
 		public virtual void  TestWrappedPhrase()
 		{
-			query.add(new Term("repeated", "first"));
-			query.add(new Term("repeated", "part"));
-			query.add(new Term("repeated", "second"));
-			query.add(new Term("repeated", "part"));
+			query.Add(new Term("repeated", "first"));
+			query.Add(new Term("repeated", "part"));
+			query.Add(new Term("repeated", "second"));
+			query.Add(new Term("repeated", "part"));
 			query.SetSlop(100);
 			
 			ScoreDoc[] hits = searcher.Search(query, null, 1000).scoreDocs;
@@ -429,9 +429,9 @@
 		public virtual void  TestNonExistingPhrase()
 		{
 			// phrase without repetitions that exists in 2 docs
-			query.add(new Term("nonexist", "phrase"));
-			query.add(new Term("nonexist", "notexist"));
-			query.add(new Term("nonexist", "found"));
+			query.Add(new Term("nonexist", "phrase"));
+			query.Add(new Term("nonexist", "notexist"));
+			query.Add(new Term("nonexist", "found"));
 			query.SetSlop(2); // would be found this way
 			
 			ScoreDoc[] hits = searcher.Search(query, null, 1000).scoreDocs;
@@ -440,9 +440,9 @@
 			
 			// phrase with repetitions that exists in 2 docs
 			query = new PhraseQuery();
-			query.add(new Term("nonexist", "phrase"));
-			query.add(new Term("nonexist", "exist"));
-			query.add(new Term("nonexist", "exist"));
+			query.Add(new Term("nonexist", "phrase"));
+			query.Add(new Term("nonexist", "exist"));
+			query.Add(new Term("nonexist", "exist"));
 			query.SetSlop(1); // would be found 
 			
 			hits = searcher.Search(query, null, 1000).scoreDocs;
@@ -451,9 +451,9 @@
 			
 			// phrase I with repetitions that does not exist in any doc
 			query = new PhraseQuery();
-			query.add(new Term("nonexist", "phrase"));
-			query.add(new Term("nonexist", "notexist"));
-			query.add(new Term("nonexist", "phrase"));
+			query.Add(new Term("nonexist", "phrase"));
+			query.Add(new Term("nonexist", "notexist"));
+			query.Add(new Term("nonexist", "phrase"));
 			query.SetSlop(1000); // would not be found no matter how high the slop is
 			
 			hits = searcher.Search(query, null, 1000).scoreDocs;
@@ -462,10 +462,10 @@
 			
 			// phrase II with repetitions that does not exist in any doc
 			query = new PhraseQuery();
-			query.add(new Term("nonexist", "phrase"));
-			query.add(new Term("nonexist", "exist"));
-			query.add(new Term("nonexist", "exist"));
-			query.add(new Term("nonexist", "exist"));
+			query.Add(new Term("nonexist", "phrase"));
+			query.Add(new Term("nonexist", "exist"));
+			query.Add(new Term("nonexist", "exist"));
+			query.Add(new Term("nonexist", "exist"));
 			query.SetSlop(1000); // would not be found no matter how high the slop is
 			
 			hits = searcher.Search(query, null, 1000).scoreDocs;
@@ -487,8 +487,8 @@
 			
 			// search on non palyndrome, find phrase with no slop, using exact phrase scorer
 			query.SetSlop(0); // to use exact phrase scorer
-			query.add(new Term("field", "two"));
-			query.add(new Term("field", "three"));
+			query.Add(new Term("field", "two"));
+			query.Add(new Term("field", "three"));
 			ScoreDoc[] hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(1, hits.Length, "phrase found with exact phrase scorer");
 			float score0 = hits[0].score;
@@ -507,8 +507,8 @@
 			// search ordered in palyndrome, find it twice
 			query = new PhraseQuery();
 			query.SetSlop(2); // must be at least two for both ordered and reversed to match
-			query.add(new Term("palindrome", "two"));
-			query.add(new Term("palindrome", "three"));
+			query.Add(new Term("palindrome", "two"));
+			query.Add(new Term("palindrome", "three"));
 			hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(1, hits.Length, "just sloppy enough");
 			float score2 = hits[0].score;
@@ -521,8 +521,8 @@
 			// search reveresed in palyndrome, find it twice
 			query = new PhraseQuery();
 			query.SetSlop(2); // must be at least two for both ordered and reversed to match
-			query.add(new Term("palindrome", "three"));
-			query.add(new Term("palindrome", "two"));
+			query.Add(new Term("palindrome", "three"));
+			query.Add(new Term("palindrome", "two"));
 			hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(1, hits.Length, "just sloppy enough");
 			float score3 = hits[0].score;
@@ -548,9 +548,9 @@
 			
 			// search on non palyndrome, find phrase with no slop, using exact phrase scorer
 			query.SetSlop(0); // to use exact phrase scorer
-			query.add(new Term("field", "one"));
-			query.add(new Term("field", "two"));
-			query.add(new Term("field", "three"));
+			query.Add(new Term("field", "one"));
+			query.Add(new Term("field", "two"));
+			query.Add(new Term("field", "three"));
 			ScoreDoc[] hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(1, hits.Length, "phrase found with exact phrase scorer");
 			float score0 = hits[0].score;
@@ -569,9 +569,9 @@
 			// search ordered in palyndrome, find it twice
 			query = new PhraseQuery();
 			query.SetSlop(4); // must be at least four for both ordered and reversed to match
-			query.add(new Term("palindrome", "one"));
-			query.add(new Term("palindrome", "two"));
-			query.add(new Term("palindrome", "three"));
+			query.Add(new Term("palindrome", "one"));
+			query.Add(new Term("palindrome", "two"));
+			query.Add(new Term("palindrome", "three"));
 			hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(1, hits.Length, "just sloppy enough");
 			float score2 = hits[0].score;
@@ -584,9 +584,9 @@
 			// search reveresed in palyndrome, find it twice
 			query = new PhraseQuery();
 			query.SetSlop(4); // must be at least four for both ordered and reversed to match
-			query.add(new Term("palindrome", "three"));
-			query.add(new Term("palindrome", "two"));
-			query.add(new Term("palindrome", "one"));
+			query.Add(new Term("palindrome", "three"));
+			query.Add(new Term("palindrome", "two"));
+			query.Add(new Term("palindrome", "one"));
 			hits = searcher.Search(query, null, 1000).scoreDocs;
 			Assert.AreEqual(1, hits.Length, "just sloppy enough");
 			float score3 = hits[0].score;

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/TestPositionIncrement.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestPositionIncrement.cs?rev=882654&r1=882653&r2=882654&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestPositionIncrement.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestPositionIncrement.cs Fri Nov 20 17:53:56
2009
@@ -151,8 +151,8 @@
 			ScoreDoc[] hits;
 			
 			q = new PhraseQuery();
-			q.add(new Term("field", "1"));
-			q.add(new Term("field", "2"));
+			q.Add(new Term("field", "1"));
+			q.Add(new Term("field", "2"));
 			hits = searcher.Search(q, null, 1000).scoreDocs;
 			Assert.AreEqual(0, hits.Length);
 			
@@ -171,14 +171,14 @@
 			Assert.AreEqual(1, hits.Length);
 			
 			q = new PhraseQuery();
-			q.add(new Term("field", "2"));
-			q.add(new Term("field", "3"));
+			q.Add(new Term("field", "2"));
+			q.Add(new Term("field", "3"));
 			hits = searcher.Search(q, null, 1000).scoreDocs;
 			Assert.AreEqual(1, hits.Length);
 			
 			q = new PhraseQuery();
-			q.add(new Term("field", "3"));
-			q.add(new Term("field", "4"));
+			q.Add(new Term("field", "3"));
+			q.Add(new Term("field", "4"));
 			hits = searcher.Search(q, null, 1000).scoreDocs;
 			Assert.AreEqual(0, hits.Length);
 			
@@ -205,26 +205,26 @@
 			Assert.AreEqual(1, hits.Length);
 			
 			q = new PhraseQuery();
-			q.add(new Term("field", "2"));
-			q.add(new Term("field", "4"));
+			q.Add(new Term("field", "2"));
+			q.Add(new Term("field", "4"));
 			hits = searcher.Search(q, null, 1000).scoreDocs;
 			Assert.AreEqual(1, hits.Length);
 			
 			q = new PhraseQuery();
-			q.add(new Term("field", "3"));
-			q.add(new Term("field", "5"));
+			q.Add(new Term("field", "3"));
+			q.Add(new Term("field", "5"));
 			hits = searcher.Search(q, null, 1000).scoreDocs;
 			Assert.AreEqual(1, hits.Length);
 			
 			q = new PhraseQuery();
-			q.add(new Term("field", "4"));
-			q.add(new Term("field", "5"));
+			q.Add(new Term("field", "4"));
+			q.Add(new Term("field", "5"));
 			hits = searcher.Search(q, null, 1000).scoreDocs;
 			Assert.AreEqual(1, hits.Length);
 			
 			q = new PhraseQuery();
-			q.add(new Term("field", "2"));
-			q.add(new Term("field", "5"));
+			q.Add(new Term("field", "2"));
+			q.Add(new Term("field", "5"));
 			hits = searcher.Search(q, null, 1000).scoreDocs;
 			Assert.AreEqual(0, hits.Length);
 			

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/TestSimilarity.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestSimilarity.cs?rev=882654&r1=882653&r2=882654&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestSimilarity.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestSimilarity.cs Fri Nov 20 17:53:56 2009
@@ -257,8 +257,8 @@
 			searcher.Search(bq, new AnonymousClassCollector1(this));
 			
 			PhraseQuery pq = new PhraseQuery();
-			pq.add(a);
-			pq.add(c);
+			pq.Add(a);
+			pq.Add(c);
 			//System.out.println(pq.toString("field"));
 			searcher.Search(pq, new AnonymousClassCollector2(this));
 			

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/TestSloppyPhraseQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestSloppyPhraseQuery.cs?rev=882654&r1=882653&r2=882654&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestSloppyPhraseQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestSloppyPhraseQuery.cs Fri Nov 20 17:53:56
2009
@@ -166,7 +166,7 @@
 			System.String[] t = System.Text.RegularExpressions.Regex.Split(terms, " +");
 			for (int i = 0; i < t.Length; i++)
 			{
-				query.add(new Term("f", t[i]));
+				query.Add(new Term("f", t[i]));
 			}
 			return query;
 		}



Mime
View raw message