mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 06:44:27 +01:00
update tests
This commit is contained in:
parent
2eb6f81c58
commit
aa95c26e07
@ -66,7 +66,7 @@ pub fn enrich_server_with_movies_settings(
|
|||||||
"_exactness",
|
"_exactness",
|
||||||
"dsc(vote_average)",
|
"dsc(vote_average)",
|
||||||
],
|
],
|
||||||
"rankingDistinct": null,
|
"distinctAttribute": null,
|
||||||
"searchableAttributes": [
|
"searchableAttributes": [
|
||||||
"title",
|
"title",
|
||||||
"tagline",
|
"tagline",
|
||||||
@ -92,7 +92,7 @@ pub fn enrich_server_with_movies_settings(
|
|||||||
],
|
],
|
||||||
"stopWords": null,
|
"stopWords": null,
|
||||||
"synonyms": null,
|
"synonyms": null,
|
||||||
"indexNewFields": false,
|
"acceptNewFields": false,
|
||||||
});
|
});
|
||||||
|
|
||||||
let body = json.to_string().into_bytes();
|
let body = json.to_string().into_bytes();
|
||||||
|
@ -635,7 +635,7 @@ fn search_with_settings_basic() {
|
|||||||
"_exactness",
|
"_exactness",
|
||||||
"dsc(vote_average)"
|
"dsc(vote_average)"
|
||||||
],
|
],
|
||||||
"rankingDistinct": null,
|
"distinctAttribute": null,
|
||||||
"identifier": "id",
|
"identifier": "id",
|
||||||
"searchableAttributes": [
|
"searchableAttributes": [
|
||||||
"title",
|
"title",
|
||||||
@ -662,7 +662,7 @@ fn search_with_settings_basic() {
|
|||||||
],
|
],
|
||||||
"stopWords": null,
|
"stopWords": null,
|
||||||
"synonyms": null,
|
"synonyms": null,
|
||||||
"indexNewFields": false,
|
"acceptNewFields": false,
|
||||||
});
|
});
|
||||||
|
|
||||||
common::update_config(&mut server, config);
|
common::update_config(&mut server, config);
|
||||||
@ -741,7 +741,7 @@ fn search_with_settings_stop_words() {
|
|||||||
"_exactness",
|
"_exactness",
|
||||||
"dsc(vote_average)"
|
"dsc(vote_average)"
|
||||||
],
|
],
|
||||||
"rankingDistinct": null,
|
"distinctAttribute": null,
|
||||||
"identifier": "id",
|
"identifier": "id",
|
||||||
"searchableAttributes": [
|
"searchableAttributes": [
|
||||||
"title",
|
"title",
|
||||||
@ -768,7 +768,7 @@ fn search_with_settings_stop_words() {
|
|||||||
],
|
],
|
||||||
"stopWords": ["the"],
|
"stopWords": ["the"],
|
||||||
"synonyms": null,
|
"synonyms": null,
|
||||||
"indexNewFields": false,
|
"acceptNewFields": false,
|
||||||
});
|
});
|
||||||
|
|
||||||
common::update_config(&mut server, config);
|
common::update_config(&mut server, config);
|
||||||
@ -848,7 +848,7 @@ fn search_with_settings_synonyms() {
|
|||||||
"_exactness",
|
"_exactness",
|
||||||
"dsc(vote_average)"
|
"dsc(vote_average)"
|
||||||
],
|
],
|
||||||
"rankingDistinct": null,
|
"distinctAttribute": null,
|
||||||
"identifier": "id",
|
"identifier": "id",
|
||||||
"searchableAttributes": [
|
"searchableAttributes": [
|
||||||
"title",
|
"title",
|
||||||
@ -880,7 +880,7 @@ fn search_with_settings_synonyms() {
|
|||||||
"Iron Man"
|
"Iron Man"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"indexNewFields": false,
|
"acceptNewFields": false,
|
||||||
});
|
});
|
||||||
|
|
||||||
common::update_config(&mut server, config);
|
common::update_config(&mut server, config);
|
||||||
@ -960,7 +960,7 @@ fn search_with_settings_ranking_rules() {
|
|||||||
"_exactness",
|
"_exactness",
|
||||||
"dsc(popularity)"
|
"dsc(popularity)"
|
||||||
],
|
],
|
||||||
"rankingDistinct": null,
|
"distinctAttribute": null,
|
||||||
"identifier": "id",
|
"identifier": "id",
|
||||||
"searchableAttributes": [
|
"searchableAttributes": [
|
||||||
"title",
|
"title",
|
||||||
@ -987,7 +987,7 @@ fn search_with_settings_ranking_rules() {
|
|||||||
],
|
],
|
||||||
"stopWords": null,
|
"stopWords": null,
|
||||||
"synonyms": null,
|
"synonyms": null,
|
||||||
"indexNewFields": false,
|
"acceptNewFields": false,
|
||||||
});
|
});
|
||||||
|
|
||||||
common::update_config(&mut server, config);
|
common::update_config(&mut server, config);
|
||||||
@ -1067,7 +1067,7 @@ fn search_with_settings_searchable_attributes() {
|
|||||||
"_exactness",
|
"_exactness",
|
||||||
"dsc(vote_average)"
|
"dsc(vote_average)"
|
||||||
],
|
],
|
||||||
"rankingDistinct": null,
|
"distinctAttribute": null,
|
||||||
"identifier": "id",
|
"identifier": "id",
|
||||||
"searchableAttributes": [
|
"searchableAttributes": [
|
||||||
"tagline",
|
"tagline",
|
||||||
@ -1093,7 +1093,7 @@ fn search_with_settings_searchable_attributes() {
|
|||||||
],
|
],
|
||||||
"stopWords": null,
|
"stopWords": null,
|
||||||
"synonyms": null,
|
"synonyms": null,
|
||||||
"indexNewFields": false,
|
"acceptNewFields": false,
|
||||||
});
|
});
|
||||||
|
|
||||||
common::update_config(&mut server, config);
|
common::update_config(&mut server, config);
|
||||||
@ -1173,7 +1173,7 @@ fn search_with_settings_displayed_attributes() {
|
|||||||
"_exactness",
|
"_exactness",
|
||||||
"dsc(vote_average)"
|
"dsc(vote_average)"
|
||||||
],
|
],
|
||||||
"rankingDistinct": null,
|
"distinctAttribute": null,
|
||||||
"identifier": "id",
|
"identifier": "id",
|
||||||
"searchableAttributes": [
|
"searchableAttributes": [
|
||||||
"title",
|
"title",
|
||||||
@ -1194,7 +1194,7 @@ fn search_with_settings_displayed_attributes() {
|
|||||||
],
|
],
|
||||||
"stopWords": null,
|
"stopWords": null,
|
||||||
"synonyms": null,
|
"synonyms": null,
|
||||||
"indexNewFields": false,
|
"acceptNewFields": false,
|
||||||
});
|
});
|
||||||
|
|
||||||
common::update_config(&mut server, config);
|
common::update_config(&mut server, config);
|
||||||
@ -1244,7 +1244,7 @@ fn search_with_settings_searchable_attributes_2() {
|
|||||||
"_exactness",
|
"_exactness",
|
||||||
"dsc(vote_average)"
|
"dsc(vote_average)"
|
||||||
],
|
],
|
||||||
"rankingDistinct": null,
|
"distinctAttribute": null,
|
||||||
"identifier": "id",
|
"identifier": "id",
|
||||||
"searchableAttributes": [
|
"searchableAttributes": [
|
||||||
"tagline",
|
"tagline",
|
||||||
@ -1265,7 +1265,7 @@ fn search_with_settings_searchable_attributes_2() {
|
|||||||
],
|
],
|
||||||
"stopWords": null,
|
"stopWords": null,
|
||||||
"synonyms": null,
|
"synonyms": null,
|
||||||
"indexNewFields": false,
|
"acceptNewFields": false,
|
||||||
});
|
});
|
||||||
|
|
||||||
common::update_config(&mut server, config);
|
common::update_config(&mut server, config);
|
||||||
|
@ -50,7 +50,7 @@ fn write_all_and_delete() {
|
|||||||
"dsc(release_date)",
|
"dsc(release_date)",
|
||||||
"dsc(rank)",
|
"dsc(rank)",
|
||||||
],
|
],
|
||||||
"rankingDistinct": "movie_id",
|
"distinctAttribute": "movie_id",
|
||||||
"searchableAttributes": [
|
"searchableAttributes": [
|
||||||
"id",
|
"id",
|
||||||
"movie_id",
|
"movie_id",
|
||||||
@ -76,7 +76,7 @@ fn write_all_and_delete() {
|
|||||||
"wolverine": ["xmen", "logan"],
|
"wolverine": ["xmen", "logan"],
|
||||||
"logan": ["wolverine"],
|
"logan": ["wolverine"],
|
||||||
},
|
},
|
||||||
"indexNewFields": false,
|
"acceptNewFields": false,
|
||||||
});
|
});
|
||||||
|
|
||||||
let body = json.to_string().into_bytes();
|
let body = json.to_string().into_bytes();
|
||||||
@ -127,12 +127,12 @@ fn write_all_and_delete() {
|
|||||||
|
|
||||||
let json = json!({
|
let json = json!({
|
||||||
"rankingRules": null,
|
"rankingRules": null,
|
||||||
"rankingDistinct": null,
|
"distinctAttribute": null,
|
||||||
"searchableAttributes": null,
|
"searchableAttributes": null,
|
||||||
"displayedAttributes": null,
|
"displayedAttributes": null,
|
||||||
"stopWords": null,
|
"stopWords": null,
|
||||||
"synonyms": null,
|
"synonyms": null,
|
||||||
"indexNewFields": true,
|
"acceptNewFields": true,
|
||||||
});
|
});
|
||||||
|
|
||||||
assert_json_eq!(json, res_value, ordered: false);
|
assert_json_eq!(json, res_value, ordered: false);
|
||||||
@ -178,7 +178,7 @@ fn write_all_and_update() {
|
|||||||
"dsc(release_date)",
|
"dsc(release_date)",
|
||||||
"dsc(rank)",
|
"dsc(rank)",
|
||||||
],
|
],
|
||||||
"rankingDistinct": "movie_id",
|
"distinctAttribute": "movie_id",
|
||||||
"searchableAttributes": [
|
"searchableAttributes": [
|
||||||
"uid",
|
"uid",
|
||||||
"movie_id",
|
"movie_id",
|
||||||
@ -204,7 +204,7 @@ fn write_all_and_update() {
|
|||||||
"wolverine": ["xmen", "logan"],
|
"wolverine": ["xmen", "logan"],
|
||||||
"logan": ["wolverine"],
|
"logan": ["wolverine"],
|
||||||
},
|
},
|
||||||
"indexNewFields": false,
|
"acceptNewFields": false,
|
||||||
});
|
});
|
||||||
|
|
||||||
let body = json.to_string().into_bytes();
|
let body = json.to_string().into_bytes();
|
||||||
@ -261,7 +261,7 @@ fn write_all_and_update() {
|
|||||||
"wolverine": ["xmen", "logan"],
|
"wolverine": ["xmen", "logan"],
|
||||||
"logan": ["wolverine", "xmen"],
|
"logan": ["wolverine", "xmen"],
|
||||||
},
|
},
|
||||||
"indexNewFields": false,
|
"acceptNewFields": false,
|
||||||
});
|
});
|
||||||
|
|
||||||
let body_update = json_update.to_string().into_bytes();
|
let body_update = json_update.to_string().into_bytes();
|
||||||
@ -296,7 +296,7 @@ fn write_all_and_update() {
|
|||||||
"_exactness",
|
"_exactness",
|
||||||
"dsc(release_date)",
|
"dsc(release_date)",
|
||||||
],
|
],
|
||||||
"rankingDistinct": null,
|
"distinctAttribute": null,
|
||||||
"searchableAttributes": [
|
"searchableAttributes": [
|
||||||
"title",
|
"title",
|
||||||
"description",
|
"description",
|
||||||
@ -314,7 +314,7 @@ fn write_all_and_update() {
|
|||||||
"wolverine": ["xmen", "logan"],
|
"wolverine": ["xmen", "logan"],
|
||||||
"logan": ["wolverine", "xmen"],
|
"logan": ["wolverine", "xmen"],
|
||||||
},
|
},
|
||||||
"indexNewFields": false
|
"acceptNewFields": false
|
||||||
});
|
});
|
||||||
|
|
||||||
assert_json_eq!(res_expected, res_value, ordered: false);
|
assert_json_eq!(res_expected, res_value, ordered: false);
|
||||||
|
Loading…
Reference in New Issue
Block a user