mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 14:54:27 +01:00
fix the compat between v3 and v4
This commit is contained in:
parent
f622ef9836
commit
9117fde712
@ -22,7 +22,7 @@ expression: tasks
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 0,
|
"id": 1,
|
||||||
"index_uid": "movies",
|
"index_uid": "movies",
|
||||||
"content": {
|
"content": {
|
||||||
"DocumentAddition": {
|
"DocumentAddition": {
|
||||||
@ -53,7 +53,7 @@ expression: tasks
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 2,
|
||||||
"index_uid": "movies",
|
"index_uid": "movies",
|
||||||
"content": {
|
"content": {
|
||||||
"SettingsUpdate": {
|
"SettingsUpdate": {
|
||||||
@ -86,7 +86,7 @@ expression: tasks
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 2,
|
"id": 3,
|
||||||
"index_uid": "movies",
|
"index_uid": "movies",
|
||||||
"content": {
|
"content": {
|
||||||
"SettingsUpdate": {
|
"SettingsUpdate": {
|
||||||
@ -121,7 +121,7 @@ expression: tasks
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 3,
|
"id": 4,
|
||||||
"index_uid": "movies",
|
"index_uid": "movies",
|
||||||
"content": {
|
"content": {
|
||||||
"DocumentAddition": {
|
"DocumentAddition": {
|
||||||
@ -152,7 +152,7 @@ expression: tasks
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 0,
|
"id": 5,
|
||||||
"index_uid": "products",
|
"index_uid": "products",
|
||||||
"content": {
|
"content": {
|
||||||
"SettingsUpdate": {
|
"SettingsUpdate": {
|
||||||
@ -193,7 +193,7 @@ expression: tasks
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 6,
|
||||||
"index_uid": "products",
|
"index_uid": "products",
|
||||||
"content": {
|
"content": {
|
||||||
"DocumentAddition": {
|
"DocumentAddition": {
|
||||||
@ -225,7 +225,7 @@ expression: tasks
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 2,
|
"id": 7,
|
||||||
"index_uid": "products",
|
"index_uid": "products",
|
||||||
"content": {
|
"content": {
|
||||||
"DocumentAddition": {
|
"DocumentAddition": {
|
||||||
@ -256,7 +256,7 @@ expression: tasks
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 0,
|
"id": 8,
|
||||||
"index_uid": "dnd_spells",
|
"index_uid": "dnd_spells",
|
||||||
"content": {
|
"content": {
|
||||||
"DocumentAddition": {
|
"DocumentAddition": {
|
||||||
@ -288,7 +288,7 @@ expression: tasks
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 9,
|
||||||
"index_uid": "dnd_spells",
|
"index_uid": "dnd_spells",
|
||||||
"content": {
|
"content": {
|
||||||
"DocumentAddition": {
|
"DocumentAddition": {
|
||||||
|
@ -67,7 +67,10 @@ impl CompatV3ToV4 {
|
|||||||
|
|
||||||
Box::new(
|
Box::new(
|
||||||
tasks
|
tasks
|
||||||
.map(move |task| {
|
// we need to override the old task ids that were generated
|
||||||
|
// by index in favor of a global unique incremental ID.
|
||||||
|
.enumerate()
|
||||||
|
.map(move |(task_id, task)| {
|
||||||
task.map(|(task, content_file)| {
|
task.map(|(task, content_file)| {
|
||||||
let index_uid = indexes
|
let index_uid = indexes
|
||||||
.iter()
|
.iter()
|
||||||
@ -97,7 +100,7 @@ impl CompatV3ToV4 {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let task = v4::Task {
|
let task = v4::Task {
|
||||||
id: task.update.id() as u32,
|
id: task_id as u32,
|
||||||
index_uid: v4::meta::IndexUid(index_uid),
|
index_uid: v4::meta::IndexUid(index_uid),
|
||||||
content: match task.update.meta() {
|
content: match task.update.meta() {
|
||||||
v3::Kind::DeleteDocuments(documents) => {
|
v3::Kind::DeleteDocuments(documents) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user