lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aro...@apache.org
Subject svn commit: r462663 - in /incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net: AssemblyInfo.cs Document/Document.cs Index/DocumentWriter.cs Index/FieldInfos.cs Index/FieldsWriter.cs Index/ParallelReader.cs
Date Wed, 11 Oct 2006 02:24:48 GMT
Author: aroush
Date: Tue Oct 10 19:24:47 2006
New Revision: 462663

URL: http://svn.apache.org/viewvc?view=rev&rev=462663
Log:
Lucene.Net.Documents.Document.Fields() -- changed from returning an IEnumerator to IEnumerable

Modified:
    incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/AssemblyInfo.cs
    incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Document/Document.cs
    incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/DocumentWriter.cs
    incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/FieldInfos.cs
    incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/FieldsWriter.cs
    incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/ParallelReader.cs

Modified: incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/AssemblyInfo.cs?view=diff&rev=462663&r1=462662&r2=462663
==============================================================================
--- incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/AssemblyInfo.cs (original)
+++ incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/AssemblyInfo.cs Tue Oct 10 19:24:47
2006
@@ -26,7 +26,7 @@
 // You can specify all the values or you can default the Revision and Build Numbers 
 // by using the '*' as shown below:
 
-[assembly: AssemblyVersion("1.9.1.002")]
+[assembly: AssemblyVersion("1.9.1.003")]
 
 //
 // In order to sign your assembly you must specify a key to use. Refer to the 

Modified: incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Document/Document.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Document/Document.cs?view=diff&rev=462663&r1=462662&r2=462663
==============================================================================
--- incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Document/Document.cs (original)
+++ incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Document/Document.cs Tue Oct
10 19:24:47 2006
@@ -47,8 +47,14 @@
 		{
 		}
 		
+        /// <summary>Returns the number of fields in this document</summary>
+        /// Added as a helper for Lucene.Net
+        public int GetFieldsCount()
+        {
+            return fields.Count;
+        }
 		
-		/// <summary>Sets a boost factor for hits on any field of this document.  This value
+        /// <summary>Sets a boost factor for hits on any field of this document.  This
value
 		/// will be multiplied into the score of all hits on this document.
 		/// 
 		/// <p>Values are multiplied into the value of {@link Field#GetBoost()} of
@@ -169,9 +175,9 @@
 		}
 		
 		/// <summary>Returns an Enumeration of all the fields in a document. </summary>
-		public System.Collections.IEnumerator Fields()
+		public System.Collections.IEnumerable Fields()
 		{
-			return ((System.Collections.ArrayList) fields).GetEnumerator();
+			return fields;
 		}
 		
 		/// <summary> Returns an array of {@link Field}s with the given name.

Modified: incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/DocumentWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/DocumentWriter.cs?view=diff&rev=462663&r1=462662&r2=462663
==============================================================================
--- incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/DocumentWriter.cs (original)
+++ incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/DocumentWriter.cs Tue
Oct 10 19:24:47 2006
@@ -138,10 +138,8 @@
 		// Tokenizes the fields of a document into Postings.
 		private void  InvertDocument(Document doc)
 		{
-			System.Collections.IEnumerator fields = doc.Fields();
-			while (fields.MoveNext())
+			foreach(Field field in doc.Fields())
 			{
-				Field field = (Field) fields.Current;
 				System.String fieldName = field.Name();
 				int fieldNumber = fieldInfos.FieldNumber(fieldName);
 				

Modified: incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/FieldInfos.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/FieldInfos.cs?view=diff&rev=462663&r1=462662&r2=462663
==============================================================================
--- incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/FieldInfos.cs (original)
+++ incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/FieldInfos.cs Tue Oct
10 19:24:47 2006
@@ -70,10 +70,8 @@
 		/// <summary>Adds field info for a Document. </summary>
 		public void  Add(Document doc)
 		{
-			System.Collections.IEnumerator fields = doc.Fields();
-			while (fields.MoveNext())
+			foreach (Field field in doc.Fields())
 			{
-				Field field = (Field) fields.Current;
 				Add(field.Name(), field.IsIndexed(), field.IsTermVectorStored(), field.IsStorePositionWithTermVector(),
field.IsStoreOffsetWithTermVector(), field.GetOmitNorms());
 			}
 		}

Modified: incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/FieldsWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/FieldsWriter.cs?view=diff&rev=462663&r1=462662&r2=462663
==============================================================================
--- incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/FieldsWriter.cs (original)
+++ incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/FieldsWriter.cs Tue Oct
10 19:24:47 2006
@@ -53,19 +53,15 @@
 			indexStream.WriteLong(fieldsStream.GetFilePointer());
 			
 			int storedCount = 0;
-			System.Collections.IEnumerator fields = doc.Fields();
-			while (fields.MoveNext())
+			foreach (Field field  in doc.Fields())
 			{
-				Field field = (Field) fields.Current;
 				if (field.IsStored())
 					storedCount++;
 			}
 			fieldsStream.WriteVInt(storedCount);
 			
-			fields = doc.Fields();
-			while (fields.MoveNext())
+			foreach (Field field in doc.Fields())
 			{
-				Field field = (Field) fields.Current;
 				if (field.IsStored())
 				{
 					fieldsStream.WriteVInt(fieldInfos.FieldNumber(field.Name()));

Modified: incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/ParallelReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/ParallelReader.cs?view=diff&rev=462663&r1=462662&r2=462663
==============================================================================
--- incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/ParallelReader.cs (original)
+++ incubator/lucene.net/tags/Lucene.Net_1_9_1/src/Lucene.Net/Index/ParallelReader.cs Tue
Oct 10 19:24:47 2006
@@ -152,10 +152,9 @@
 			for (int i = 0; i < storedFieldReaders.Count; i++)
 			{
 				IndexReader reader = (IndexReader) storedFieldReaders[i];
-				System.Collections.IEnumerator fields = reader.Document(n).Fields();
-				while (fields.MoveNext())
+				foreach(Field field in reader.Document(n).Fields())
 				{
-					result.Add((Field) fields.Current);
+					result.Add(field);
 				}
 			}
 			return result;



Mime
View raw message