lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Aroush" <>
Subject RE: changes to Documents.Fields() in Lucene 1.9
Date Tue, 11 Jul 2006 18:35:13 GMT
Hi Jon,

Thanks for the feedback.  Two things changed:

1) "fields" -- this used to be public, it is now internal.  It was wrong for
it to be public.

2) Fields() -- you are right.  We should just return "fields" (no casting.)
Lets give 1.9 another week or so till the "dust settles down" this way I can
make one release instead of multiples for 1.9.


-- George

-----Original Message-----
From: Jon Palmer [] 
Sent: Tuesday, July 11, 2006 1:25 PM
Subject: changes to Documents.Fields() in Lucene 1.9

I've just upgraded to 1.9 (congrats to everyone involved in the release)


I'm coming up against some issues with Document.Fields()


With the previous release their was a property Document.fields returning and
IList of all the fields in a given Document. This was nice because I could
do things like


int count = doc.fields.Count





foreach(Field field in doc.fields)



However with the removal of the fields property we now have to rely on
doc.Fields(). In 1.9 doc.Fields() is changed to return a
System.Collections.IEnumerator object which cannot be use in a foreach loop
rather than a System.Collections.IEnumerableobject. I understand that in
Java, with no foreach loops the Enumerator is about as useful as the actual
object but in.Net why does Fields() not return an object of type
System.Collections.IEnumerable. i.e. the code in Document.cs would just be:


            /// <summary>Returns an Enumeration of all the fields in a
document. </summary>

            public System.Collections.IEnumerable Fields()


                  return fields;



Or maybe just 


            public System.Collections.IEnumerable Fields




                        return fields;






Many thanks,





View raw message