mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
chore(search): rename in the search endpoint
Fix ##2376
This commit is contained in:
parent
ae4e419db4
commit
4e9accdeb7
6 changed files with 50 additions and 67 deletions
|
@ -16,7 +16,7 @@ async fn formatted_contain_wildcard() {
|
|||
index.wait_task(1).await;
|
||||
|
||||
let (response, code) = index
|
||||
.search_post(json!({ "q": "pesti", "attributesToRetrieve": ["father", "mother"], "attributesToHighlight": ["father", "mother", "*"], "attributesToCrop": ["doggos"], "matches": true }))
|
||||
.search_post(json!({ "q": "pesti", "attributesToRetrieve": ["father", "mother"], "attributesToHighlight": ["father", "mother", "*"], "attributesToCrop": ["doggos"], "showMatchesPosition": true }))
|
||||
.await;
|
||||
assert_eq!(code, 200, "{}", response);
|
||||
assert_eq!(
|
||||
|
@ -26,7 +26,7 @@ async fn formatted_contain_wildcard() {
|
|||
"id": "852",
|
||||
"cattos": "<em>pesti</em>",
|
||||
},
|
||||
"_matchesInfo": {"cattos": [{"start": 0, "length": 5}]},
|
||||
"_matchesPosition": {"cattos": [{"start": 0, "length": 5}]},
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -44,7 +44,7 @@ async fn formatted_contain_wildcard() {
|
|||
|
||||
let (response, code) = index
|
||||
.search_post(
|
||||
json!({ "q": "pesti", "attributesToRetrieve": ["*"], "attributesToHighlight": ["id"], "matches": true }),
|
||||
json!({ "q": "pesti", "attributesToRetrieve": ["*"], "attributesToHighlight": ["id"], "showMatchesPosition": true }),
|
||||
)
|
||||
.await;
|
||||
assert_eq!(code, 200, "{}", response);
|
||||
|
@ -57,7 +57,7 @@ async fn formatted_contain_wildcard() {
|
|||
"id": "852",
|
||||
"cattos": "pesti",
|
||||
},
|
||||
"_matchesInfo": {"cattos": [{"start": 0, "length": 5}]},
|
||||
"_matchesPosition": {"cattos": [{"start": 0, "length": 5}]},
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -145,7 +145,7 @@ async fn format_nested() {
|
|||
|
||||
let (response, code) = index
|
||||
.search_post(
|
||||
json!({ "q": "bobby", "attributesToRetrieve": ["doggos.name"], "matches": true }),
|
||||
json!({ "q": "bobby", "attributesToRetrieve": ["doggos.name"], "showMatchesPosition": true }),
|
||||
)
|
||||
.await;
|
||||
assert_eq!(code, 200, "{}", response);
|
||||
|
@ -160,7 +160,7 @@ async fn format_nested() {
|
|||
"name": "buddy",
|
||||
},
|
||||
],
|
||||
"_matchesInfo": {"doggos.name": [{"start": 0, "length": 5}]},
|
||||
"_matchesPosition": {"doggos.name": [{"start": 0, "length": 5}]},
|
||||
})
|
||||
);
|
||||
|
||||
|
|
|
@ -420,11 +420,11 @@ async fn search_facet_distribution() {
|
|||
index
|
||||
.search(
|
||||
json!({
|
||||
"facetsDistribution": ["title"]
|
||||
"facets": ["title"]
|
||||
}),
|
||||
|response, code| {
|
||||
assert_eq!(code, 200, "{}", response);
|
||||
let dist = response["facetsDistribution"].as_object().unwrap();
|
||||
let dist = response["facetDistribution"].as_object().unwrap();
|
||||
assert_eq!(dist.len(), 1);
|
||||
assert!(dist.get("title").is_some());
|
||||
},
|
||||
|
@ -445,12 +445,12 @@ async fn search_facet_distribution() {
|
|||
index
|
||||
.search(
|
||||
json!({
|
||||
// "facetsDistribution": ["father", "doggos.name"]
|
||||
"facetsDistribution": ["father"]
|
||||
// "facets": ["father", "doggos.name"]
|
||||
"facets": ["father"]
|
||||
}),
|
||||
|response, code| {
|
||||
assert_eq!(code, 200, "{}", response);
|
||||
let dist = response["facetsDistribution"].as_object().unwrap();
|
||||
let dist = response["facetDistribution"].as_object().unwrap();
|
||||
assert_eq!(dist.len(), 1);
|
||||
assert_eq!(
|
||||
dist["father"],
|
||||
|
@ -474,11 +474,11 @@ async fn search_facet_distribution() {
|
|||
index
|
||||
.search(
|
||||
json!({
|
||||
"facetsDistribution": ["doggos.name"]
|
||||
"facets": ["doggos.name"]
|
||||
}),
|
||||
|response, code| {
|
||||
assert_eq!(code, 200, "{}", response);
|
||||
let dist = response["facetsDistribution"].as_object().unwrap();
|
||||
let dist = response["facetDistribution"].as_object().unwrap();
|
||||
assert_eq!(dist.len(), 1);
|
||||
assert_eq!(
|
||||
dist["doggos.name"],
|
||||
|
@ -491,11 +491,11 @@ async fn search_facet_distribution() {
|
|||
index
|
||||
.search(
|
||||
json!({
|
||||
"facetsDistribution": ["doggos"]
|
||||
"facets": ["doggos"]
|
||||
}),
|
||||
|response, code| {
|
||||
assert_eq!(code, 200, "{}", response);
|
||||
let dist = response["facetsDistribution"].as_object().unwrap();
|
||||
let dist = response["facetDistribution"].as_object().unwrap();
|
||||
dbg!(&dist);
|
||||
assert_eq!(dist.len(), 3);
|
||||
assert_eq!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue