16-Aug-05 (Created: 16-Aug-05) | More in 'Lucene'

lucene: How to print the field names and their values of a lucene document


	public void printAllFields(Document doc)
	{
		Enumeration fieldEnum = doc.fields();
		while(fieldEnum.hasMoreElements())
		{
			Field field = (Field)fieldEnum.nextElement();
			String value = doc.get(field.name());
			Log.log(field.name() + ":" + value);
		}
	}