lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aro...@apache.org
Subject svn commit: r881458 - in /incubator/lucene.net/trunk/C#/src: Lucene.Net/Search/Payloads/ Lucene.Net/Search/Spans/ Test/Search/ Test/Search/Spans/
Date Tue, 17 Nov 2009 19:43:11 GMT
Author: aroush
Date: Tue Nov 17 19:43:09 2009
New Revision: 881458

URL: http://svn.apache.org/viewvc?rev=881458&view=rev
Log:
Fixed NUnit test-cases for: TestPhrasePrefixQuery & TestPositionIncrement

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Payloads/PayloadNearQuery.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Payloads/PayloadSpanUtil.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/NearSpansOrdered.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/NearSpansUnordered.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/SpanFirstQuery.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/SpanNotQuery.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/SpanOrQuery.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/Spans.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/TermSpans.cs
    incubator/lucene.net/trunk/C#/src/Test/Search/Spans/JustCompileSearchSpans.cs
    incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestPayloadSpans.cs
    incubator/lucene.net/trunk/C#/src/Test/Search/TestPhrasePrefixQuery.cs
    incubator/lucene.net/trunk/C#/src/Test/Search/TestPositionIncrement.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Payloads/PayloadNearQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/Payloads/PayloadNearQuery.cs?rev=881458&r1=881457&r2=881458&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Payloads/PayloadNearQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Payloads/PayloadNearQuery.cs Tue Nov
17 19:43:09 2009
@@ -242,14 +242,13 @@
 			/// </param>
 			/// <seealso cref="Spans">
 			/// </seealso>
-			protected internal virtual void  ProcessPayloads(System.Collections.ICollection payLoads,
int start, int end)
+			protected internal virtual void  ProcessPayloads(System.Collections.Generic.ICollection<byte[]>
payLoads, int start, int end)
 			{
-				for (System.Collections.IEnumerator iterator = payLoads.GetEnumerator(); iterator.MoveNext();
)
-				{
-					byte[] thePayload = (byte[]) iterator.Current;
-					payloadScore = Enclosing_Instance.function.CurrentScore(doc, Enclosing_Instance.fieldName,
start, end, payloadsSeen, payloadScore, similarity.ScorePayload(doc, Enclosing_Instance.fieldName,
spans.Start(), spans.End(), thePayload, 0, thePayload.Length));
-					++payloadsSeen;
-				}
+                foreach (byte[] thePayload in payLoads)
+                {
+                    payloadScore = Enclosing_Instance.function.CurrentScore(doc, Enclosing_Instance.fieldName,
start, end, payloadsSeen, payloadScore, similarity.ScorePayload(doc, Enclosing_Instance.fieldName,
spans.Start(), spans.End(), thePayload, 0, thePayload.Length));
+                    ++payloadsSeen;
+                }
 			}
 			
 			//

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Payloads/PayloadSpanUtil.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/Payloads/PayloadSpanUtil.cs?rev=881458&r1=881457&r2=881458&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Payloads/PayloadSpanUtil.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Payloads/PayloadSpanUtil.cs Tue Nov
17 19:43:09 2009
@@ -200,14 +200,12 @@
 				if (spans.IsPayloadAvailable())
 				{
 					//ICollection<byte[]> payload = spans.GetPayload();
-                    System.Collections.ICollection payload = spans.GetPayload();
+                    System.Collections.Generic.ICollection<byte[]> payload = spans.GetPayload();
 					//IEnumerator<byte[]> it = payload.GetEnumerator();
-                    System.Collections.IEnumerator it = payload.GetEnumerator();
-					while (it.MoveNext())
-					{
-						byte[] bytes = (byte[]) it.Current;
-						payloads.Add(bytes);
-					}
+                    foreach (byte[] bytes in payload)
+                    {
+                        payloads.Add(bytes);
+                    }
 				}
 			}
 		}

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/NearSpansOrdered.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/Spans/NearSpansOrdered.cs?rev=881458&r1=881457&r2=881458&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/NearSpansOrdered.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/NearSpansOrdered.cs Tue Nov
17 19:43:09 2009
@@ -87,7 +87,7 @@
 		private int matchDoc = - 1;
 		private int matchStart = - 1;
 		private int matchEnd = - 1;
