My apologies, the first attachement was an empty file. -----Message d'origine----- De : Rasik Pandey [mailto:[EMAIL PROTECTED]] Envoyé : mercredi 9 octobre 2002 17:10 À : [EMAIL PROTECTED] Objet : Potential Contribution
Developers, Attached is a diff of Document.java. We added two methods for our needs which return multiple fields for a given field name and and another which returns multiple values for a given field name. If you find these to be useful for Lucene, would someone please add them to the sources. Rasik
C:\Program Files\GNU\WinCvs 1.2\cvs.exe diff -r 1.3 -w Document.java Index: Document.java =================================================================== RCS file: /home/cvspublic/jakarta-lucene/src/java/org/apache/lucene/document/Document.java,v retrieving revision 1.3 diff -w -r1.3 Document.java 57a58,59 > import java.util.Vector; > 149a152,177 > > public final Field[] getFields(String name) { > Vector tmp = new Vector(); > for (DocumentFieldList list = fieldList; list != null; list = list.next) > if (list.field.name().equals(name)) > tmp.add(list.field); > int l = tmp.size(); > if (l == 0) > return null; > else { > Field[] fs = new Field[l]; > for (int i = 0; i < l; i++) > fs[i] = (Field) tmp.get(i); > return fs; > } > } > > public final String[] getValues(String name) { > Field[] namedFields = getFields(name); > if (namedFields == null) return null; > String[] values = new String[namedFields.length]; > for (int i = 0; i < namedFields.length; i++) { > values[i] = namedFields[i].stringValue(); > } > return values; > } CVS command finished execution
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>