Hi,
The method org.apache.lucene.document.Document.getField(String name) is
documented as this :
"Returns a field with the given name if any exist in this document, or
null. If multiple fields may exist with this name, this method returns
the last added such added."
I'm wondering why the limit for multiple fields. In some cases, I'm
interested in retrieving all the values for a field. Looking at the
code, I see that it returns a field as soon as it finds one with the
right name :
-----
for (DocumentFieldList list = fieldList; list != null; list =
list.next)
if (list.field.name().equals(name))
return list.field;
-----
Would it be possible to add something like a "public Field[]
getFields(String name)" method to the Document class? It is pretty
simple to write, I can send the code if needed.
Thank's,
Martin Sévigny
--
To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>
The method org.apache.lucene.document.Document.getField(String name) is
documented as this :
"Returns a field with the given name if any exist in this document, or
null. If multiple fields may exist with this name, this method returns
the last added such added."
I'm wondering why the limit for multiple fields. In some cases, I'm
interested in retrieving all the values for a field. Looking at the
code, I see that it returns a field as soon as it finds one with the
right name :
-----
for (DocumentFieldList list = fieldList; list != null; list =
list.next)
if (list.field.name().equals(name))
return list.field;
-----
Would it be possible to add something like a "public Field[]
getFields(String name)" method to the Document class? It is pretty
simple to write, I can send the code if needed.
Thank's,
Martin Sévigny
--
To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>