-		private System.Collections.ArrayList matchPayload;
+		private System.Collections.Generic.List<byte[]> matchPayload;
 		
 		private Spans[] subSpansByDoc;
 		private System.Collections.IComparer spanDocComparator;
@@ -110,7 +110,7 @@
 			allowedSlop = spanNearQuery.GetSlop();
 			SpanQuery[] clauses = spanNearQuery.GetClauses();
 			subSpans = new Spans[clauses.Length];
-			matchPayload = new System.Collections.ArrayList();
+			matchPayload = new System.Collections.Generic.List<byte[]>();
 			subSpansByDoc = new Spans[clauses.Length];
 			for (int i = 0; i < clauses.Length; i++)
 			{
@@ -145,7 +145,7 @@
 		
 		// TODO: Remove warning after API has been finalized
 		// TODO: Would be nice to be able to lazy load payloads
-		public override System.Collections.ICollection GetPayload()
+		public override System.Collections.Generic.ICollection<byte[]> GetPayload()
 		{
 			return matchPayload;
 		}
@@ -323,13 +323,20 @@
 		{
 			matchStart = subSpans[subSpans.Length - 1].Start();
 			matchEnd = subSpans[subSpans.Length - 1].End();
-            System.Collections.Hashtable possibleMatchPayloads = new System.Collections.Hashtable();
+            System.Collections.Generic.Dictionary<byte[], byte[]> possibleMatchPayloads
= new System.Collections.Generic.Dictionary<byte[], byte[]>();
 			if (subSpans[subSpans.Length - 1].IsPayloadAvailable())
 			{
-				SupportClass.CollectionsHelper.AddAllIfNotContains(possibleMatchPayloads, subSpans[subSpans.Length
- 1].GetPayload());
+                System.Collections.Generic.ICollection<byte[]> payload = subSpans[subSpans.Length
- 1].GetPayload();
+                foreach(byte[] pl in payload)
+                {
+                    if (!possibleMatchPayloads.ContainsKey(pl))
+                    {
+                        possibleMatchPayloads.Add(pl, pl);
+                    }
+                }
 			}
 			
-			System.Collections.ArrayList possiblePayload = null;
+			System.Collections.Generic.List<byte[]> possiblePayload = null;
 			
 			int matchSlop = 0;
 			int lastStart = matchStart;
@@ -339,8 +346,8 @@
 				Spans prevSpans = subSpans[i];
 				if (collectPayloads && prevSpans.IsPayloadAvailable())
 				{
-					System.Collections.ICollection payload = prevSpans.GetPayload();
-					possiblePayload = new System.Collections.ArrayList(payload.Count);
+					System.Collections.Generic.ICollection<byte[]> payload = prevSpans.GetPayload();
+					possiblePayload = new System.Collections.Generic.List<byte[]>(payload.Count);
 					possiblePayload.AddRange(payload);
 				}
 				
@@ -375,8 +382,8 @@
 							prevEnd = ppEnd;
 							if (collectPayloads && prevSpans.IsPayloadAvailable())
 							{
-								System.Collections.ICollection payload = prevSpans.GetPayload();
-								possiblePayload = new System.Collections.ArrayList(payload.Count);
+								System.Collections.Generic.ICollection<byte[]> payload = prevSpans.GetPayload();
+								possiblePayload = new System.Collections.Generic.List<byte[]>(payload.Count);
 								possiblePayload.AddRange(payload);
 							}
 						}
@@ -385,7 +392,13 @@
 				
 				if (collectPayloads && possiblePayload != null)
 				{
-					SupportClass.CollectionsHelper.AddAllIfNotContains(possibleMatchPayloads, possiblePayload);
+                    foreach (byte[] pl in possiblePayload)
+                    {
+                        if (!possibleMatchPayloads.ContainsKey(pl))
+                        {
+                            possibleMatchPayloads.Add(pl, pl);
+                        }
+                    }
 				}
 				
 				System.Diagnostics.Debug.Assert(prevStart <= matchStart);
@@ -407,7 +420,7 @@
 			
 			if (collectPayloads && match && possibleMatchPayloads.Count > 0)
 			{
-				matchPayload.AddRange(possibleMatchPayloads);
+				matchPayload.AddRange(possibleMatchPayloads.Keys);
 			}
 			
 			return match; // ordered and allowed slop

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/NearSpansUnordered.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/Spans/NearSpansUnordered.cs?rev=881458&r1=881457&r2=881458&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/NearSpansUnordered.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/NearSpansUnordered.cs Tue Nov
17 19:43:09 2009
@@ -155,9 +155,9 @@
 				return spans.End();
 			}
 			// TODO: Remove warning after API has been finalized
