mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
fix some uses cases on settings
This commit is contained in:
parent
5c49f08bb2
commit
50a9825a0f
5 changed files with 92 additions and 72 deletions
|
@ -1,6 +1,7 @@
|
|||
use chrono::{DateTime, Utc};
|
||||
use log::error;
|
||||
use meilisearch_core::ProcessedUpdateResult;
|
||||
use meilisearch_schema::Schema;
|
||||
use rand::seq::SliceRandom;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::json;
|
||||
|
@ -94,6 +95,7 @@ pub async fn get_index(ctx: Request<Data>) -> SResult<Response> {
|
|||
struct IndexCreateRequest {
|
||||
name: Option<String>,
|
||||
uid: Option<String>,
|
||||
attribute_identifier: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
|
@ -148,6 +150,10 @@ pub async fn create_index(mut ctx: Request<Data>) -> SResult<Response> {
|
|||
.updated_at(&writer)?
|
||||
.into_internal_error()?;
|
||||
|
||||
if let Some(id) = body.attribute_identifier {
|
||||
created_index.main.put_schema(&mut writer, &Schema::with_identifier(id))?;
|
||||
}
|
||||
|
||||
writer.commit()?;
|
||||
|
||||
let response_body = IndexCreateResponse {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue