lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aro...@apache.org
Subject svn commit: r569953 - /incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/MultiPhraseQuery.cs
Date Mon, 27 Aug 2007 01:38:14 GMT
Author: aroush
Date: Sun Aug 26 18:38:14 2007
New Revision: 569953

URL: http://svn.apache.org/viewvc?rev=569953&view=rev
Log:
Re-fix: LUCENENET-92 "NUnite test for QueryParser.TestMultiAnalyzer."

Applied different fix for this issue; current patch would have left a single quote when there
are no terms.

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/MultiPhraseQuery.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/MultiPhraseQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/MultiPhraseQuery.cs?rev=569953&r1=569952&r2=569953&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/MultiPhraseQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/MultiPhraseQuery.cs Sun Aug 26 18:38:14
2007
@@ -324,10 +324,17 @@
 				buffer.Append(":");
 			}
 			
+            bool appendSpace = false;
+
 			buffer.Append("\"");
 			System.Collections.IEnumerator i = termArrays.GetEnumerator();
 			while (i.MoveNext())
 			{
+                if (appendSpace == true)
+                    buffer.Append(" ");
+                else
+                    appendSpace = true;
+
 				Term[] terms = (Term[]) i.Current;
 				if (terms.Length > 1)
 				{
@@ -344,9 +351,7 @@
 				{
 					buffer.Append(terms[0].Text());
 				}
-				buffer.Append(" ");
 			}
-            buffer.Length--;
 			buffer.Append("\"");
 			
 			if (slop != 0)



Mime
View raw message