-			public override System.Collections.ICollection GetPayload()
+			public override System.Collections.Generic.ICollection<byte[]> GetPayload()
 			{
-				return new System.Collections.ArrayList(spans.GetPayload());
+				return spans.GetPayload();
 			}
 			
 			// TODO: Remove warning after API has been finalized
@@ -318,17 +318,25 @@
 		/// <returns> Collection of <code>byte[]</code> payloads
 		/// </returns>
 		/// <throws>  IOException </throws>
-		public override System.Collections.ICollection GetPayload()
+		public override System.Collections.Generic.ICollection<byte[]> GetPayload()
 		{
-            System.Collections.Hashtable matchPayload = new System.Collections.Hashtable();
+            //mgarski: faking out another HashSet<T>...
+			System.Collections.Generic.Dictionary<byte[], byte[]> matchPayload = new System.Collections.Generic.Dictionary<byte[],
byte[]>(); 
 			for (SpansCell cell = first; cell != null; cell = cell.next)
 			{
 				if (cell.IsPayloadAvailable())
 				{
-					SupportClass.CollectionsHelper.AddAllIfNotContains(matchPayload, cell.GetPayload());
+                    System.Collections.Generic.ICollection<byte[]> cellPayload = cell.GetPayload();
+                    foreach (byte[] val in cellPayload)
+                    {
+                        if (!matchPayload.ContainsKey(val))
+                        {
+                            matchPayload.Add(val, val);
+                        }
+                    }
 				}
 			}
-			return matchPayload;
+			return matchPayload.Keys;
 		}
 		
 		// TODO: Remove warning after API has been finalized

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/SpanFirstQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/Spans/SpanFirstQuery.cs?rev=881458&r1=881457&r2=881458&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/SpanFirstQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/SpanFirstQuery.cs Tue Nov 17
19:43:09 2009
@@ -85,12 +85,12 @@
 			}
 			
 			// TODO: Remove warning after API has been finalized
-			public override System.Collections.ICollection GetPayload()
+			public override System.Collections.Generic.ICollection<byte[]> GetPayload()
 			{
-				System.Collections.ArrayList result = null;
+				System.Collections.Generic.ICollection<byte[]> result = null;
 				if (spans.IsPayloadAvailable())
 				{
-					result = new System.Collections.ArrayList(spans.GetPayload());
+					result = spans.GetPayload();
 				}
 				return result; //TODO: any way to avoid the new construction?
 			}

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/SpanNotQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/Spans/SpanNotQuery.cs?rev=881458&r1=881457&r2=881458&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/SpanNotQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/SpanNotQuery.cs Tue Nov 17 19:43:09
2009
@@ -121,12 +121,12 @@
 			}
 			
 			// TODO: Remove warning after API has been finalizedb
-			public override System.Collections.ICollection GetPayload()
+			public override System.Collections.Generic.ICollection<byte[]> GetPayload()
 			{
-				System.Collections.ArrayList result = null;
+				System.Collections.Generic.ICollection<byte[]> result = null;
 				if (includeSpans.IsPayloadAvailable())
 				{
-					result = new System.Collections.ArrayList(includeSpans.GetPayload());
+					result = includeSpans.GetPayload();
 				}
 				return result;
 			}

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/SpanOrQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/Spans/SpanOrQuery.cs?rev=881458&r1=881457&r2=881458&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/SpanOrQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/SpanOrQuery.cs Tue Nov 17 19:43:09
2009
@@ -138,13 +138,13 @@
 			}
 			
 			// TODO: Remove warning after API has been finalized
