mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-19 09:35:51 +08:00
fmt
This commit is contained in:
parent
ff49250c1a
commit
e579554c84
@ -31,7 +31,6 @@ use crate::routes::Pagination;
|
|||||||
You must have the master key or the default admin key to access the keys route. More information about the keys and their rights.
|
You must have the master key or the default admin key to access the keys route. More information about the keys and their rights.
|
||||||
Accessing any route under `/keys` without having set a master key will result in an error.",
|
Accessing any route under `/keys` without having set a master key will result in an error.",
|
||||||
external_docs(url = "https://www.meilisearch.com/docs/reference/api/keys"),
|
external_docs(url = "https://www.meilisearch.com/docs/reference/api/keys"),
|
||||||
|
|
||||||
)),
|
)),
|
||||||
)]
|
)]
|
||||||
pub struct ApiKeyApi;
|
pub struct ApiKeyApi;
|
||||||
@ -50,7 +49,6 @@ pub fn configure(cfg: &mut web::ServiceConfig) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Create an API Key
|
/// Create an API Key
|
||||||
///
|
///
|
||||||
/// Create an API Key.
|
/// Create an API Key.
|
||||||
@ -130,7 +128,6 @@ impl ListApiKeys {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Get API Keys
|
/// Get API Keys
|
||||||
///
|
///
|
||||||
/// List all API Keys
|
/// List all API Keys
|
||||||
@ -201,7 +198,6 @@ pub async fn list_api_keys(
|
|||||||
Ok(HttpResponse::Ok().json(page_view))
|
Ok(HttpResponse::Ok().json(page_view))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Get an API Key
|
/// Get an API Key
|
||||||
///
|
///
|
||||||
/// Get an API key from its `uid` or its `key` field.
|
/// Get an API key from its `uid` or its `key` field.
|
||||||
@ -266,7 +262,6 @@ pub async fn get_api_key(
|
|||||||
Ok(HttpResponse::Ok().json(res))
|
Ok(HttpResponse::Ok().json(res))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Update a Key
|
/// Update a Key
|
||||||
///
|
///
|
||||||
/// Update the name and description of an API key.
|
/// Update the name and description of an API key.
|
||||||
@ -334,8 +329,6 @@ pub async fn patch_api_key(
|
|||||||
Ok(HttpResponse::Ok().json(res))
|
Ok(HttpResponse::Ok().json(res))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// Delete a key
|
/// Delete a key
|
||||||
///
|
///
|
||||||
/// Delete the specified API key.
|
/// Delete the specified API key.
|
||||||
|
@ -22,7 +22,6 @@ use crate::extractors::sequential_extractor::SeqHandler;
|
|||||||
name = "Batches",
|
name = "Batches",
|
||||||
description = "The /batches route gives information about the progress of batches of asynchronous operations.",
|
description = "The /batches route gives information about the progress of batches of asynchronous operations.",
|
||||||
external_docs(url = "https://www.meilisearch.com/docs/reference/api/batches"),
|
external_docs(url = "https://www.meilisearch.com/docs/reference/api/batches"),
|
||||||
|
|
||||||
)),
|
)),
|
||||||
)]
|
)]
|
||||||
pub struct BatchesApi;
|
pub struct BatchesApi;
|
||||||
|
@ -28,7 +28,6 @@ all indexes contained in the indicated `.dump` file are imported along with thei
|
|||||||
Any existing index with the same uid as an index in the dump file will be overwritten.
|
Any existing index with the same uid as an index in the dump file will be overwritten.
|
||||||
Dump imports are [performed at launch](https://www.meilisearch.com/docs/learn/advanced/dumps#importing-a-dump) using an option.",
|
Dump imports are [performed at launch](https://www.meilisearch.com/docs/learn/advanced/dumps#importing-a-dump) using an option.",
|
||||||
external_docs(url = "https://www.meilisearch.com/docs/reference/api/dump"),
|
external_docs(url = "https://www.meilisearch.com/docs/reference/api/dump"),
|
||||||
|
|
||||||
)),
|
)),
|
||||||
)]
|
)]
|
||||||
pub struct DumpApi;
|
pub struct DumpApi;
|
||||||
|
@ -24,7 +24,6 @@ use crate::extractors::sequential_extractor::SeqHandler;
|
|||||||
|
|
||||||
This route is **synchronous**. This means that no task object will be returned, and any activated or deactivated features will be made available or unavailable immediately.",
|
This route is **synchronous**. This means that no task object will be returned, and any activated or deactivated features will be made available or unavailable immediately.",
|
||||||
external_docs(url = "https://www.meilisearch.com/docs/reference/api/experimental_features"),
|
external_docs(url = "https://www.meilisearch.com/docs/reference/api/experimental_features"),
|
||||||
|
|
||||||
)),
|
)),
|
||||||
)]
|
)]
|
||||||
pub struct ExperimentalFeaturesApi;
|
pub struct ExperimentalFeaturesApi;
|
||||||
|
@ -26,7 +26,6 @@ use crate::extractors::authentication::GuardedData;
|
|||||||
use crate::extractors::sequential_extractor::SeqHandler;
|
use crate::extractors::sequential_extractor::SeqHandler;
|
||||||
use crate::{LogRouteHandle, LogStderrHandle};
|
use crate::{LogRouteHandle, LogStderrHandle};
|
||||||
|
|
||||||
|
|
||||||
#[derive(OpenApi)]
|
#[derive(OpenApi)]
|
||||||
#[openapi(
|
#[openapi(
|
||||||
paths(get_logs, cancel_logs, update_stderr_target),
|
paths(get_logs, cancel_logs, update_stderr_target),
|
||||||
@ -35,7 +34,6 @@ use crate::{LogRouteHandle, LogStderrHandle};
|
|||||||
description = "Everything about retrieving or customizing logs.
|
description = "Everything about retrieving or customizing logs.
|
||||||
Currently [experimental](https://www.meilisearch.com/docs/learn/experimental/overview).",
|
Currently [experimental](https://www.meilisearch.com/docs/learn/experimental/overview).",
|
||||||
external_docs(url = "https://www.meilisearch.com/docs/learn/experimental/log_customization"),
|
external_docs(url = "https://www.meilisearch.com/docs/learn/experimental/log_customization"),
|
||||||
|
|
||||||
)),
|
)),
|
||||||
)]
|
)]
|
||||||
pub struct LogsApi;
|
pub struct LogsApi;
|
||||||
@ -350,7 +348,6 @@ pub async fn get_logs(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Stop retrieving logs
|
/// Stop retrieving logs
|
||||||
///
|
///
|
||||||
/// Call this route to make the engine stops sending logs through the `POST /logs/stream` route.
|
/// Call this route to make the engine stops sending logs through the `POST /logs/stream` route.
|
||||||
|
@ -5,17 +5,14 @@ use crate::search_queue::SearchQueue;
|
|||||||
use actix_web::http::header;
|
use actix_web::http::header;
|
||||||
use actix_web::web::{self, Data};
|
use actix_web::web::{self, Data};
|
||||||
use actix_web::HttpResponse;
|
use actix_web::HttpResponse;
|
||||||
use index_scheduler::IndexScheduler;
|
use index_scheduler::{IndexScheduler, Query};
|
||||||
use meilisearch_auth::AuthController;
|
use meilisearch_auth::AuthController;
|
||||||
use meilisearch_types::error::ResponseError;
|
use meilisearch_types::error::ResponseError;
|
||||||
use meilisearch_types::keys::actions;
|
use meilisearch_types::keys::actions;
|
||||||
use prometheus::{Encoder, TextEncoder};
|
|
||||||
use utoipa::OpenApi;
|
|
||||||
|
|
||||||
use time::OffsetDateTime;
|
|
||||||
|
|
||||||
use index_scheduler::Query;
|
|
||||||
use meilisearch_types::tasks::Status;
|
use meilisearch_types::tasks::Status;
|
||||||
|
use prometheus::{Encoder, TextEncoder};
|
||||||
|
use time::OffsetDateTime;
|
||||||
|
use utoipa::OpenApi;
|
||||||
|
|
||||||
#[derive(OpenApi)]
|
#[derive(OpenApi)]
|
||||||
#[openapi(paths(get_metrics))]
|
#[openapi(paths(get_metrics))]
|
||||||
|
@ -1,22 +1,5 @@
|
|||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
|
||||||
use crate::extractors::authentication::policies::*;
|
|
||||||
use crate::extractors::authentication::GuardedData;
|
|
||||||
use crate::milli::progress::ProgressStepView;
|
|
||||||
use crate::milli::progress::ProgressView;
|
|
||||||
use crate::routes::batches::AllBatches;
|
|
||||||
use crate::routes::features::RuntimeTogglableFeatures;
|
|
||||||
use crate::routes::indexes::documents::DocumentDeletionByFilter;
|
|
||||||
use crate::routes::indexes::documents::DocumentEditionByFunction;
|
|
||||||
use crate::routes::indexes::IndexView;
|
|
||||||
use crate::routes::multi_search::SearchResults;
|
|
||||||
use crate::routes::swap_indexes::SwapIndexesPayload;
|
|
||||||
use crate::search::{
|
|
||||||
FederatedSearch, FederatedSearchResult, Federation, FederationOptions, MergeFacets,
|
|
||||||
SearchQueryWithIndex, SearchResultWithIndex, SimilarQuery, SimilarResult,
|
|
||||||
};
|
|
||||||
use crate::search_queue::SearchQueue;
|
|
||||||
use crate::Opt;
|
|
||||||
use actix_web::web::Data;
|
use actix_web::web::Data;
|
||||||
use actix_web::{web, HttpRequest, HttpResponse};
|
use actix_web::{web, HttpRequest, HttpResponse};
|
||||||
use index_scheduler::IndexScheduler;
|
use index_scheduler::IndexScheduler;
|
||||||
@ -41,11 +24,24 @@ use utoipa_scalar::{Scalar, Servable as ScalarServable};
|
|||||||
use self::api_key::KeyView;
|
use self::api_key::KeyView;
|
||||||
use self::indexes::documents::BrowseQuery;
|
use self::indexes::documents::BrowseQuery;
|
||||||
use self::indexes::{IndexCreateRequest, IndexStats, UpdateIndexRequest};
|
use self::indexes::{IndexCreateRequest, IndexStats, UpdateIndexRequest};
|
||||||
use self::logs::GetLogs;
|
use self::logs::{GetLogs, LogMode, UpdateStderrLogs};
|
||||||
use self::logs::LogMode;
|
|
||||||
use self::logs::UpdateStderrLogs;
|
|
||||||
use self::open_api_utils::OpenApiAuth;
|
use self::open_api_utils::OpenApiAuth;
|
||||||
use self::tasks::AllTasks;
|
use self::tasks::AllTasks;
|
||||||
|
use crate::extractors::authentication::policies::*;
|
||||||
|
use crate::extractors::authentication::GuardedData;
|
||||||
|
use crate::milli::progress::{ProgressStepView, ProgressView};
|
||||||
|
use crate::routes::batches::AllBatches;
|
||||||
|
use crate::routes::features::RuntimeTogglableFeatures;
|
||||||
|
use crate::routes::indexes::documents::{DocumentDeletionByFilter, DocumentEditionByFunction};
|
||||||
|
use crate::routes::indexes::IndexView;
|
||||||
|
use crate::routes::multi_search::SearchResults;
|
||||||
|
use crate::routes::swap_indexes::SwapIndexesPayload;
|
||||||
|
use crate::search::{
|
||||||
|
FederatedSearch, FederatedSearchResult, Federation, FederationOptions, MergeFacets,
|
||||||
|
SearchQueryWithIndex, SearchResultWithIndex, SimilarQuery, SimilarResult,
|
||||||
|
};
|
||||||
|
use crate::search_queue::SearchQueue;
|
||||||
|
use crate::Opt;
|
||||||
|
|
||||||
const PAGINATION_DEFAULT_LIMIT: usize = 20;
|
const PAGINATION_DEFAULT_LIMIT: usize = 20;
|
||||||
const PAGINATION_DEFAULT_LIMIT_FN: fn() -> usize = || 20;
|
const PAGINATION_DEFAULT_LIMIT_FN: fn() -> usize = || 20;
|
||||||
|
@ -18,8 +18,8 @@ use crate::extractors::authentication::{AuthenticationError, GuardedData};
|
|||||||
use crate::extractors::sequential_extractor::SeqHandler;
|
use crate::extractors::sequential_extractor::SeqHandler;
|
||||||
use crate::routes::indexes::search::search_kind;
|
use crate::routes::indexes::search::search_kind;
|
||||||
use crate::search::{
|
use crate::search::{
|
||||||
add_search_rules, perform_federated_search, perform_search, FederatedSearch, FederatedSearchResult, RetrieveVectors,
|
add_search_rules, perform_federated_search, perform_search, FederatedSearch,
|
||||||
SearchQueryWithIndex, SearchResultWithIndex,
|
FederatedSearchResult, RetrieveVectors, SearchQueryWithIndex, SearchResultWithIndex,
|
||||||
};
|
};
|
||||||
use crate::search_queue::SearchQueue;
|
use crate::search_queue::SearchQueue;
|
||||||
|
|
||||||
@ -30,7 +30,6 @@ use crate::search_queue::SearchQueue;
|
|||||||
name = "Multi-search",
|
name = "Multi-search",
|
||||||
description = "The `/multi-search` route allows you to perform multiple search queries on one or more indexes by bundling them into a single HTTP request. Multi-search is also known as federated search.",
|
description = "The `/multi-search` route allows you to perform multiple search queries on one or more indexes by bundling them into a single HTTP request. Multi-search is also known as federated search.",
|
||||||
external_docs(url = "https://www.meilisearch.com/docs/reference/api/multi_search"),
|
external_docs(url = "https://www.meilisearch.com/docs/reference/api/multi_search"),
|
||||||
|
|
||||||
)),
|
)),
|
||||||
)]
|
)]
|
||||||
pub struct MultiSearchApi;
|
pub struct MultiSearchApi;
|
||||||
|
@ -24,7 +24,6 @@ During a snapshot export, all indexes of the current instance are exported—tog
|
|||||||
During a snapshot import, all indexes contained in the indicated .snapshot file are imported along with their associated documents and settings.
|
During a snapshot import, all indexes contained in the indicated .snapshot file are imported along with their associated documents and settings.
|
||||||
Snapshot imports are performed at launch using an option.",
|
Snapshot imports are performed at launch using an option.",
|
||||||
external_docs(url = "https://www.meilisearch.com/docs/reference/api/snapshots"),
|
external_docs(url = "https://www.meilisearch.com/docs/reference/api/snapshots"),
|
||||||
|
|
||||||
)),
|
)),
|
||||||
)]
|
)]
|
||||||
pub struct SnapshotApi;
|
pub struct SnapshotApi;
|
||||||
|
@ -33,7 +33,6 @@ use crate::{aggregate_methods, Opt};
|
|||||||
name = "Tasks",
|
name = "Tasks",
|
||||||
description = "The tasks route gives information about the progress of the [asynchronous operations](https://docs.meilisearch.com/learn/advanced/asynchronous_operations.html).",
|
description = "The tasks route gives information about the progress of the [asynchronous operations](https://docs.meilisearch.com/learn/advanced/asynchronous_operations.html).",
|
||||||
external_docs(url = "https://www.meilisearch.com/docs/reference/api/tasks"),
|
external_docs(url = "https://www.meilisearch.com/docs/reference/api/tasks"),
|
||||||
|
|
||||||
)),
|
)),
|
||||||
)]
|
)]
|
||||||
pub struct TaskApi;
|
pub struct TaskApi;
|
||||||
@ -496,7 +495,6 @@ pub struct AllTasks {
|
|||||||
next: Option<u32>,
|
next: Option<u32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Get all tasks
|
/// Get all tasks
|
||||||
///
|
///
|
||||||
/// Get all [tasks](https://docs.meilisearch.com/learn/advanced/asynchronous_operations.html)
|
/// Get all [tasks](https://docs.meilisearch.com/learn/advanced/asynchronous_operations.html)
|
||||||
|
Loading…
Reference in New Issue
Block a user