4889: When `retrieveVectors` is true, retrieve `_vectors.embedder` even if … r=Kerollmops a=dureuill

…there are no vector for that embedder


backports a bug fix from v1.10.0: 82647bcded

Co-authored-by: Louis Dureuil <louis@meilisearch.com>
This commit is contained in:
meili-bors[bot] 2024-08-27 15:14:58 +00:00 committed by GitHub
commit 9fff081043
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 56 additions and 40 deletions

View File

@ -1,4 +1,6 @@
name: Look for flaky tests name: Look for flaky tests
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
on: on:
workflow_dispatch: workflow_dispatch:
schedule: schedule:

View File

@ -1,5 +1,6 @@
name: Run the indexing fuzzer name: Run the indexing fuzzer
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
on: on:
push: push:
branches: branches:

View File

@ -15,6 +15,8 @@ jobs:
debian: debian:
name: Publish debian packagge name: Publish debian packagge
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: check-version needs: check-version
container: container:

View File

@ -35,6 +35,8 @@ jobs:
publish-linux: publish-linux:
name: Publish binary for Linux name: Publish binary for Linux
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
needs: check-version needs: check-version
container: container:
# Use ubuntu-18.04 to compile with glibc 2.27 # Use ubuntu-18.04 to compile with glibc 2.27
@ -132,6 +134,8 @@ jobs:
name: Publish binary for aarch64 name: Publish binary for aarch64
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: check-version needs: check-version
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
container: container:
# Use ubuntu-18.04 to compile with glibc 2.27 # Use ubuntu-18.04 to compile with glibc 2.27
image: ubuntu:18.04 image: ubuntu:18.04

View File

@ -21,6 +21,8 @@ jobs:
test-linux: test-linux:
name: Tests on ubuntu-18.04 name: Tests on ubuntu-18.04
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
container: container:
# Use ubuntu-18.04 to compile with glibc 2.27, which are the production expectations # Use ubuntu-18.04 to compile with glibc 2.27, which are the production expectations
image: ubuntu:18.04 image: ubuntu:18.04
@ -77,6 +79,8 @@ jobs:
test-all-features: test-all-features:
name: Tests almost all features name: Tests almost all features
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
container: container:
# Use ubuntu-18.04 to compile with glibc 2.27, which are the production expectations # Use ubuntu-18.04 to compile with glibc 2.27, which are the production expectations
image: ubuntu:18.04 image: ubuntu:18.04
@ -100,6 +104,8 @@ jobs:
test-disabled-tokenization: test-disabled-tokenization:
name: Test disabled tokenization name: Test disabled tokenization
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: ubuntu:18.04 image: ubuntu:18.04
@ -127,6 +133,8 @@ jobs:
# We run tests in debug also, to make sure that the debug_assertions are hit # We run tests in debug also, to make sure that the debug_assertions are hit
test-debug: test-debug:
name: Run tests in debug name: Run tests in debug
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
# Use ubuntu-18.04 to compile with glibc 2.27, which are the production expectations # Use ubuntu-18.04 to compile with glibc 2.27, which are the production expectations

8
Cargo.lock generated
View File