-			public override System.Collections.ICollection GetPayload()
+			public override System.Collections.Generic.ICollection<byte[]> GetPayload()
 			{
-				System.Collections.ArrayList result = null;
+				System.Collections.Generic.ICollection<byte[]> result = null;
 				Spans theTop = Top();
 				if (theTop != null && theTop.IsPayloadAvailable())
 				{
-					result = new System.Collections.ArrayList(theTop.GetPayload());
+					result = theTop.GetPayload();
 				}
 				return result;
 			}

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/Spans.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/Spans/Spans.cs?rev=881458&r1=881457&r2=881458&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/Spans.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/Spans.cs Tue Nov 17 19:43:09
2009
@@ -77,7 +77,7 @@
 		/// </returns>
 		/// <throws>  java.io.IOException </throws>
 		// TODO: Remove warning after API has been finalized
-		public abstract System.Collections.ICollection GetPayload();
+		public abstract System.Collections.Generic.ICollection<byte[]> GetPayload();
 		
 		/// <summary> Checks if a payload can be loaded at this position.
 		/// <p/>

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/TermSpans.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/Spans/TermSpans.cs?rev=881458&r1=881457&r2=881458&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/TermSpans.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/Spans/TermSpans.cs Tue Nov 17 19:43:09
2009
@@ -96,11 +96,13 @@
 		}
 		
 		// TODO: Remove warning after API has been finalized
-		public override System.Collections.ICollection GetPayload()
+		public override System.Collections.Generic.ICollection<byte[]> GetPayload()
 		{
 			byte[] bytes = new byte[positions.GetPayloadLength()];
 			bytes = positions.GetPayload(bytes, 0);
-			return System.Collections.ArrayList.ReadOnly(new System.Collections.ArrayList(new System.Object[]{bytes}));
+            System.Collections.Generic.List<byte[]> val = new System.Collections.Generic.List<byte[]>();
+            val.Add(bytes);
+            return val;
 		}
 		
 		// TODO: Remove warning after API has been finalized

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/Spans/JustCompileSearchSpans.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/Spans/JustCompileSearchSpans.cs?rev=881458&r1=881457&r2=881458&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/Spans/JustCompileSearchSpans.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/Spans/JustCompileSearchSpans.cs Tue Nov
17 19:43:09 2009
@@ -65,7 +65,7 @@
 				throw new System.NotSupportedException(Lucene.Net.Search.Spans.JustCompileSearchSpans.UNSUPPORTED_MSG);
 			}
 			
-			public override System.Collections.ICollection GetPayload()
+			public override System.Collections.Generic.ICollection<byte[]> GetPayload()
 			{
 				throw new System.NotSupportedException(Lucene.Net.Search.Spans.JustCompileSearchSpans.UNSUPPORTED_MSG);
 			}
