What ElasticsearchVectorStore needs to reach one index of an Elasticsearch cluster.
Load it from configuration with org.llm4s.config.ElasticsearchVectorStoreConfigLoader, which reads llm4s.vectorstore.elasticsearch, or build one in code:
val config = ElasticsearchConfig("https://es.example.com:9200")
.withIndex("docs")
.withAuth(ElasticsearchAuth.ApiKey(encodedKey))
The store checks it with ElasticsearchConfig#validate when it is built.
Value parameters
- auth
-
the credentials, ElasticsearchAuth.NoAuth by default
- baseUrl
-
the cluster's root URL, optionally with a path prefix (a proxy), without a query. It must be
httpswhen credentials are sent; plainhttpis accepted for a loopback host (localhost,127.0.0.0/8,::1) or when there are no credentials to protect. - dimensions
-
the vector size the index is created with; when unset, the size of the first record upserted. When set, a record of another size is refused before it is sent.
- index
-
the index holding the vectors; Elasticsearch's index-name rules apply (lower case, no
\ / * ? " < > | , #or space, not starting with-,_or+) - numCandidates
-
kNN
num_candidates, the candidates each shard considers; when unset,max(100, 10 * topK)capped at 10,000 - refreshOnWrite
-
whether writes wait for a refresh (
refresh=wait_for), so that a search straight after an upsert or delete sees it. Turn it off for bulk ingestion. - similarity
-
the
dense_vectorsimilarity the index is created with - timeout
-
how long each HTTP request may take
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any