Fix tests

This commit is contained in:
Louis Dureuil 2025-01-13 13:10:31 +01:00
parent 73d3d286d9
commit c32bec338f
No known key found for this signature in database
13 changed files with 18 additions and 887 deletions

View File

@ -760,15 +760,6 @@ async fn retrieve_vectors() {
"link": "https://docs.meilisearch.com/errors#invalid_document_retrieve_vectors"
}
"###);
let (response, _code) = index.get_all_documents_raw("?retrieveVectors=true").await;
snapshot!(response, @r###"
{
"message": "Passing `retrieveVectors` as a parameter requires enabling the `vector store` experimental feature. See https://github.com/meilisearch/product/discussions/677",
"code": "feature_not_enabled",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#feature_not_enabled"
}
"###);
// FETCHALL DOCUMENTS BY POST
let (response, _code) =
@ -781,15 +772,6 @@ async fn retrieve_vectors() {
"link": "https://docs.meilisearch.com/errors#invalid_document_retrieve_vectors"
}
"###);
let (response, _code) = index.get_document_by_filter(json!({ "retrieveVectors": true })).await;
snapshot!(response, @r###"
{
"message": "Passing `retrieveVectors` as a parameter requires enabling the `vector store` experimental feature. See https://github.com/meilisearch/product/discussions/677",
"code": "feature_not_enabled",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#feature_not_enabled"
}
"###);
// GET A SINGLEDOCUMENT
let (response, _code) = index.get_document(0, Some(json!({"retrieveVectors": "tamo"}))).await;
@ -801,13 +783,4 @@ async fn retrieve_vectors() {
"link": "https://docs.meilisearch.com/errors#invalid_document_retrieve_vectors"
}
"###);
let (response, _code) = index.get_document(0, Some(json!({"retrieveVectors": true}))).await;
snapshot!(response, @r###"
{
"message": "Passing `retrieveVectors` as a parameter requires enabling the `vector store` experimental feature. See https://github.com/meilisearch/product/discussions/677",
"code": "feature_not_enabled",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#feature_not_enabled"
}
"###);
}

View File

@ -518,17 +518,6 @@ async fn get_document_by_filter() {
async fn get_document_with_vectors() {
let server = Server::new().await;
let index = server.index("doggo");
let (value, code) = server.set_features(json!({"vectorStore": true})).await;
snapshot!(code, @"200 OK");
snapshot!(value, @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
let (response, code) = index
.update_settings(json!({

View File

@ -1893,7 +1893,6 @@ async fn import_dump_v6_containing_experimental_features() {
meili_snap::snapshot!(code, @"200 OK");
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
{
"vectorStore": false,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
@ -1988,16 +1987,7 @@ async fn generate_and_import_dump_containing_vectors() {
let temp = tempfile::tempdir().unwrap();
let mut opt = default_settings(temp.path());
let server = Server::new_with_options(opt.clone()).await.unwrap();
let (code, _) = server.set_features(json!({"vectorStore": true})).await;
snapshot!(code, @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
let index = server.index("pets");
let (response, code) = index
.update_settings(json!(
@ -2063,7 +2053,6 @@ async fn generate_and_import_dump_containing_vectors() {
meili_snap::snapshot!(code, @"200 OK");
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,

View File

@ -7,7 +7,7 @@ use crate::json;
/// Feature name to test against.
/// This will have to be changed by a different one when that feature is stabilized.
/// All tests that need to set a feature can make use of this constant.
const FEATURE_NAME: &str = "vectorStore";
const FEATURE_NAME: &str = "metrics";
#[actix_rt::test]
async fn experimental_features() {
@ -18,7 +18,6 @@ async fn experimental_features() {
meili_snap::snapshot!(code, @"200 OK");
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
{
"vectorStore": false,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
@ -32,7 +31,7 @@ async fn experimental_features() {
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
{
"vectorStore": true,
"metrics": false,
"metrics": true,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
@ -44,8 +43,7 @@ async fn experimental_features() {
meili_snap::snapshot!(code, @"200 OK");
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
{
"vectorStore": true,
"metrics": false,
"metrics": true,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
@ -59,7 +57,7 @@ async fn experimental_features() {
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
{
"vectorStore": true,
"metrics": false,
"metrics": true,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
@ -73,7 +71,7 @@ async fn experimental_features() {
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
{
"vectorStore": true,
"metrics": false,
"metrics": true,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
@ -93,7 +91,6 @@ async fn experimental_feature_metrics() {
meili_snap::snapshot!(code, @"200 OK");
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
{
"vectorStore": false,
"metrics": true,
"logsRoute": false,
"editDocumentsByFunction": false,
@ -152,7 +149,7 @@ async fn errors() {
meili_snap::snapshot!(code, @"400 Bad Request");
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
{
"message": "Unknown field `NotAFeature`: expected one of `vectorStore`, `metrics`, `logsRoute`, `editDocumentsByFunction`, `containsFilter`",
"message": "Unknown field `NotAFeature`: expected one of `metrics`, `logsRoute`, `editDocumentsByFunction`, `containsFilter`",
"code": "bad_request",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#bad_request"
@ -165,7 +162,7 @@ async fn errors() {
meili_snap::snapshot!(code, @"400 Bad Request");
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
{
"message": "Invalid value type at `.vectorStore`: expected a boolean, but found a positive integer: `42`",
"message": "Invalid value type at `.metrics`: expected a boolean, but found a positive integer: `42`",
"code": "bad_request",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#bad_request"
@ -178,7 +175,7 @@ async fn errors() {
meili_snap::snapshot!(code, @"400 Bad Request");
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
{
"message": "Invalid value type at `.vectorStore`: expected a boolean, but found a string: `\"true\"`",
"message": "Invalid value type at `.metrics`: expected a boolean, but found a string: `\"true\"`",
"code": "bad_request",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#bad_request"

View File

@ -11,19 +11,6 @@ async fn index_with_documents_user_provided<'a>(
) -> Index<'a> {
let index = server.index("test");
let (response, code) = server.set_features(json!({"vectorStore": true})).await;
meili_snap::snapshot!(code, @"200 OK");
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
let (response, code) = index
.update_settings(json!({ "embedders": {"default": {
"source": "userProvided",
@ -41,19 +28,6 @@ async fn index_with_documents_user_provided<'a>(
async fn index_with_documents_hf<'a>(server: &'a Server, documents: &Value) -> Index<'a> {
let index = server.index("test");
let (response, code) = server.set_features(json!({"vectorStore": true})).await;
meili_snap::snapshot!(code, @"200 OK");
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
let (response, code) = index
.update_settings(json!({ "embedders": {"default": {
"source": "huggingFace",

View File

@ -818,13 +818,6 @@ async fn test_score_details() {
"green",
"red"
],
"_vectors": {
"manual": [
-100,
231,
32
]
},
"_rankingScoreDetails": {
"words": {
"order": 0,
@ -1159,206 +1152,6 @@ async fn test_degraded_score_details() {
.await;
}
#[actix_rt::test]
async fn experimental_feature_vector_store() {
let server = Server::new().await;
let index = server.index("test");
let documents = DOCUMENTS.clone();
let (task, _status_code) = index.add_documents(json!(documents), None).await;
index.wait_task(task.uid()).await.succeeded();
let (response, code) = index
.search_post(json!({
"vector": [1.0, 2.0, 3.0],
"hybrid": {
"embedder": "manual",
},
"showRankingScore": true
}))
.await;
{
meili_snap::snapshot!(code, @"400 Bad Request");
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
{
"message": "Passing `vector` as a parameter requires enabling the `vector store` experimental feature. See https://github.com/meilisearch/product/discussions/677",
"code": "feature_not_enabled",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#feature_not_enabled"
}
"###);
}
index
.search(json!({
"retrieveVectors": true,
"showRankingScore": true
}), |response, code|{
meili_snap::snapshot!(code, @"400 Bad Request");
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
{
"message": "Passing `retrieveVectors` as a parameter requires enabling the `vector store` experimental feature. See https://github.com/meilisearch/product/discussions/677",
"code": "feature_not_enabled",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#feature_not_enabled"
}
"###);
})
.await;
let (response, code) = server.set_features(json!({"vectorStore": true})).await;
meili_snap::snapshot!(code, @"200 OK");
meili_snap::snapshot!(response["vectorStore"], @"true");
let (response, code) = index
.update_settings(json!({"embedders": {
"manual": {
"source": "userProvided",
"dimensions": 3,
}
}}))
.await;
meili_snap::snapshot!(response, @r###"
{
"taskUid": 1,
"indexUid": "test",
"status": "enqueued",
"type": "settingsUpdate",
"enqueuedAt": "[date]"
}
"###);
meili_snap::snapshot!(code, @"202 Accepted");
let response = index.wait_task(response.uid()).await;
meili_snap::snapshot!(meili_snap::json_string!(response["status"]), @"\"succeeded\"");
let (response, code) = index
.search_post(json!({
"vector": [1.0, 2.0, 3.0],
"hybrid": {
"embedder": "manual",
},
"showRankingScore": true,
"retrieveVectors": true,
}))
.await;
meili_snap::snapshot!(code, @"200 OK");
// vector search returns all documents that don't have vectors in the last bucket, like all sorts
meili_snap::snapshot!(meili_snap::json_string!(response["hits"]), @r###"
[
{
"title": "Shazam!",
"id": "287947",
"color": [
"green",
"blue"
],
"_vectors": {
"manual": {
"embeddings": [
[
1.0,
2.0,
3.0
]
],
"regenerate": false
}
},
"_rankingScore": 1.0
},
{
"title": "Captain Marvel",
"id": "299537",
"color": [
"yellow",
"blue"
],
"_vectors": {
"manual": {
"embeddings": [
[
1.0,
2.0,
54.0
]
],
"regenerate": false
}
},
"_rankingScore": 0.9129111766815186
},
{
"title": "Gläss",
"id": "450465",
"color": [
"blue",
"red"
],
"_vectors": {
"manual": {
"embeddings": [
[
-100.0,
340.0,
90.0
]
],
"regenerate": false
}
},
"_rankingScore": 0.8106412887573242
},
{
"title": "How to Train Your Dragon: The Hidden World",
"id": "166428",
"color": [
"green",
"red"
],
"_vectors": {
"manual": {
"embeddings": [
[
-100.0,
231.0,
32.0
]
],
"regenerate": false
}
},
"_rankingScore": 0.7412010431289673
},
{
"title": "Escape Room",
"id": "522681",
"color": [
"yellow",
"red"
],
"_vectors": {
"manual": {
"embeddings": [
[
10.0,
-23.0,
32.0
]
],
"regenerate": false
}
},
"_rankingScore": 0.6972063183784485
}
]
"###);
}
#[cfg(feature = "default")]
#[actix_rt::test]
async fn camelcased_words() {
@ -1611,15 +1404,8 @@ async fn simple_search_with_strange_synonyms() {
"color": [
"green",
"red"
],
"_vectors": {
"manual": [
-100,
231,
32
]
}
}
]
"###);
})
@ -1636,15 +1422,8 @@ async fn simple_search_with_strange_synonyms() {
"color": [
"green",
"red"
],
"_vectors": {
"manual": [
-100,
231,
32
]
}
}
]
"###);
})
@ -1661,15 +1440,8 @@ async fn simple_search_with_strange_synonyms() {
"color": [
"green",
"red"
],
"_vectors": {
"manual": [
-100,
231,
32
]
}
}
]
"###);
})

View File

@ -110,15 +110,8 @@ async fn simple_search_single_index() {
"color": [
"blue",
"red"
],
"_vectors": {
"manual": [
-100,
340,
90
]
}
}
],
"query": "glass",
"processingTimeMs": "[time]",
@ -135,15 +128,8 @@ async fn simple_search_single_index() {
"color": [
"yellow",
"blue"
],
"_vectors": {
"manual": [
1,
2,
54
]
}
}
],
"query": "captain",
"processingTimeMs": "[time]",
@ -180,13 +166,6 @@ async fn federation_single_search_single_index() {
"blue",
"red"
],
"_vectors": {
"manual": [
-100,
340,
90
]
},
"_federation": {
"indexUid": "test",
"queriesPosition": 0,
@ -303,13 +282,6 @@ async fn federation_two_search_single_index() {
"blue",
"red"
],
"_vectors": {
"manual": [
-100,
340,
90
]
},
"_federation": {
"indexUid": "test",
"queriesPosition": 0,
@ -323,13 +295,6 @@ async fn federation_two_search_single_index() {
"yellow",
"blue"
],
"_vectors": {
"manual": [
1,
2,
54
]
},
"_federation": {
"indexUid": "test",
"queriesPosition": 1,
@ -477,15 +442,8 @@ async fn simple_search_two_indexes() {
"color": [
"blue",
"red"
],
"_vectors": {
"manual": [
-100,
340,
90
]
}
}
],
"query": "glass",
"processingTimeMs": "[time]",
@ -510,14 +468,7 @@ async fn simple_search_two_indexes() {
"age": 4
}
],
"cattos": "pésti",
"_vectors": {
"manual": [
1,
2,
3
]
}
"cattos": "pésti"
},
{
"id": 654,
@ -532,15 +483,8 @@ async fn simple_search_two_indexes() {
"cattos": [
"simba",
"pestiféré"
],
"_vectors": {
"manual": [
1,
2,
54
]
}
}
],
"query": "pésti",
"processingTimeMs": "[time]",
@ -583,13 +527,6 @@ async fn federation_two_search_two_indexes() {
"blue",
"red"
],
"_vectors": {
"manual": [
-100,
340,
90
]
},
"_federation": {
"indexUid": "test",
"queriesPosition": 0,
@ -611,13 +548,6 @@ async fn federation_two_search_two_indexes() {
}
],
"cattos": "pésti",
"_vectors": {
"manual": [
1,
2,
3
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 1,
@ -638,13 +568,6 @@ async fn federation_two_search_two_indexes() {
"simba",
"pestiféré"
],
"_vectors": {
"manual": [
1,
2,
54
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 1,
@ -705,13 +628,6 @@ async fn federation_multiple_search_multiple_indexes() {
"blue",
"red"
],
"_vectors": {
"manual": [
-100,
340,
90
]
},
"_federation": {
"indexUid": "test",
"queriesPosition": 0,
@ -733,13 +649,6 @@ async fn federation_multiple_search_multiple_indexes() {
}
],
"cattos": "pésti",
"_vectors": {
"manual": [
1,
2,
3
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 2,
@ -771,13 +680,6 @@ async fn federation_multiple_search_multiple_indexes() {
"yellow",
"blue"
],
"_vectors": {
"manual": [
1,
2,
54
]
},
"_federation": {
"indexUid": "test",
"queriesPosition": 1,
@ -791,13 +693,6 @@ async fn federation_multiple_search_multiple_indexes() {
"yellow",
"red"
],
"_vectors": {
"manual": [
10,
-23,
32
]
},
"_federation": {
"indexUid": "test",
"queriesPosition": 3,
@ -822,13 +717,6 @@ async fn federation_multiple_search_multiple_indexes() {
"moumoute",
"gomez"
],
"_vectors": {
"manual": [
10,
23,
32
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 4,
@ -867,13 +755,6 @@ async fn federation_multiple_search_multiple_indexes() {
"simba",
"pestiféré"
],
"_vectors": {
"manual": [
1,
2,
54
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 2,
@ -896,13 +777,6 @@ async fn federation_multiple_search_multiple_indexes() {
"green",
"red"
],
"_vectors": {
"manual": [
-100,
231,
32
]
},
"_federation": {
"indexUid": "test",
"queriesPosition": 6,
@ -1391,13 +1265,6 @@ async fn federation_sort_same_indexes_same_criterion_same_direction() {
}
],
"cattos": "pésti",
"_vectors": {
"manual": [
1,
2,
3
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 0,
@ -1412,13 +1279,6 @@ async fn federation_sort_same_indexes_same_criterion_same_direction() {
"cattos": [
"enigma"
],
"_vectors": {
"manual": [
10,
23,
32
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 0,
@ -1440,13 +1300,6 @@ async fn federation_sort_same_indexes_same_criterion_same_direction() {
"simba",
"pestiféré"
],
"_vectors": {
"manual": [
1,
2,
54
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 0,
@ -1472,13 +1325,6 @@ async fn federation_sort_same_indexes_same_criterion_same_direction() {
"moumoute",
"gomez"
],
"_vectors": {
"manual": [
10,
23,
32
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 0,
@ -1520,13 +1366,6 @@ async fn federation_sort_same_indexes_same_criterion_same_direction() {
}
],
"cattos": "pésti",
"_vectors": {
"manual": [
1,
2,
3
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 0,
@ -1548,13 +1387,6 @@ async fn federation_sort_same_indexes_same_criterion_same_direction() {
"simba",
"pestiféré"
],
"_vectors": {
"manual": [
1,
2,
54
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 0,
@ -1580,13 +1412,6 @@ async fn federation_sort_same_indexes_same_criterion_same_direction() {
"moumoute",
"gomez"
],
"_vectors": {
"manual": [
10,
23,
32
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 1,
@ -1714,13 +1539,6 @@ async fn federation_sort_same_indexes_different_criterion_same_direction() {
}
],
"cattos": "pésti",
"_vectors": {
"manual": [
1,
2,
3
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 1,
@ -1746,13 +1564,6 @@ async fn federation_sort_same_indexes_different_criterion_same_direction() {
"moumoute",
"gomez"
],
"_vectors": {
"manual": [
10,
23,
32
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 1,
@ -1767,13 +1578,6 @@ async fn federation_sort_same_indexes_different_criterion_same_direction() {
"cattos": [
"enigma"
],
"_vectors": {
"manual": [
10,
23,
32
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 0,
@ -1795,13 +1599,6 @@ async fn federation_sort_same_indexes_different_criterion_same_direction() {
"simba",
"pestiféré"
],
"_vectors": {
"manual": [
1,
2,
54
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 1,
@ -1843,13 +1640,6 @@ async fn federation_sort_same_indexes_different_criterion_same_direction() {
"simba",
"pestiféré"
],
"_vectors": {
"manual": [
1,
2,
54
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 0,
@ -1872,13 +1662,6 @@ async fn federation_sort_same_indexes_different_criterion_same_direction() {
}
],
"cattos": "pésti",
"_vectors": {
"manual": [
1,
2,
3
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 0,
@ -1904,13 +1687,6 @@ async fn federation_sort_same_indexes_different_criterion_same_direction() {
"moumoute",
"gomez"
],
"_vectors": {
"manual": [
10,
23,
32
]
},
"_federation": {
"indexUid": "nested",
"queriesPosition": 1,
@ -2101,13 +1877,6 @@ async fn federation_sort_different_indexes_same_criterion_same_direction() {
"yellow",
"blue"
],
"_vectors": {
"manual": [
1,
2,
54
]
},
"_federation": {
"indexUid": "movies",
"queriesPosition": 0,
@ -2122,13 +1891,6 @@ async fn federation_sort_different_indexes_same_criterion_same_direction() {
"yellow",
"red"
],
"_vectors": {
"manual": [
10,
-23,
32
]
},
"_federation": {
"indexUid": "movies",
"queriesPosition": 0,
@ -2143,13 +1905,6 @@ async fn federation_sort_different_indexes_same_criterion_same_direction() {
"blue",
"red"
],
"_vectors": {
"manual": [
-100,
340,
90
]
},
"_federation": {
"indexUid": "movies",
"queriesPosition": 0,
@ -2164,13 +1919,6 @@ async fn federation_sort_different_indexes_same_criterion_same_direction() {
"green",
"red"
],
"_vectors": {
"manual": [
-100,
231,
32
]
},
"_federation": {
"indexUid": "movies",
"queriesPosition": 0,
@ -2185,13 +1933,6 @@ async fn federation_sort_different_indexes_same_criterion_same_direction() {
"green",
"blue"
],
"_vectors": {
"manual": [
1,
2,
3
]
},
"_federation": {
"indexUid": "movies",
"queriesPosition": 0,
@ -2226,13 +1967,6 @@ async fn federation_sort_different_indexes_same_criterion_same_direction() {
"yellow",
"blue"
],
"_vectors": {
"manual": [
1,
2,
54
]
},
"_federation": {
"indexUid": "movies",
"queriesPosition": 1,
@ -2413,13 +2147,6 @@ async fn federation_sort_different_ranking_rules() {
"yellow",
"blue"
],
"_vectors": {
"manual": [
1,
2,
54
]
},
"_federation": {
"indexUid": "movies",
"queriesPosition": 0,
@ -2434,13 +2161,6 @@ async fn federation_sort_different_ranking_rules() {
"yellow",
"red"
],
"_vectors": {
"manual": [
10,
-23,
32
]
},
"_federation": {
"indexUid": "movies",
"queriesPosition": 0,
@ -2455,13 +2175,6 @@ async fn federation_sort_different_ranking_rules() {
"blue",
"red"
],
"_vectors": {
"manual": [
-100,
340,
90
]
},
"_federation": {
"indexUid": "movies",
"queriesPosition": 0,
@ -2476,13 +2189,6 @@ async fn federation_sort_different_ranking_rules() {
"green",
"red"
],
"_vectors": {
"manual": [
-100,
231,
32
]
},
"_federation": {
"indexUid": "movies",
"queriesPosition": 0,
@ -2497,13 +2203,6 @@ async fn federation_sort_different_ranking_rules() {
"green",
"blue"
],
"_vectors": {
"manual": [
1,
2,
3
]
},
"_federation": {
"indexUid": "movies",
"queriesPosition": 0,
@ -2714,13 +2413,6 @@ async fn federation_sort_different_indexes_different_criterion_same_direction()
"yellow",
"blue"
],
"_vectors": {
"manual": [
1,
2,
54
]
},
"_federation": {
"indexUid": "movies",
"queriesPosition": 0,
@ -2755,13 +2447,6 @@ async fn federation_sort_different_indexes_different_criterion_same_direction()
"yellow",
"red"
],
"_vectors": {
"manual": [
10,
-23,
32
]
},
"_federation": {
"indexUid": "movies",
"queriesPosition": 0,
@ -2776,13 +2461,6 @@ async fn federation_sort_different_indexes_different_criterion_same_direction()
"blue",
"red"
],
"_vectors": {
"manual": [
-100,
340,
90
]
},
"_federation": {
"indexUid": "movies",
"queriesPosition": 0,
@ -2797,13 +2475,6 @@ async fn federation_sort_different_indexes_different_criterion_same_direction()
"green",
"red"
],
"_vectors": {
"manual": [
-100,
231,
32
]
},
"_federation": {
"indexUid": "movies",
"queriesPosition": 0,
@ -2818,13 +2489,6 @@ async fn federation_sort_different_indexes_different_criterion_same_direction()
"green",
"blue"
],
"_vectors": {
"manual": [
1,
2,
3
]
},
"_federation": {
"indexUid": "movies",
"queriesPosition": 0,
@ -2879,13 +2543,6 @@ async fn federation_sort_different_indexes_different_criterion_same_direction()
"yellow",
"blue"
],
"_vectors": {
"manual": [
1,
2,
54
]
},
"_federation": {
"indexUid": "movies",
"queriesPosition": 1,
@ -4094,13 +3751,6 @@ async fn federation_non_federated_contains_federation_option() {
#[actix_rt::test]
async fn federation_vector_single_index() {
let server = Server::new().await;
let (_, code) = server
.set_features(json!({
"vectorStore": true
}))
.await;
snapshot!(code, @"200 OK");
let index = server.index("vectors");
@ -4302,13 +3952,6 @@ async fn federation_vector_single_index() {
#[actix_rt::test]
async fn federation_vector_two_indexes() {
let server = Server::new().await;
let (_, code) = server
.set_features(json!({
"vectorStore": true
}))
.await;
snapshot!(code, @"200 OK");
let index = server.index("vectors-animal");

View File

@ -235,18 +235,6 @@ async fn get_settings() {
#[actix_rt::test]
async fn secrets_are_hidden_in_settings() {
let server = Server::new().await;
let (response, code) = server.set_features(json!({"vectorStore": true})).await;
meili_snap::snapshot!(code, @"200 OK");
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
let index = server.index("test");
let (response, _code) = index.create(None).await;

View File

@ -8,7 +8,6 @@ use crate::json;
async fn similar_unexisting_index() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let expected_response = json!({
"message": "Index `test` not found.",
@ -29,7 +28,6 @@ async fn similar_unexisting_index() {
async fn similar_unexisting_parameter() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
index
.similar(json!({"id": 287947, "marin": "hello"}), |response, code| {
@ -39,28 +37,10 @@ async fn similar_unexisting_parameter() {
.await;
}
#[actix_rt::test]
async fn similar_feature_not_enabled() {
let server = Server::new().await;
let index = server.index("test");
let (response, code) = index.similar_post(json!({"id": 287947, "embedder": "manual"})).await;
snapshot!(code, @"400 Bad Request");
snapshot!(json_string!(response), @r###"
{
"message": "Using the similar API requires enabling the `vector store` experimental feature. See https://github.com/meilisearch/product/discussions/677",
"code": "feature_not_enabled",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#feature_not_enabled"
}
"###);
}
#[actix_rt::test]
async fn similar_bad_id() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -91,7 +71,6 @@ async fn similar_bad_id() {
async fn similar_bad_ranking_score_threshold() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -122,7 +101,6 @@ async fn similar_bad_ranking_score_threshold() {
async fn similar_invalid_ranking_score_threshold() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -153,7 +131,6 @@ async fn similar_invalid_ranking_score_threshold() {
async fn similar_invalid_id() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -184,7 +161,6 @@ async fn similar_invalid_id() {
async fn similar_not_found_id() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -216,7 +192,6 @@ async fn similar_not_found_id() {
async fn similar_bad_offset() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -259,7 +234,6 @@ async fn similar_bad_offset() {
async fn similar_bad_limit() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -304,7 +278,6 @@ async fn similar_bad_filter() {
// Thus the error message is not generated by deserr but written by us.
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -344,7 +317,6 @@ async fn similar_bad_filter() {
async fn filter_invalid_syntax_object() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -383,7 +355,6 @@ async fn filter_invalid_syntax_object() {
async fn filter_invalid_syntax_array() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -422,7 +393,6 @@ async fn filter_invalid_syntax_array() {
async fn filter_invalid_syntax_string() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -463,7 +433,6 @@ async fn filter_invalid_syntax_string() {
async fn filter_invalid_attribute_array() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -504,7 +473,6 @@ async fn filter_invalid_attribute_array() {
async fn filter_invalid_attribute_string() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -545,7 +513,6 @@ async fn filter_invalid_attribute_string() {
async fn filter_reserved_geo_attribute_array() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -586,7 +553,6 @@ async fn filter_reserved_geo_attribute_array() {
async fn filter_reserved_geo_attribute_string() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -627,7 +593,6 @@ async fn filter_reserved_geo_attribute_string() {
async fn filter_reserved_attribute_array() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -668,7 +633,6 @@ async fn filter_reserved_attribute_array() {
async fn filter_reserved_attribute_string() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -709,7 +673,6 @@ async fn filter_reserved_attribute_string() {
async fn filter_reserved_geo_point_array() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -750,7 +713,6 @@ async fn filter_reserved_geo_point_array() {
async fn filter_reserved_geo_point_string() {
let server = Server::new().await;
let index = server.index("test");
server.set_features(json!({"vectorStore": true})).await;
let (response, code) = index
.update_settings(json!({
@ -790,7 +752,6 @@ async fn filter_reserved_geo_point_string() {
#[actix_rt::test]
async fn similar_bad_retrieve_vectors() {
let server = Server::new().await;
server.set_features(json!({"vectorStore": true})).await;
let index = server.index("test");
let (response, code) =

View File

@ -49,17 +49,6 @@ static DOCUMENTS: Lazy<Value> = Lazy::new(|| {
async fn basic() {
let server = Server::new().await;
let index = server.index("test");
let (value, code) = server.set_features(json!({"vectorStore": true})).await;
snapshot!(code, @"200 OK");
snapshot!(value, @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
let (response, code) = index
.update_settings(json!({
@ -246,17 +235,6 @@ async fn basic() {
async fn ranking_score_threshold() {
let server = Server::new().await;
let index = server.index("test");
let (value, code) = server.set_features(json!({"vectorStore": true})).await;
snapshot!(code, @"200 OK");
snapshot!(value, @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
let (response, code) = index
.update_settings(json!({
@ -527,17 +505,6 @@ async fn ranking_score_threshold() {
async fn filter() {
let server = Server::new().await;
let index = server.index("test");
let (value, code) = server.set_features(json!({"vectorStore": true})).await;
snapshot!(code, @"200 OK");
snapshot!(value, @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
let (response, code) = index
.update_settings(json!({
@ -656,17 +623,6 @@ async fn filter() {
async fn limit_and_offset() {
let server = Server::new().await;
let index = server.index("test");
let (value, code) = server.set_features(json!({"vectorStore": true})).await;
snapshot!(code, @"200 OK");
snapshot!(value, @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
let (response, code) = index
.update_settings(json!({

View File

@ -8,17 +8,6 @@ use crate::vector::generate_default_user_provided_documents;
async fn retrieve_binary_quantize_status_in_the_settings() {
let server = Server::new().await;
let index = server.index("doggo");
let (value, code) = server.set_features(json!({"vectorStore": true})).await;
snapshot!(code, @"200 OK");
snapshot!(value, @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
let (response, code) = index
.update_settings(json!({
@ -78,17 +67,6 @@ async fn retrieve_binary_quantize_status_in_the_settings() {
async fn binary_quantize_before_sending_documents() {
let server = Server::new().await;
let index = server.index("doggo");
let (value, code) = server.set_features(json!({"vectorStore": true})).await;
snapshot!(code, @"200 OK");
snapshot!(value, @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
let (response, code) = index
.update_settings(json!({
@ -163,17 +141,6 @@ async fn binary_quantize_before_sending_documents() {
async fn binary_quantize_after_sending_documents() {
let server = Server::new().await;
let index = server.index("doggo");
let (value, code) = server.set_features(json!({"vectorStore": true})).await;
snapshot!(code, @"200 OK");
snapshot!(value, @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
let (response, code) = index
.update_settings(json!({
@ -261,17 +228,6 @@ async fn binary_quantize_after_sending_documents() {
async fn try_to_disable_binary_quantization() {
let server = Server::new().await;
let index = server.index("doggo");
let (value, code) = server.set_features(json!({"vectorStore": true})).await;
snapshot!(code, @"200 OK");
snapshot!(value, @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
let (response, code) = index
.update_settings(json!({

View File

@ -13,36 +13,13 @@ use crate::common::{default_settings, GetAllDocumentsOptions, Server};
use crate::json;
async fn get_server_vector() -> Server {
let server = Server::new().await;
let (value, code) = server.set_features(json!({"vectorStore": true})).await;
snapshot!(code, @"200 OK");
snapshot!(value, @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
server
Server::new().await
}
#[actix_rt::test]
async fn add_remove_user_provided() {
let server = Server::new().await;
let index = server.index("doggo");
let (value, code) = server.set_features(json!({"vectorStore": true})).await;
snapshot!(code, @"200 OK");
snapshot!(value, @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
let (response, code) = index
.update_settings(json!({
@ -187,17 +164,6 @@ async fn add_remove_user_provided() {
async fn generate_default_user_provided_documents(server: &Server) -> Index {
let index = server.index("doggo");
let (value, code) = server.set_features(json!({"vectorStore": true})).await;
snapshot!(code, @"200 OK");
snapshot!(value, @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
let (response, code) = index
.update_settings(json!({
@ -654,17 +620,6 @@ async fn add_remove_one_vector_4588() {
// https://github.com/meilisearch/meilisearch/issues/4588
let server = Server::new().await;
let index = server.index("doggo");
let (value, code) = server.set_features(json!({"vectorStore": true})).await;
snapshot!(code, @"200 OK");
snapshot!(value, @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
let (response, code) = index
.update_settings(json!({

View File

@ -8,17 +8,6 @@ use crate::vector::generate_default_user_provided_documents;
async fn field_unavailable_for_source() {
let server = Server::new().await;
let index = server.index("doggo");
let (value, code) = server.set_features(json!({"vectorStore": true})).await;
snapshot!(code, @"200 OK");
snapshot!(value, @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
let (response, code) = index
.update_settings(json!({
@ -55,17 +44,6 @@ async fn field_unavailable_for_source() {
async fn update_embedder() {
let server = Server::new().await;
let index = server.index("doggo");
let (value, code) = server.set_features(json!({"vectorStore": true})).await;
snapshot!(code, @"200 OK");
snapshot!(value, @r###"
{
"vectorStore": true,
"metrics": false,
"logsRoute": false,
"editDocumentsByFunction": false,
"containsFilter": false
}
"###);
let (response, code) = index
.update_settings(json!({