JavaCodeToDumpLuceneAttributes.txt

Date HTML Created

22 Oct 2007

Code to reveal asttributes of lucene fields List AllTheFields = d.getFields(); for ( i = 0; i < AllTheFields.size(); i++){ Field OneField = (Field)AllTheFields.get(i); log.info("Field number : " + i); log.info("Name : " + OneField.name()); log.info("getBoost : " + OneField.getBoost()); log.info("getOmitNorms : " + OneField.getOmitNorms()); log.info("isBinary : " + OneField.isBinary()); log.info("isCompressed : " + OneField.isCompressed()); log.info("isIndexed : " + OneField.isIndexed()); log.info("isLazy : " + OneField.isLazy()); log.info("isStored : " + OneField.isStored()); log.info("isStoreOffsetWithTermVector : " + OneField.isStoreOffsetWithTermVector()); log.info("isStorePositionWithTermVector : " + OneField.isStorePositionWithTermVector()); log.info("isTermVectorStored : " + OneField.isTermVectorStored()); log.info("isTokenized : " + OneField.isTokenized()); log.info("stringValue : " + OneField.stringValue()); } Notes: d is a lucence Document object The method getFields from lucene Documnet class getFields Is not in the jar file 2.0.0 but is in 2.2.0, so I temporarily switched the jars. Current Manifest for lucenc jar Manifest-Version: 1.0 Ant-Version: Apache Ant 1.6.5 Created-By: Apache Jakarta Name: org/apache/lucene/ Specification-Title: Lucene Search Engine Specification-Version: 2.0.0 Specification-Vendor: Lucene Implementation-Title: org.apache.lucene Implementation-Version: build 2006-05-26 Implementation-Vendor: Lucene