mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-06-18 12:47:35 +02:00
Re-use the shared_index_with_score_documents since the settings are as the default
Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
This commit is contained in:
parent
b8845d1015
commit
646e44ddf9
@ -1924,26 +1924,7 @@ async fn federation_sort_different_ranking_rules() {
|
|||||||
.await;
|
.await;
|
||||||
movies_index.wait_task(value.uid()).await.succeeded();
|
movies_index.wait_task(value.uid()).await.succeeded();
|
||||||
|
|
||||||
let batman_index = server.unique_index_with_prefix("batman");
|
let batman_index = shared_index_with_score_documents().await;
|
||||||
|
|
||||||
let documents = SCORE_DOCUMENTS.clone();
|
|
||||||
let (value, _) = batman_index.add_documents(documents, None).await;
|
|
||||||
batman_index.wait_task(value.uid()).await.succeeded();
|
|
||||||
|
|
||||||
let (value, _) = batman_index
|
|
||||||
.update_settings(json!({
|
|
||||||
"sortableAttributes": ["title"],
|
|
||||||
"rankingRules": [
|
|
||||||
"words",
|
|
||||||
"typo",
|
|
||||||
"proximity",
|
|
||||||
"attribute",
|
|
||||||
"sort",
|
|
||||||
"exactness"
|
|
||||||
]
|
|
||||||
}))
|
|
||||||
.await;
|
|
||||||
batman_index.wait_task(value.uid()).await.succeeded();
|
|
||||||
|
|
||||||
// return titles ordered across indexes
|
// return titles ordered across indexes
|
||||||
let (response, code) = server
|
let (response, code) = server
|
||||||
@ -1960,7 +1941,7 @@ async fn federation_sort_different_ranking_rules() {
|
|||||||
"title": "Badman",
|
"title": "Badman",
|
||||||
"id": "E",
|
"id": "E",
|
||||||
"_federation": {
|
"_federation": {
|
||||||
"indexUid": "batman-[uuid]",
|
"indexUid": "SHARED_SCORE_DOCUMENTS",
|
||||||
"queriesPosition": 1,
|
"queriesPosition": 1,
|
||||||
"weightedRankingScore": 1.0
|
"weightedRankingScore": 1.0
|
||||||
},
|
},
|
||||||
@ -1970,7 +1951,7 @@ async fn federation_sort_different_ranking_rules() {
|
|||||||
"title": "Batman",
|
"title": "Batman",
|
||||||
"id": "D",
|
"id": "D",
|
||||||
"_federation": {
|
"_federation": {
|
||||||
"indexUid": "batman-[uuid]",
|
"indexUid": "SHARED_SCORE_DOCUMENTS",
|
||||||
"queriesPosition": 1,
|
"queriesPosition": 1,
|
||||||
"weightedRankingScore": 1.0
|
"weightedRankingScore": 1.0
|
||||||
},
|
},
|
||||||
@ -1980,7 +1961,7 @@ async fn federation_sort_different_ranking_rules() {
|
|||||||
"title": "Batman Returns",
|
"title": "Batman Returns",
|
||||||
"id": "C",
|
"id": "C",
|
||||||
"_federation": {
|
"_federation": {
|
||||||
"indexUid": "batman-[uuid]",
|
"indexUid": "SHARED_SCORE_DOCUMENTS",
|
||||||
"queriesPosition": 1,
|
"queriesPosition": 1,
|
||||||
"weightedRankingScore": 1.0
|
"weightedRankingScore": 1.0
|
||||||
},
|
},
|
||||||
@ -1990,7 +1971,7 @@ async fn federation_sort_different_ranking_rules() {
|
|||||||
"title": "Batman the dark knight returns: Part 1",
|
"title": "Batman the dark knight returns: Part 1",
|
||||||
"id": "A",
|
"id": "A",
|
||||||
"_federation": {
|
"_federation": {
|
||||||
"indexUid": "batman-[uuid]",
|
"indexUid": "SHARED_SCORE_DOCUMENTS",
|
||||||
"queriesPosition": 1,
|
"queriesPosition": 1,
|
||||||
"weightedRankingScore": 1.0
|
"weightedRankingScore": 1.0
|
||||||
},
|
},
|
||||||
@ -2000,7 +1981,7 @@ async fn federation_sort_different_ranking_rules() {
|
|||||||
"title": "Batman the dark knight returns: Part 2",
|
"title": "Batman the dark knight returns: Part 2",
|
||||||
"id": "B",
|
"id": "B",
|
||||||
"_federation": {
|
"_federation": {
|
||||||
"indexUid": "batman-[uuid]",
|
"indexUid": "SHARED_SCORE_DOCUMENTS",
|
||||||
"queriesPosition": 1,
|
"queriesPosition": 1,
|
||||||
"weightedRankingScore": 1.0
|
"weightedRankingScore": 1.0
|
||||||
},
|
},
|
||||||
@ -2095,7 +2076,7 @@ async fn federation_sort_different_ranking_rules() {
|
|||||||
snapshot!(code, @"400 Bad Request");
|
snapshot!(code, @"400 Bad Request");
|
||||||
snapshot!(json_string!(response), @r###"
|
snapshot!(json_string!(response), @r###"
|
||||||
{
|
{
|
||||||
"message": "Inside `.queries[1]`: The results of queries #2 and #1 are incompatible: \n 1. `queries[2]`, `batman-[uuid].rankingRules[0..=3]`: relevancy rule(s) words, typo, proximity, attribute\n 2. `queries[1].sort[0]`, `movies-[uuid].rankingRules[0]`: descending sort rule(s) on field `title`\n - cannot compare a relevancy rule with a sort rule\n",
|
"message": "Inside `.queries[1]`: The results of queries #2 and #1 are incompatible: \n 1. `queries[2]`, `SHARED_SCORE_DOCUMENTS.rankingRules[0..=3]`: relevancy rule(s) words, typo, proximity, attribute\n 2. `queries[1].sort[0]`, `movies-[uuid].rankingRules[0]`: descending sort rule(s) on field `title`\n - cannot compare a relevancy rule with a sort rule\n",
|
||||||
"code": "invalid_multi_search_query_ranking_rules",
|
"code": "invalid_multi_search_query_ranking_rules",
|
||||||
"type": "invalid_request",
|
"type": "invalid_request",
|
||||||
"link": "https://docs.meilisearch.com/errors#invalid_multi_search_query_ranking_rules"
|
"link": "https://docs.meilisearch.com/errors#invalid_multi_search_query_ranking_rules"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user