Class ElasticsearchVectorStore.Builder
java.lang.Object
org.springframework.ai.vectorstore.AbstractVectorStoreBuilder<ElasticsearchVectorStore.Builder>
org.springframework.ai.vectorstore.elasticsearch.ElasticsearchVectorStore.Builder
- All Implemented Interfaces:
VectorStore.Builder<ElasticsearchVectorStore.Builder>
- Enclosing class:
- ElasticsearchVectorStore
public static class ElasticsearchVectorStore.Builder
extends AbstractVectorStoreBuilder<ElasticsearchVectorStore.Builder>
-
Field Summary
Fields inherited from class org.springframework.ai.vectorstore.AbstractVectorStoreBuilder
batchingStrategy, customObservationConvention, embeddingModel, observationRegistry
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder
(org.elasticsearch.client.RestClient restClient, EmbeddingModel embeddingModel) Sets the Elasticsearch REST client. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the ElasticsearchVectorStore instance.Sets the filter expression converter.initializeSchema
(boolean initializeSchema) Sets whether to initialize the schema.options
(ElasticsearchVectorStoreOptions options) Sets the Elasticsearch vector store options.Methods inherited from class org.springframework.ai.vectorstore.AbstractVectorStoreBuilder
batchingStrategy, customObservationConvention, getBatchingStrategy, getCustomObservationConvention, getEmbeddingModel, getObservationRegistry, observationRegistry, self
-
Constructor Details
-
Builder
Sets the Elasticsearch REST client.- Parameters:
restClient
- the Elasticsearch REST clientembeddingModel
- the Embedding Model to be used
-
-
Method Details
-
options
Sets the Elasticsearch vector store options.- Parameters:
options
- the vector store options to use- Returns:
- the builder instance
- Throws:
IllegalArgumentException
- if options is null
-
initializeSchema
Sets whether to initialize the schema.- Parameters:
initializeSchema
- true to initialize schema, false otherwise- Returns:
- the builder instance
-
filterExpressionConverter
public ElasticsearchVectorStore.Builder filterExpressionConverter(FilterExpressionConverter converter) Sets the filter expression converter.- Parameters:
converter
- the filter expression converter to use- Returns:
- the builder instance
- Throws:
IllegalArgumentException
- if converter is null
-
build
Builds the ElasticsearchVectorStore instance.- Returns:
- a new ElasticsearchVectorStore instance
- Throws:
IllegalStateException
- if the builder is in an invalid state
-