mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-23 05:14:27 +01:00
add name to index_metadata
This commit is contained in:
parent
0c17b166df
commit
94bd14ede3
@ -27,6 +27,7 @@ pub type UpdateStatus = updates::UpdateStatus<UpdateMeta, UpdateResult, String>;
|
|||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct IndexMetadata {
|
pub struct IndexMetadata {
|
||||||
uid: String,
|
uid: String,
|
||||||
|
name: String,
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
meta: index_actor::IndexMeta,
|
meta: index_actor::IndexMeta,
|
||||||
}
|
}
|
||||||
@ -176,7 +177,7 @@ impl IndexController {
|
|||||||
let uuid = self.uuid_resolver.create(uid.clone()).await?;
|
let uuid = self.uuid_resolver.create(uid.clone()).await?;
|
||||||
let meta = self.index_handle.create_index(uuid, primary_key).await?;
|
let meta = self.index_handle.create_index(uuid, primary_key).await?;
|
||||||
let _ = self.update_handle.create(uuid).await?;
|
let _ = self.update_handle.create(uuid).await?;
|
||||||
let meta = IndexMetadata { uid, meta };
|
let meta = IndexMetadata { name: uid.clone(), uid, meta };
|
||||||
|
|
||||||
Ok(meta)
|
Ok(meta)
|
||||||
}
|
}
|
||||||
@ -207,7 +208,7 @@ impl IndexController {
|
|||||||
|
|
||||||
for (uid, uuid) in uuids {
|
for (uid, uuid) in uuids {
|
||||||
let meta = self.index_handle.get_index_meta(uuid).await?;
|
let meta = self.index_handle.get_index_meta(uuid).await?;
|
||||||
let meta = IndexMetadata { uid, meta };
|
let meta = IndexMetadata { name: uid.clone(), uid, meta };
|
||||||
ret.push(meta);
|
ret.push(meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,7 +261,7 @@ impl IndexController {
|
|||||||
|
|
||||||
let uuid = self.uuid_resolver.resolve(uid.clone()).await?;
|
let uuid = self.uuid_resolver.resolve(uid.clone()).await?;
|
||||||
let meta = self.index_handle.update_index(uuid, index_settings).await?;
|
let meta = self.index_handle.update_index(uuid, index_settings).await?;
|
||||||
let meta = IndexMetadata { uid, meta };
|
let meta = IndexMetadata { name: uid.clone(), uid, meta };
|
||||||
Ok(meta)
|
Ok(meta)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,7 +274,7 @@ impl IndexController {
|
|||||||
pub async fn get_index(&self, uid: String) -> anyhow::Result<IndexMetadata> {
|
pub async fn get_index(&self, uid: String) -> anyhow::Result<IndexMetadata> {
|
||||||
let uuid = self.uuid_resolver.resolve(uid.clone()).await?;
|
let uuid = self.uuid_resolver.resolve(uid.clone()).await?;
|
||||||
let meta = self.index_handle.get_index_meta(uuid).await?;
|
let meta = self.index_handle.get_index_meta(uuid).await?;
|
||||||
let meta = IndexMetadata { uid, meta };
|
let meta = IndexMetadata { name: uid.clone(), uid, meta };
|
||||||
Ok(meta)
|
Ok(meta)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user