Enum Class PgVectorStore.PgIndexType
java.lang.Object
java.lang.Enum<PgVectorStore.PgIndexType>
org.springframework.ai.vectorstore.PgVectorStore.PgIndexType
- All Implemented Interfaces:
Serializable
,Comparable<PgVectorStore.PgIndexType>
,Constable
- Enclosing class:
PgVectorStore
By default, pgvector performs exact nearest neighbor search, which provides perfect
recall. You can add an index to use approximate nearest neighbor search, which
trades some recall for speed. Unlike typical indexes, you will see different
results for queries after adding an approximate index.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic PgVectorStore.PgIndexType
Returns the enum constant of this class with the specified name.static PgVectorStore.PgIndexType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
Performs exact nearest neighbor search, which provides perfect recall. -
IVFFLAT
An IVFFlat index divides vectors into lists, and then searches a subset of those lists that are closest to the query vector. It has faster build times and uses less memory than HNSW, but has lower query performance (in terms of speed-recall tradeoff). -
HNSW
An HNSW index creates a multilayer graph. It has slower build times and uses more memory than IVFFlat, but has better query performance (in terms of speed-recall tradeoff). There’s no training step like IVFFlat, so the index can be created without any data in the table.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-