diff --git a/docs/java/allclasses-index.html b/docs/java/allclasses-index.html index 4cf07cb3..50294d1d 100644 --- a/docs/java/allclasses-index.html +++ b/docs/java/allclasses-index.html @@ -1,108 +1,216 @@ +
Copyright © 2023. All rights reserved.
public static class Index.QueryResults +extends Object
final float[]
distances
float[]
final long[]
labels
long[]
QueryResults(long[] labels, - float[] distances)
QueryResults(long[] labels, + float[] distances)
getDistances()
getLabels()
String
toString()
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public final long[] labels
public final float[] distances
public QueryResults(long[] labels, + float[] distances)
IllegalArgumentException
toString
Object
public String toString()
public long[] getLabels()
public float[] getDistances()
Serializable
Comparable<Index.SpaceType>
public static enum Index.SpaceType +extends Enum<Index.SpaceType>
SpaceType is a property of an Index, and cannot be changed after instantiation. Loading an index with a different SpaceType than it was created with may result in nonsensical results being returned.
Cosine
Euclidean
L2
InnerProduct
static Index.SpaceType
valueOf(String name)
valueOf(String name)
static Index.SpaceType[]
values()
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final Index.SpaceType Euclidean
public static final Index.SpaceType InnerProduct
public static final Index.SpaceType Cosine
public static Index.SpaceType[] values()
+for (Index.SpaceType c : Index.SpaceType.values()) + System.out.println(c); +
public static Index.SpaceType valueOf(String name)
name
NullPointerException
Comparable<Index.StorageDataType>
public static enum Index.StorageDataType +extends Enum<Index.StorageDataType>
E4M3
Float32
Float8
static Index.StorageDataType
static Index.StorageDataType[]
public static final Index.StorageDataType Float8
Float8 provides 8 bits of resolution; i.e.: the distance between successive values is 1/127, or 0.00787. For a variable-precision (i.e.: _actually_ floating point) representation, use E4M3.
public static final Index.StorageDataType Float32
public static final Index.StorageDataType E4M3
E4M3 uses a 4-bit exponent and 3-bit mantissa field, and was inspired by the paper "FP8 Formats for Deep Learning" by Micikevicus et al (arXiv:2209.05433).
public static Index.StorageDataType[] values()
+for (Index.StorageDataType c : Index.StorageDataType.values()) + System.out.println(c); +
public static Index.StorageDataType valueOf(String name)
Closeable
AutoCloseable
public class Index +extends Object +implements Closeable
static class
Index.QueryResults
static enum
Index.SpaceType
Index.StorageDataType
Index(Index.SpaceType space, - int numDimensions)
Index(Index.SpaceType space, + int numDimensions)
Index
numDimensions
Index(Index.SpaceType space, - int numDimensions, - long indexM, - long efConstruction, - long randomSeed, - long maxElements, - Index.StorageDataType storageDataType)
Index(Index.SpaceType space, + int numDimensions, + long indexM, + long efConstruction, + long randomSeed, + long maxElements, + Index.StorageDataType storageDataType)
void
addItem(float[] vector)
addItem(float[] vector)
addItem(float[] vector, - long id)
addItem(float[] vector, + long id)
addItems(float[][] vectors, - int numThreads)
addItems(float[][] vectors, + int numThreads)
addItems(float[][] vectors, - long[] ids, - int numThreads)
addItems(float[][] vectors, + long[] ids, + int numThreads)
close()
protected void
finalize()
int
getEf()
query(float[], int)
long
getEfConstruction()
getIDs()
getM()
getMaxElements()
getNumDimensions()
getNumElements()
getNumThreads()
getSpace()
getVector(long id)
getVector(long id)
float[][]
getVectors(long[] ids)
getVectors(long[] ids)
static Index
load(InputStream inputStream)
load(InputStream inputStream)
java.io.InputStream
load(InputStream inputStream, - Index.SpaceType space, - int numDimensions, - Index.StorageDataType storageDataType)
load(InputStream inputStream, + Index.SpaceType space, + int numDimensions, + Index.StorageDataType storageDataType)
load(String filename)
load(String filename)
load(String filename, - Index.SpaceType space, - int numDimensions, - Index.StorageDataType storageDataType)
load(String filename, + Index.SpaceType space, + int numDimensions, + Index.StorageDataType storageDataType)
markDeleted(long label)
markDeleted(long label)
Index.QueryResults[]
query(float[][] queryVectors, - int k, - int numThreads)
query(float[][] queryVectors, + int k, + int numThreads)
query(float[][] queryVectors, - int k, - int numThreads, - long queryEf)
query(float[][] queryVectors, + int k, + int numThreads, + long queryEf)
query(float[] queryVector, - int k)
query(float[] queryVector, + int k)
query(float[] queryVector, - int k, - long queryEf)
query(float[] queryVector, + int k, + long queryEf)
resizeIndex(long newSize)
resizeIndex(long newSize)
saveIndex(OutputStream outputStream)
saveIndex(OutputStream outputStream)
saveIndex(String pathToIndex)
saveIndex(String pathToIndex)
setEf(long ef)
setEf(long ef)
setNumThreads(int numThreads)
setNumThreads(int numThreads)
unmarkDeleted(long label)
unmarkDeleted(long label)
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Index(Index.SpaceType space, + int numDimensions)
space
public Index(Index.SpaceType space, + int numDimensions, + long indexM, + long efConstruction, + long randomSeed, + long maxElements, + Index.StorageDataType storageDataType)
indexM
storageDataType
public static Index load(String filename, + Index.SpaceType space, + int numDimensions, + Index.StorageDataType storageDataType)
filename
RuntimeException
public static Index load(String filename)
public static Index load(InputStream inputStream, + Index.SpaceType space, + int numDimensions, + Index.StorageDataType storageDataType)
inputStream
InputStream
public static Index load(InputStream inputStream)
public void close() + throws IOException
Any calls to methods after close() is called will fail, as the underlying native C++ object will have been deallocated.
close
IOException
finalize
Throwable
protected void finalize() + throws Throwable
public void setEf(long ef)
ef
public int getEf()
public Index.SpaceType getSpace()
public int getNumDimensions()
public void setNumThreads(int numThreads)
numThreads
public int getNumThreads()
public void saveIndex(String pathToIndex)
Index.load(...)
pathToIndex
public void saveIndex(OutputStream outputStream)
saveIndex
outputStream
public void addItem(float[] vector)
vector
public void addItem(float[] vector, + long id)
id
public void addItems(float[][] vectors, + int numThreads)
vectors
public void addItems(float[][] vectors, + long[] ids, + int numThreads)
ids
addItems(float[][],int)
public float[] getVector(long id)
float
public float[][] getVectors(long[] ids)
public long[] getIDs()
public Index.QueryResults query(float[] queryVector, + int k)
queryVector
k
public Index.QueryResults[] query(float[][] queryVectors, + int k, + int numThreads)
queryVectors
query(float[],int)
public Index.QueryResults query(float[] queryVector, + int k, + long queryEf)
queryEf
public Index.QueryResults[] query(float[][] queryVectors, + int k, + int numThreads, + long queryEf)
public void markDeleted(long label)
label
public void unmarkDeleted(long label)
public void resizeIndex(long newSize)
newSize
public long getMaxElements()
public long getNumElements()
public long getEfConstruction()
public long getM()
public static class StringIndex.QueryResults +extends Object
QueryResults(String[] names, - float[] distances)
getDistance(int index)
getName(int index)
String[]
getNames()
getNumResults()
QueryResults(String[] names, + float[] distances)
getDistance(int index)
getName(int index)
public QueryResults(String[] names, + float[] distances)
public String[] getNames()
public String getName(int index)
public float getDistance(int index)
public int getNumResults()
public class StringIndex +extends Object +implements Closeable
StringIndex can only accommodate up to 2^31 - 1 (2.1B) items, despite typical Voyager indices allowing up to 2^63 - 1 (9e18) items.
StringIndex.QueryResults
StringIndex(Index.SpaceType spaceType, - int numDimensions)
StringIndex(Index.SpaceType spaceType, + int numDimensions)
StringIndex(Index.SpaceType spaceType, - int numDimensions, - long indexM, - long efConstruction, - long randomSeed, - long maxElements, - Index.StorageDataType storageDataType)
StringIndex(Index.SpaceType spaceType, + int numDimensions, + long indexM, + long efConstruction, + long randomSeed, + long maxElements, + Index.StorageDataType storageDataType)
addItem(String name, - float[] vector)
addItem(String name, - List<Float> vector)
addItems(Map<String,List<Float>> vectors)
static StringIndex
load(InputStream indexInputStream, - InputStream nameListInputStream)
addItem(String name, + float[] vector)
addItem(String name, + List<Float> vector)
addItems(Map<String,List<Float>> vectors)
load(InputStream indexInputStream, + InputStream nameListInputStream)
load(InputStream indexInputStream, - InputStream nameListInputStream, - Index.SpaceType spaceType, - int numDimensions, - Index.StorageDataType storageDataType)
load(InputStream indexInputStream, + InputStream nameListInputStream, + Index.SpaceType spaceType, + int numDimensions, + Index.StorageDataType storageDataType)
load(String indexFilename, - String nameListFilename)
load(String indexFilename, + String nameListFilename)
load(String indexFilename, - String nameListFilename, - Index.SpaceType spaceType, - int numDimensions, - Index.StorageDataType storageDataType)
load(String indexFilename, + String nameListFilename, + Index.SpaceType spaceType, + int numDimensions, + Index.StorageDataType storageDataType)
query(float[] queryVector, - int numNeighbors, - int ef)
query(float[] queryVector, + int numNeighbors, + int ef)
saveIndex(OutputStream indexOutputStream, - OutputStream namesListOutputStream)
saveIndex(OutputStream indexOutputStream, + OutputStream namesListOutputStream)
saveIndex(String outputDirectory)
saveIndex(String outputDirectory)
saveIndex(String outputDirectory, - String indexFilename, - String nameListFilename)
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
saveIndex(String outputDirectory, + String indexFilename, + String nameListFilename)
public StringIndex(Index.SpaceType spaceType, + int numDimensions)
spaceType
public StringIndex(Index.SpaceType spaceType, + int numDimensions, + long indexM, + long efConstruction, + long randomSeed, + long maxElements, + Index.StorageDataType storageDataType)
public static StringIndex load(String indexFilename, + String nameListFilename, + Index.SpaceType spaceType, + int numDimensions, + Index.StorageDataType storageDataType)
indexFilename
nameListFilename
public static StringIndex load(InputStream indexInputStream, + InputStream nameListInputStream, + Index.SpaceType spaceType, + int numDimensions, + Index.StorageDataType storageDataType)
indexInputStream
nameListInputStream
public static StringIndex load(String indexFilename, + String nameListFilename)
public static StringIndex load(InputStream indexInputStream, + InputStream nameListInputStream)
public void saveIndex(String outputDirectory) + throws IOException
outputDirectory
public void saveIndex(String outputDirectory, + String indexFilename, + String nameListFilename) + throws IOException
public void saveIndex(OutputStream indexOutputStream, + OutputStream namesListOutputStream) + throws IOException
indexOutputStream
namesListOutputStream
public void addItem(String name, + float[] vector)
public void addItem(String name, + List<Float> vector)
public void addItems(Map<String,List<Float>> vectors)
public StringIndex.QueryResults query(float[] queryVector, + int numNeighbors, + int ef)
numNeighbors