Class QdrantVectorStore
java.lang.Object
org.springframework.ai.vectorstore.qdrant.QdrantVectorStore
- All Implemented Interfaces:
Consumer<List<Document>>
,DocumentWriter
,VectorStore
,org.springframework.beans.factory.InitializingBean
public class QdrantVectorStore
extends Object
implements VectorStore, org.springframework.beans.factory.InitializingBean
Qdrant vectorStore implementation. This store supports creating, updating, deleting,
and similarity searching of documents in a Qdrant collection.
- Since:
- 0.8.1
- Author:
- Anush Shetty, Christian Tzolov
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Configuration class for the QdrantVectorStore. -
Constructor Summary
ConstructorsConstructorDescriptionQdrantVectorStore
(io.qdrant.client.QdrantClient qdrantClient, String collectionName, EmbeddingClient embeddingClient) Constructs a new QdrantVectorStore.QdrantVectorStore
(QdrantVectorStore.QdrantVectorStoreConfig config, EmbeddingClient embeddingClient) Constructs a new QdrantVectorStore. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a list of documents to the vector store.void
Deletes a list of documents by their IDs.similaritySearch
(SearchRequest request) Performs a similarity search on the vector store.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.ai.vectorstore.VectorStore
accept, similaritySearch
-
Constructor Details
-
QdrantVectorStore
public QdrantVectorStore(QdrantVectorStore.QdrantVectorStoreConfig config, EmbeddingClient embeddingClient) Constructs a new QdrantVectorStore.- Parameters:
config
- The configuration for the store.embeddingClient
- The client for embedding operations.
-
QdrantVectorStore
public QdrantVectorStore(io.qdrant.client.QdrantClient qdrantClient, String collectionName, EmbeddingClient embeddingClient) Constructs a new QdrantVectorStore.- Parameters:
qdrantClient
- AQdrantClient
instance for interfacing with Qdrant.collectionName
- The name of the collection to use in Qdrant.embeddingClient
- The client for embedding operations.
-
-
Method Details
-
add
Adds a list of documents to the vector store.- Specified by:
add
in interfaceVectorStore
- Parameters:
documents
- The list of documents to be added.
-
delete
Deletes a list of documents by their IDs.- Specified by:
delete
in interfaceVectorStore
- Parameters:
documentIds
- The list of document IDs to be deleted.- Returns:
- An optional boolean indicating the deletion status.
-
similaritySearch
Performs a similarity search on the vector store.- Specified by:
similaritySearch
in interfaceVectorStore
- Parameters:
request
- TheSearchRequest
object containing the query and other search parameters.- Returns:
- A list of documents that are similar to the query.
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-