mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Merge fa3990daf9
into fef089c7b6
This commit is contained in:
commit
47bfdc65c7
4 changed files with 2259 additions and 2 deletions
|
@ -35,7 +35,7 @@ pub struct Server<State = Owned> {
|
|||
pub static TEST_TEMP_DIR: Lazy<TempDir> = Lazy::new(|| TempDir::new().unwrap());
|
||||
|
||||
impl Server<Owned> {
|
||||
fn into_shared(self) -> Server<Shared> {
|
||||
pub fn into_shared(self) -> Server<Shared> {
|
||||
Server { service: self.service, _dir: self._dir, _marker: PhantomData }
|
||||
}
|
||||
|
||||
|
@ -327,7 +327,7 @@ impl<State> Server<State> {
|
|||
self.service.get(url).await
|
||||
}
|
||||
|
||||
pub(super) fn _index(&self, uid: impl AsRef<str>) -> Index<'_> {
|
||||
pub fn _index(&self, uid: impl AsRef<str>) -> Index<'_> {
|
||||
Index {
|
||||
uid: uid.as_ref().to_string(),
|
||||
service: &self.service,
|
||||
|
|
2248
crates/meilisearch/tests/vector/fragments.rs
Normal file
2248
crates/meilisearch/tests/vector/fragments.rs
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,5 @@
|
|||
mod binary_quantized;
|
||||
mod fragments;
|
||||
#[cfg(feature = "test-ollama")]
|
||||
mod ollama;
|
||||
mod openai;
|
||||
|
|
|
@ -101,6 +101,10 @@ impl<T> Setting<T> {
|
|||
matches!(self, Self::NotSet)
|
||||
}
|
||||
|
||||
pub const fn is_reset(&self) -> bool {
|
||||
matches!(self, Self::Reset)
|
||||
}
|
||||
|
||||
/// If `Self` is `Reset`, then map self to `Set` with the provided `val`.
|
||||
pub fn or_reset(self, val: T) -> Self {
|
||||
match self {
|
||||
|
@ -1213,6 +1217,10 @@ impl<'a, 't, 'i> Settings<'a, 't, 'i> {
|
|||
// new config
|
||||
EitherOrBoth::Right((name, mut setting)) => {
|
||||
tracing::debug!(embedder = name, "new embedder");
|
||||
// if we are asked to reset an embedder that doesn't exist, just ignore it
|
||||
if setting.is_reset() {
|
||||
continue;
|
||||
}
|
||||
// apply the default source in case the source was not set so that it gets validated
|
||||
crate::vector::settings::EmbeddingSettings::apply_default_source(&mut setting);
|
||||
crate::vector::settings::EmbeddingSettings::apply_default_openai_model(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue