Package org.apache.lucene.sandbox.codecs.idversion
package org.apache.lucene.sandbox.codecs.idversion
A primary-key postings format that associates a version (long) with each term and can provide
fail-fast lookups by ID and version.
-
ClassesClassDescriptionA PostingsFormat optimized for primary-key (ID) fields that also record a version (long) for each ID, delivered as a payload created by
IDVersionPostingsFormat.longToBytes(long, org.apache.lucene.util.BytesRef)during indexing.Iterates through terms in this field; this class is public so users can cast it to callIDVersionSegmentTermsEnum.seekExact(BytesRef, long)for optimistic-concurrency, and alsoIDVersionSegmentTermsEnum.getVersion()to get the version of the currently seek'd term.This is just likeLucene90BlockTreeTermsWriter, except it also stores a version per term, and adds a method to its TermsEnum implementation to seekExact only if the version is >= the specified version.