mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-27 08:41:00 +00:00
review the internal schema to allow to create schema without identifier; fix #513
This commit is contained in:
@ -252,3 +252,73 @@ fn write_all_and_update() {
|
||||
|
||||
assert_json_eq!(expected, response, ordered: false);
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn test_default_settings() {
|
||||
let mut server = common::Server::with_uid("movies");
|
||||
let body = json!({
|
||||
"uid": "movies",
|
||||
});
|
||||
server.create_index(body);
|
||||
|
||||
// 1 - Get all settings and compare to the previous one
|
||||
|
||||
let body = json!({
|
||||
"rankingRules": [
|
||||
"typo",
|
||||
"words",
|
||||
"proximity",
|
||||
"attribute",
|
||||
"wordsPosition",
|
||||
"exactness"
|
||||
],
|
||||
"distinctAttribute": null,
|
||||
"searchableAttributes": [],
|
||||
"displayedAttributes": [],
|
||||
"stopWords": [],
|
||||
"synonyms": {},
|
||||
"acceptNewFields": true,
|
||||
});
|
||||
|
||||
let (response, _status_code) = server.get_all_settings();
|
||||
|
||||
assert_json_eq!(body, response, ordered: false);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_default_settings_2() {
|
||||
let mut server = common::Server::with_uid("movies");
|
||||
let body = json!({
|
||||
"uid": "movies",
|
||||
"identifier": "id",
|
||||
});
|
||||
server.create_index(body);
|
||||
|
||||
// 1 - Get all settings and compare to the previous one
|
||||
|
||||
let body = json!({
|
||||
"rankingRules": [
|
||||
"typo",
|
||||
"words",
|
||||
"proximity",
|
||||
"attribute",
|
||||
"wordsPosition",
|
||||
"exactness"
|
||||
],
|
||||
"distinctAttribute": null,
|
||||
"searchableAttributes": [
|
||||
"id"
|
||||
],
|
||||
"displayedAttributes": [
|
||||
"id"
|
||||
],
|
||||
"stopWords": [],
|
||||
"synonyms": {},
|
||||
"acceptNewFields": true,
|
||||
});
|
||||
|
||||
let (response, _status_code) = server.get_all_settings();
|
||||
|
||||
assert_json_eq!(body, response, ordered: false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user