@@ -106,7 +106,7 @@
 		internal sealed class JustCompilePayloadSpans:Spans
 		{
 			
-			public override System.Collections.ICollection GetPayload()
+			public override System.Collections.Generic.ICollection<byte[]> GetPayload()
 			{
 				throw new System.NotSupportedException(Lucene.Net.Search.Spans.JustCompileSearchSpans.UNSUPPORTED_MSG);
 			}

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestPayloadSpans.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/Spans/TestPayloadSpans.cs?rev=881458&r1=881457&r2=881458&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestPayloadSpans.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestPayloadSpans.cs Tue Nov 17 19:43:09
2009
@@ -286,7 +286,7 @@
 			{
 				while (spans.Next())
 				{
-					System.Collections.ICollection payloads = spans.GetPayload();
+					System.Collections.Generic.ICollection<byte[]> payloads = spans.GetPayload();
 					
 					for (System.Collections.IEnumerator it = payloads.GetEnumerator(); it.MoveNext(); )
 					{
@@ -323,7 +323,7 @@
 			{
 				while (spans.Next())
 				{
-					System.Collections.ICollection payloads = spans.GetPayload();
+					System.Collections.Generic.ICollection<byte[]> payloads = spans.GetPayload();
 					int cnt = 0;
 					for (System.Collections.IEnumerator it = payloads.GetEnumerator(); it.MoveNext(); )
 					{
@@ -360,7 +360,7 @@
 			{
 				while (spans.Next())
 				{
-					System.Collections.ICollection payloads = spans.GetPayload();
+					System.Collections.Generic.ICollection<byte[]> payloads = spans.GetPayload();
 					
 					for (System.Collections.IEnumerator it = payloads.GetEnumerator(); it.MoveNext(); )
 					{
@@ -431,7 +431,7 @@
 				//See payload helper, for the PayloadHelper.FIELD field, there is a single byte payload
at every token
 				if (spans.IsPayloadAvailable())
 				{
-					System.Collections.ICollection payload = spans.GetPayload();
+					System.Collections.Generic.ICollection<byte[]> payload = spans.GetPayload();
 					Assert.IsTrue(payload.Count == expectedNumPayloads, "payload Size: " + payload.Count
+ " is not: " + expectedNumPayloads);
 					for (System.Collections.IEnumerator iterator = payload.GetEnumerator(); iterator.MoveNext();
)
 					{
@@ -479,7 +479,7 @@
 					System.Console.Out.WriteLine("\nSpans Dump --");
 				if (spans.IsPayloadAvailable())
 				{
-					System.Collections.ICollection payload = spans.GetPayload();
+					System.Collections.Generic.ICollection<byte[]> payload = spans.GetPayload();
 					if (DEBUG)
 						System.Console.Out.WriteLine("payloads for span:" + payload.Count);
 					System.Collections.IEnumerator it = payload.GetEnumerator();

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/TestPhrasePrefixQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestPhrasePrefixQuery.cs?rev=881458&r1=881457&r2=881458&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestPhrasePrefixQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestPhrasePrefixQuery.cs Tue Nov 17 19:43:09
2009
@@ -41,9 +41,9 @@
     [TestFixture]
 	public class TestPhrasePrefixQuery:LuceneTestCase
 	{
-		public TestPhrasePrefixQuery(System.String name):base(name)
+		/*public TestPhrasePrefixQuery(System.String name):base(name)
 		{
-		}
+		}*/
 		
 		/// <summary> </summary>
 		[Test]

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=881458&r1=881457&r2=881458&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestPositionIncrement.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestPositionIncrement.cs Tue Nov 17 19:43:09
2009
@@ -286,7 +286,13 @@
 					writer.SetAllowMinus1Position();
 				}
 				Document doc = new Document();
-				doc.Add(new Field("content", new System.IO.StreamReader("a a b c d e a f g h i j a b
k k")));
+                System.IO.MemoryStream ms = new System.IO.MemoryStream();
+                System.IO.StreamWriter sw = new System.IO.StreamWriter(ms);
+                sw.Write("a a b c d e a f g h i j a b k k");
+                // flush to stream & reset it's position so it can be read
+                sw.Flush();
+                ms.Position = 0;
+                doc.Add(new Field("content", new System.IO.StreamReader(ms)));
 				writer.AddDocument(doc);
 				
 				IndexReader r = writer.GetReader();
@@ -331,7 +337,7 @@
 				while (pspans.Next())
 				{
 					//System.out.println(pspans.doc() + " - " + pspans.start() + " - "+ pspans.end());
-					System.Collections.ICollection payloads = pspans.GetPayload();
+					System.Collections.Generic.ICollection<byte[]> payloads = pspans.GetPayload();
 					sawZero |= pspans.Start() == 0;
 					for (System.Collections.IEnumerator it = payloads.GetEnumerator(); it.MoveNext(); )
 					{



Mime
View raw message