Package org.apache.lucene.util.hnsw
Interface HnswGraphMerger
- All Known Implementing Classes:
ConcurrentHnswMerger,IncrementalHnswGraphMerger
public interface HnswGraphMerger
Abstraction of merging multiple graphs into one on-heap graph
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Method Summary
Modifier and TypeMethodDescriptionaddReader(KnnVectorsReader reader, MergeState.DocMap docMap, Bits liveDocs) Adds a reader to the graph merger to record the statemerge(KnnVectorValues mergedVectorValues, InfoStream infoStream, int maxOrd) Merge and produce the on heap graph
-
Method Details
-
addReader
HnswGraphMerger addReader(KnnVectorsReader reader, MergeState.DocMap docMap, Bits liveDocs) throws IOException Adds a reader to the graph merger to record the state- Parameters:
reader- KnnVectorsReader to add to the mergerdocMap- MergeState.DocMap for the readerliveDocs- Bits representing live docs, can be null- Returns:
- this
- Throws:
IOException- If an error occurs while reading from the merge state
-
merge
OnHeapHnswGraph merge(KnnVectorValues mergedVectorValues, InfoStream infoStream, int maxOrd) throws IOException Merge and produce the on heap graph- Parameters:
mergedVectorValues- view of the vectors in the merged segmentinfoStream- optional info stream to set to buildermaxOrd- max number of vectors that will be added to the graph- Returns:
- merged graph
- Throws:
IOException- during merge
-