What OpenSearchVectorStore needs to reach one index of an OpenSearch cluster with the k-NN plugin.
Load it from configuration with org.llm4s.config.OpenSearchVectorStoreConfigLoader, which reads llm4s.vectorstore.opensearch, or build one in code:
val config = OpenSearchConfig("https://search.example.com:9200")
.withIndex("docs")
.withAuth(OpenSearchAuth.Basic("llm4s", password))
.withEngine(OpenSearchEngine.Faiss)
The store checks it with OpenSearchConfig#validate when it is built.
Value parameters
- auth
-
the credentials, OpenSearchAuth.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.
- efConstruction
-
the HNSW graph's
ef_construction; when unset, the engine's default - engine
-
the k-NN engine the index is created with; it decides whether filters are applied inside the kNN search (OpenSearchEngine#filtersInsideKnn)
- index
-
the index holding the vectors; OpenSearch's index-name rules apply (lower case, no
\ / * ? " < > | , #or space, not starting with-,_or+) - m
-
the HNSW graph's
m(links per node); when unset, the engine's default - numCandidates
-
the kNN query's
k, the neighbours each shard returns before the result is cut totopK. When unset:topKwith efficient filtering, andmax(100, 10 * topK)with a post-filter, so that enough candidates survive the filter. Never belowtopK, at most 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. - spaceType
-
the
knn_vectorspace 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