pub struct ElasticsearchConfig {
pub url: String,
pub index_name: String,
pub vector_field: String,
pub content_field: String,
pub dims: usize,
pub username: Option<String>,
pub password: Option<String>,
}Expand description
Configuration for connecting to an Elasticsearch cluster.
Fields§
§url: StringElasticsearch URL (default: http://localhost:9200).
index_name: StringName of the index to store documents in.
vector_field: StringField name for storing embedding vectors (default: embedding).
content_field: StringField name for storing document content (default: content).
dims: usizeVector dimensionality (required for index creation).
username: Option<String>Optional username for basic authentication.
password: Option<String>Optional password for basic authentication.
Implementations§
Source§impl ElasticsearchConfig
impl ElasticsearchConfig
Sourcepub fn new(index_name: impl Into<String>, dims: usize) -> Self
pub fn new(index_name: impl Into<String>, dims: usize) -> Self
Create a new config with the required index name and vector dimensions.
Uses default values for URL (http://localhost:9200), vector field
(embedding), and content field (content).
Sourcepub fn with_vector_field(self, field: impl Into<String>) -> Self
pub fn with_vector_field(self, field: impl Into<String>) -> Self
Set the vector field name.
Sourcepub fn with_content_field(self, field: impl Into<String>) -> Self
pub fn with_content_field(self, field: impl Into<String>) -> Self
Set the content field name.
Trait Implementations§
Source§impl Clone for ElasticsearchConfig
impl Clone for ElasticsearchConfig
Source§fn clone(&self) -> ElasticsearchConfig
fn clone(&self) -> ElasticsearchConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ElasticsearchConfig
impl RefUnwindSafe for ElasticsearchConfig
impl Send for ElasticsearchConfig
impl Sync for ElasticsearchConfig
impl Unpin for ElasticsearchConfig
impl UnsafeUnpin for ElasticsearchConfig
impl UnwindSafe for ElasticsearchConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more