Class IndexFormatVersion


  • public class IndexFormatVersion
    extends Object
    This class indicates the lucene index format that is used.
    • Version 1 is the initial index format, which is used for Jackrabbit releases 1.0 to 1.3.x. Unless a re-index happens upgraded Jackrabbit instances will still use this version.
    • Version 2 is the index format introduced with Jackrabbit 1.4.x. It adds a PROPERTIES_SET field which contains all property names of a node. This speeds up queries that check the existence of a property.
    • Version 3 is the index format introduced with Jackrabbit 1.5.x. It adds support for length and local name queries using the newly added fields PROPERTY_LENGTHS, LOCAL_NAME and NAMESPACE_URI. Furthermore a Payload is added to PROPERTIES fields to indicate the property type.
    Please note that existing indexes are not automatically upgraded to a newer version! If you want to take advantage of a certain 'feature' in an index format version you need to re-index the repository.
    • Field Detail

      • V1

        public static final IndexFormatVersion V1
        V1 is the index format for Jackrabbit releases 1.0 to 1.3.x.
      • V2

        public static final IndexFormatVersion V2
        V2 is the index format for Jackrabbit releases 1.4.x
      • V3

        public static final IndexFormatVersion V3
        V3 is the index format for Jackrabbit releases >= 1.5
    • Method Detail

      • getVersion

        public int getVersion()
        Returns the index format version
        Returns:
        the index format version.
      • isAtLeast

        public boolean isAtLeast​(IndexFormatVersion version)
        Returns true if this version is at least as high as the given version.
        Parameters:
        version - the other version to compare.
        Returns:
        true if this version is at least as high as the provided; false otherwise.
      • toString

        public String toString()
        Overrides:
        toString in class Object
        Returns:
        a string representation of this index format version.
      • getVersion

        public static IndexFormatVersion getVersion​(org.apache.lucene.index.IndexReader indexReader)
        Returns:
        the index format version of the index used by the given index reader.