Struct EmbeddingSettings

Source
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 to text-embedding-3-small
  • For source huggingFace, defaults to BAAI/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 model is set to default, defaults to 617ca489d9e86b49b8167676d8220688b99db36e
  • 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 forceMean to 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 from OPENAI_API_KEY, then MEILI_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 ollama and rest, 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, ollama and `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, ollama and rest

§🔄 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, ollama and rest

§🔄 Reindexing

  • 🌱 When modified for source openAi, embeddings are never regenerated
  • 🏗️ When modified for sources ollama and rest, 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

Source§

fn clone(&self) -> EmbeddingSettings

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ComposeSchema for EmbeddingSettings

Source§

impl Debug for EmbeddingSettings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EmbeddingSettings

Source§

fn default() -> EmbeddingSettings

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for EmbeddingSettings

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<__Deserr_E> Deserr<__Deserr_E> for EmbeddingSettings
where __Deserr_E: DeserializeError,

Source§

fn deserialize_from_value<V: IntoValue>( deserr_value__: Value<V>, deserr_location__: ValuePointerRef<'_>, ) -> Result<Self, __Deserr_E>

Attempts to deserialize 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

Source§

fn from(value: EmbeddingConfig) -> Self

Converts to this type from the input type.
Source§

impl From<EmbeddingSettings> for EmbeddingConfig

Source§

fn from(value: EmbeddingSettings) -> Self

Converts to this type from the input type.
Source§

impl From<EmbeddingSettings> for SubEmbeddingSettings

Source§

fn from(value: EmbeddingSettings) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for EmbeddingSettings

Source§

fn eq(&self, other: &EmbeddingSettings) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for EmbeddingSettings

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ToSchema for EmbeddingSettings

Source§

fn name() -> Cow<'static, str>

Return name of the schema. Read more
Source§

fn schemas(schemas: &mut Vec<(String, RefOr<Schema>)>)

Implement reference utoipa::openapi::schema::Schemas for this type. Read more
Source§

impl Eq for EmbeddingSettings

Source§

impl StructuralPartialEq for EmbeddingSettings

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PartialSchema for T
where T: ComposeSchema + ?Sized,

Source§

fn schema() -> RefOr<Schema>

Return ref or schema of implementing type that can then be used to construct combined schemas.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Any for T
where T: Any,

Source§

impl<T> CloneAny for T
where T: Any + Clone,

Source§

impl<T> CloneAnySend for T
where T: Any + Send + Clone,

Source§

impl<T> CloneAnySendSync for T
where T: Any + Send + Sync + Clone,

Source§

impl<T> CloneAnySync for T
where T: Any + Sync + Clone,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> ErasedDestructor for T
where T: 'static,