@ -5098,9 +5098,9 @@ dependencies = [
[[package]] [[package]]
name = "time" name = "time"
version = "0.3.34" version = "0.3.36"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
dependencies = [ dependencies = [
"deranged", "deranged",
"itoa", "itoa",
@ -5121,9 +5121,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
[[package]] [[package]]
name = "time-macros" name = "time-macros"
version = "0.2.17" version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
dependencies = [ dependencies = [
"num-conv", "num-conv",
"time-core", "time-core",

View File

@ -644,7 +644,12 @@ async fn get_document_with_vectors() {
{ {
"id": 1, "id": 1,
"name": "echo", "name": "echo",
"_vectors": {} "_vectors": {
"manual": {
"embeddings": [],
"regenerate": false
}
}
} }
], ],
"offset": 0, "offset": 0,
@ -700,7 +705,12 @@ async fn get_document_with_vectors() {
}, },
{ {
"name": "echo", "name": "echo",
"_vectors": {} "_vectors": {
"manual": {
"embeddings": [],
"regenerate": false
}
}
} }
], ],
"offset": 0, "offset": 0,

View File

@ -119,7 +119,12 @@ async fn add_remove_user_provided() {
{ {
"id": 1, "id": 1,
"name": "echo", "name": "echo",
"_vectors": {} "_vectors": {
"manual": {
"embeddings": [],
"regenerate": false
}
}
} }
], ],
"offset": 0, "offset": 0,
@ -141,7 +146,12 @@ async fn add_remove_user_provided() {
{ {
"id": 1, "id": 1,
"name": "echo", "name": "echo",
"_vectors": {} "_vectors": {
"manual": {
"embeddings": [],
"regenerate": false
}
}
} }
], ],
"offset": 0, "offset": 0,
@ -577,7 +587,12 @@ async fn add_remove_one_vector_4588() {
{ {
"id": 0, "id": 0,
"name": "kefir", "name": "kefir",
"_vectors": {} "_vectors": {
"manual": {
"embeddings": [],
"regenerate": false
}
}
} }
], ],
"offset": 0, "offset": 0,

View File

@ -141,3 +141,6 @@ swedish-recomposition = ["charabia/swedish-recomposition"]
# allow CUDA support, see <https://github.com/meilisearch/meilisearch/issues/4306> # allow CUDA support, see <https://github.com/meilisearch/meilisearch/issues/4306>
cuda = ["candle-core/cuda"] cuda = ["candle-core/cuda"]
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] }

View File

@ -1660,9 +1660,7 @@ impl Index {
} }
} }
if !embeddings.is_empty() { res.insert(embedder_name.to_owned(), embeddings);
res.insert(embedder_name.to_owned(), embeddings);
}
} }
Ok(res) Ok(res)
} }

View File

@ -2180,33 +2180,6 @@ mod tests {
index.add_documents(doc1).unwrap(); index.add_documents(doc1).unwrap();
} }
#[cfg(feature = "default")]
#[test]
fn store_detected_script_and_language_per_document_during_indexing() {
use charabia::{Language, Script};
let index = TempIndex::new();
index
.add_documents(documents!([
{ "id": 1, "title": "The quick (\"brown\") fox can't jump 32.3 feet, right? Brr, it's 29.3°F!" },
{ "id": 2, "title": "人人生而自由﹐在尊嚴和權利上一律平等。他們賦有理性和良心﹐並應以兄弟關係的精神互相對待。" },
{ "id": 3, "title": "הַשּׁוּעָל הַמָּהִיר (״הַחוּם״) לֹא יָכוֹל לִקְפֹּץ 9.94 מֶטְרִים, נָכוֹן? ברר, 1.5°C- בַּחוּץ!" },
{ "id": 4, "title": "関西国際空港限定トートバッグ すもももももももものうち" },
{ "id": 5, "title": "ภาษาไทยง่ายนิดเดียว" },
{ "id": 6, "title": "The quick 在尊嚴和權利上一律平等。" },
]))
.unwrap();
let rtxn = index.read_txn().unwrap();
let key_jpn = (Script::Cj, Language::Jpn);
let key_cmn = (Script::Cj, Language::Cmn);
let cj_jpn_docs = index.script_language_documents_ids(&rtxn, &key_jpn).unwrap().unwrap();
let cj_cmn_docs = index.script_language_documents_ids(&rtxn, &key_cmn).unwrap().unwrap();
let expected_cj_jpn_docids = [3].iter().collect();
assert_eq!(cj_jpn_docs, expected_cj_jpn_docids);
let expected_cj_cmn_docids = [1, 5].iter().collect();
assert_eq!(cj_cmn_docs, expected_cj_cmn_docids);
}
#[test] #[test]
fn add_and_delete_documents_in_single_transform() { fn add_and_delete_documents_in_single_transform() {
let mut index = TempIndex::new(); let mut index = TempIndex::new();