ElasticsearchConfig

org.llm4s.vectorstore.elasticsearch.ElasticsearchConfig
See theElasticsearchConfig companion object
final case class ElasticsearchConfig

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 https when credentials are sent; plain http is 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_vector similarity the index is created with

timeout

how long each HTTP request may take

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Checks the config; the first problem is reported, naming the setting.

Checks the config; the first problem is reported, naming the setting.

Attributes

def withBaseUrl(baseUrl: String): ElasticsearchConfig
def withDimensions(dimensions: Int): ElasticsearchConfig
def withDimensions(dimensions: Option[Int]): ElasticsearchConfig
def withIndex(index: String): ElasticsearchConfig
def withNumCandidates(numCandidates: Int): ElasticsearchConfig
def withNumCandidates(numCandidates: Option[Int]): ElasticsearchConfig
def withRefreshOnWrite(refreshOnWrite: Boolean): ElasticsearchConfig
def withTimeout(timeout: FiniteDuration): ElasticsearchConfig

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product