pub struct EmbeddingSettings {Show 16 fields
pub source: Setting<EmbedderSource>,
pub model: Setting<String>,
pub revision: Setting<String>,
pub pooling: Setting<OverridePooling>,
pub api_key: Setting<String>,
pub dimensions: Setting<usize>,
pub binary_quantized: Setting<bool>,
pub document_template: Setting<String>,
pub document_template_max_bytes: Setting<usize>,
pub url: Setting<String>,
pub request: Setting<Value>,
pub response: Setting<Value>,
pub headers: Setting<BTreeMap<String, String>>,
pub search_embedder: Setting<SubEmbeddingSettings>,
pub indexing_embedder: Setting<SubEmbeddingSettings>,
pub distribution: Setting<DistributionShift>,
}Fields§
§source: Setting<EmbedderSource>The source used to provide the embeddings.
Which embedder parameters are available and mandatory is determined by the value of this setting.
§🔄 Reindexing
- 🏗️ Changing the value of this parameter always regenerates embeddings.
§Defaults
- Defaults to
openAi
model: Setting<String>The name of the model to use.
§Mandatory
- This parameter is mandatory for source
ollama
§Availability
- This parameter is available for sources
openAi,huggingFace,ollama
§🔄 Reindexing
- 🏗️ Changing the value of this parameter always regenerates embeddings.
§Defaults
- For source
openAi, defaults totext-embedding-3-small - For source
huggingFace, defaults toBAAI/bge-base-en-v1.5
revision: Setting<String>The revision (commit SHA1) of the model to use.
If unspecified, Meilisearch picks the latest revision of the model.
§Availability
- This parameter is available for source
huggingFace
§🔄 Reindexing
- 🏗️ Changing the value of this parameter always regenerates embeddings
§Defaults
- When
modelis set to default, defaults to617ca489d9e86b49b8167676d8220688b99db36e - Otherwise, defaults to
null
pooling: Setting<OverridePooling>The pooling method to use.
§Availability
- This parameter is available for source
huggingFace
§🔄 Reindexing
- 🏗️ Changing the value of this parameter always regenerates embeddings
§Defaults
- Defaults to
useModel
§Compatibility Note
- Embedders created before this parameter was available default to
forceMeanto preserve the existing behavior.
api_key: Setting<String>The API key to pass to the remote embedder while making requests.
§Availability
- This parameter is available for source
openAi,ollama,rest
§🔄 Reindexing
- 🌱 Changing the value of this parameter never regenerates embeddings
§Defaults
- For source
openAi, the key is read fromOPENAI_API_KEY, thenMEILI_OPENAI_API_KEY. - For other sources, no bearer token is sent if this parameter is not set.
§Note
- This setting is partially hidden when returned by the settings
dimensions: Setting<usize>The expected dimensions of the embeddings produced by this embedder.
§Mandatory
- This parameter is mandatory for source
userProvided
§Availability
- This parameter is available for source
openAi,ollama,rest,userProvided
§🔄 Reindexing
- 🏗️ When the source is
openAi, changing the value of this parameter always regenerates embeddings - 🌱 For other sources, changing the value of this parameter never regenerates embeddings
§Defaults
- For source
openAi, the dimensions is the maximum allowed by the model. - For sources
ollamaandrest, the dimensions are inferred by embedding a sample text.
binary_quantized: Setting<bool>Whether to binary quantize the embeddings of this embedder.
Binary quantized embeddings are smaller than regular embeddings, which improves disk usage and retrieval speed, at the cost of relevancy.
§Availability
- This parameter is available for all embedders
§🔄 Reindexing
- 🏗️ When set to
true, embeddings are not regenerated, but they are binary quantized, which takes time.
§Defaults
- Defaults to
false
§Note
As binary quantization is a destructive operation, it is not possible to disable again this setting after first enabling it. If you are unsure of whether the performance-relevancy tradeoff is right for you, we recommend to use this parameter on a test index first.
document_template: Setting<String>A liquid template used to render documents to a text that can be embedded.
Meillisearch interpolates the template for each document and sends the resulting text to the embedder. The embedder then generates document vectors based on this text.
§Availability
- This parameter is available for source
openAi,huggingFace,ollamaand `rest
§🔄 Reindexing
- 🏗️ When modified, embeddings are regenerated for documents whose rendering through the template produces a different text.
document_template_max_bytes: Setting<usize>Rendered texts are truncated to this size.
§Availability
- This parameter is available for source
openAi,huggingFace,ollamaandrest
§🔄 Reindexing
- 🏗️ When increased, embeddings are regenerated for documents whose rendering through the template produces a different text.
- 🌱 When decreased, embeddings are never regenerated
§Default
- Defaults to 400
url: Setting<String>URL to reach the remote embedder.
§Mandatory
- This parameter is mandatory for source
rest
§Availability
- This parameter is available for source
openAi,ollamaandrest
§🔄 Reindexing
- 🌱 When modified for source
openAi, embeddings are never regenerated - 🏗️ When modified for sources
ollamaandrest, embeddings are always regenerated
request: Setting<Value>Template request to send to the remote embedder.
§Mandatory
- This parameter is mandatory for source
rest
§Availability
- This parameter is available for source
rest
§🔄 Reindexing
- 🏗️ Changing the value of this parameter always regenerates embeddings
response: Setting<Value>Template response indicating how to find the embeddings in the response from the remote embedder.
§Mandatory
- This parameter is mandatory for source
rest
§Availability
- This parameter is available for source
rest
§🔄 Reindexing
- 🏗️ Changing the value of this parameter always regenerates embeddings
headers: Setting<BTreeMap<String, String>>Additional headers to send to the remote embedder.
§Availability
- This parameter is available for source
rest
§🔄 Reindexing
- 🌱 Changing the value of this parameter never regenerates embeddings
search_embedder: Setting<SubEmbeddingSettings>§indexing_embedder: Setting<SubEmbeddingSettings>§distribution: Setting<DistributionShift>Affine transformation applied to the semantic score to make it more comparable to the ranking score.
§Availability
- This parameter is available for all embedders
§🔄 Reindexing
- 🌱 Changing the value of this parameter never regenerates embeddings
Trait Implementations§
Source§impl Clone for EmbeddingSettings
impl Clone for EmbeddingSettings
Source§fn clone(&self) -> EmbeddingSettings
fn clone(&self) -> EmbeddingSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ComposeSchema for EmbeddingSettings
impl ComposeSchema for EmbeddingSettings
Source§impl Debug for EmbeddingSettings
impl Debug for EmbeddingSettings
Source§impl Default for EmbeddingSettings
impl Default for EmbeddingSettings
Source§fn default() -> EmbeddingSettings
fn default() -> EmbeddingSettings
Source§impl<'de> Deserialize<'de> for EmbeddingSettings
impl<'de> Deserialize<'de> for EmbeddingSettings
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<__Deserr_E> Deserr<__Deserr_E> for EmbeddingSettingswhere
__Deserr_E: DeserializeError,
impl<__Deserr_E> Deserr<__Deserr_E> for EmbeddingSettingswhere
__Deserr_E: DeserializeError,
Source§fn deserialize_from_value<V: IntoValue>(
deserr_value__: Value<V>,
deserr_location__: ValuePointerRef<'_>,
) -> Result<Self, __Deserr_E>
fn deserialize_from_value<V: IntoValue>( deserr_value__: Value<V>, deserr_location__: ValuePointerRef<'_>, ) -> Result<Self, __Deserr_E>
Self from the given value. Note that this method is an
implementation detail. You probably want to use the deserialize function directly instead.Source§impl From<EmbeddingConfig> for EmbeddingSettings
impl From<EmbeddingConfig> for EmbeddingSettings
Source§fn from(value: EmbeddingConfig) -> Self
fn from(value: EmbeddingConfig) -> Self
Source§impl From<EmbeddingSettings> for EmbeddingConfig
impl From<EmbeddingSettings> for EmbeddingConfig
Source§fn from(value: EmbeddingSettings) -> Self
fn from(value: EmbeddingSettings) -> Self
Source§impl From<EmbeddingSettings> for SubEmbeddingSettings
impl From<EmbeddingSettings> for SubEmbeddingSettings
Source§fn from(value: EmbeddingSettings) -> Self
fn from(value: EmbeddingSettings) -> Self
Source§impl PartialEq for EmbeddingSettings
impl PartialEq for EmbeddingSettings
Source§impl Serialize for EmbeddingSettings
impl Serialize for EmbeddingSettings
Source§impl ToSchema for EmbeddingSettings
impl ToSchema for EmbeddingSettings
impl Eq for EmbeddingSettings
impl StructuralPartialEq for EmbeddingSettings
Auto Trait Implementations§
impl Freeze for EmbeddingSettings
impl RefUnwindSafe for EmbeddingSettings
impl Send for EmbeddingSettings
impl Sync for EmbeddingSettings
impl Unpin for EmbeddingSettings
impl UnwindSafe for EmbeddingSettings
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more