Module org.elasticsearch.server
Class Lucene99ScalarQuantizedVectorsWriter
java.lang.Object
org.apache.lucene.codecs.KnnVectorsWriter
org.apache.lucene.codecs.hnsw.FlatVectorsWriter
org.elasticsearch.index.codec.vectors.Lucene99ScalarQuantizedVectorsWriter
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.lucene.util.Accountable
public final class Lucene99ScalarQuantizedVectorsWriter
extends org.apache.lucene.codecs.hnsw.FlatVectorsWriter
Copied from Lucene 10.3.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.codecs.KnnVectorsWriter
org.apache.lucene.codecs.KnnVectorsWriter.MergedVectorValues -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatDynamic confidence intervalFields inherited from class org.apache.lucene.codecs.hnsw.FlatVectorsWriter
vectorsScorerFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
ConstructorsConstructorDescriptionLucene99ScalarQuantizedVectorsWriter(org.apache.lucene.index.SegmentWriteState state, Float confidenceInterval, byte bits, boolean compress, org.apache.lucene.codecs.hnsw.FlatVectorsWriter rawVectorDelegate, org.apache.lucene.codecs.hnsw.FlatVectorsScorer scorer) Lucene99ScalarQuantizedVectorsWriter(org.apache.lucene.index.SegmentWriteState state, Float confidenceInterval, org.apache.lucene.codecs.hnsw.FlatVectorsWriter rawVectorDelegate, org.apache.lucene.codecs.hnsw.FlatVectorsScorer scorer) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.lucene.codecs.hnsw.FlatFieldVectorsWriter<?> addField(org.apache.lucene.index.FieldInfo fieldInfo) voidclose()voidfinish()voidflush(int maxDoc, org.apache.lucene.index.Sorter.DocMap sortMap) static org.apache.lucene.util.quantization.ScalarQuantizermergeAndRecalculateQuantiles(org.apache.lucene.index.MergeState mergeState, org.apache.lucene.index.FieldInfo fieldInfo, Float confidenceInterval, byte bits) Merges the quantiles of the segments and recalculates the quantiles if necessary.voidmergeOneField(org.apache.lucene.index.FieldInfo fieldInfo, org.apache.lucene.index.MergeState mergeState) org.apache.lucene.util.hnsw.CloseableRandomVectorScorerSuppliermergeOneFieldToIndex(org.apache.lucene.index.FieldInfo fieldInfo, org.apache.lucene.index.MergeState mergeState) longstatic org.apache.lucene.index.DocsWithFieldSetwriteQuantizedVectorData(org.apache.lucene.store.IndexOutput output, org.apache.lucene.util.quantization.QuantizedByteVectorValues quantizedByteVectorValues, byte bits, boolean compress) Writes the vector values to the output and returns a set of documents that contains vectors.Methods inherited from class org.apache.lucene.codecs.hnsw.FlatVectorsWriter
getFlatVectorScorerMethods inherited from class org.apache.lucene.codecs.KnnVectorsWriter
mapOldOrdToNewOrd, mergeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Field Details
-
DYNAMIC_CONFIDENCE_INTERVAL
public static final float DYNAMIC_CONFIDENCE_INTERVALDynamic confidence interval- See Also:
-
-
Constructor Details
-
Lucene99ScalarQuantizedVectorsWriter
public Lucene99ScalarQuantizedVectorsWriter(org.apache.lucene.index.SegmentWriteState state, Float confidenceInterval, org.apache.lucene.codecs.hnsw.FlatVectorsWriter rawVectorDelegate, org.apache.lucene.codecs.hnsw.FlatVectorsScorer scorer) throws IOException - Throws:
IOException
-
Lucene99ScalarQuantizedVectorsWriter
public Lucene99ScalarQuantizedVectorsWriter(org.apache.lucene.index.SegmentWriteState state, Float confidenceInterval, byte bits, boolean compress, org.apache.lucene.codecs.hnsw.FlatVectorsWriter rawVectorDelegate, org.apache.lucene.codecs.hnsw.FlatVectorsScorer scorer) throws IOException - Throws:
IOException
-
-
Method Details
-
addField
public org.apache.lucene.codecs.hnsw.FlatFieldVectorsWriter<?> addField(org.apache.lucene.index.FieldInfo fieldInfo) throws IOException - Specified by:
addFieldin classorg.apache.lucene.codecs.hnsw.FlatVectorsWriter- Throws:
IOException
-
mergeOneField
public void mergeOneField(org.apache.lucene.index.FieldInfo fieldInfo, org.apache.lucene.index.MergeState mergeState) throws IOException - Overrides:
mergeOneFieldin classorg.apache.lucene.codecs.KnnVectorsWriter- Throws:
IOException
-
mergeOneFieldToIndex
public org.apache.lucene.util.hnsw.CloseableRandomVectorScorerSupplier mergeOneFieldToIndex(org.apache.lucene.index.FieldInfo fieldInfo, org.apache.lucene.index.MergeState mergeState) throws IOException - Specified by:
mergeOneFieldToIndexin classorg.apache.lucene.codecs.hnsw.FlatVectorsWriter- Throws:
IOException
-
flush
- Specified by:
flushin classorg.apache.lucene.codecs.KnnVectorsWriter- Throws:
IOException
-
finish
- Specified by:
finishin classorg.apache.lucene.codecs.KnnVectorsWriter- Throws:
IOException
-
ramBytesUsed
public long ramBytesUsed() -
mergeAndRecalculateQuantiles
public static org.apache.lucene.util.quantization.ScalarQuantizer mergeAndRecalculateQuantiles(org.apache.lucene.index.MergeState mergeState, org.apache.lucene.index.FieldInfo fieldInfo, Float confidenceInterval, byte bits) throws IOException Merges the quantiles of the segments and recalculates the quantiles if necessary.- Parameters:
mergeState- The merge statefieldInfo- The field infoconfidenceInterval- The confidence intervalbits- The number of bits- Returns:
- The merged quantiles
- Throws:
IOException- If there is a low-level I/O error
-
writeQuantizedVectorData
public static org.apache.lucene.index.DocsWithFieldSet writeQuantizedVectorData(org.apache.lucene.store.IndexOutput output, org.apache.lucene.util.quantization.QuantizedByteVectorValues quantizedByteVectorValues, byte bits, boolean compress) throws IOException Writes the vector values to the output and returns a set of documents that contains vectors.- Throws:
IOException
-
close
- Throws:
IOException
-