implements the synonyms in transplant

This commit is contained in:
Tamo 2021-06-03 14:19:56 +02:00 committed by marin postma
parent b119bb4ab0
commit 18d4d6097a
No known key found for this signature in database
GPG key ID: 6088B7721C3E39F9
8 changed files with 50 additions and 56 deletions

View file

@ -15,7 +15,6 @@ pub mod key;
pub mod search;
pub mod settings;
pub mod stats;
pub mod synonym;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "name")]

View file

@ -97,6 +97,12 @@ make_setting_route!(
stop_words
);
make_setting_route!(
"/indexes/{index_uid}/settings/synonyms",
std::collections::BTreeMap<String, Vec<String>>,
synonyms
);
make_setting_route!(
"/indexes/{index_uid}/settings/distinct-attribute",
String,
@ -131,6 +137,7 @@ create_services!(
searchable_attributes,
distinct_attribute,
stop_words,
synonyms,
ranking_rules
);

View file

@ -1,47 +0,0 @@
use std::collections::BTreeMap;
use actix_web::{delete, get, post};
use actix_web::{web, HttpResponse};
use crate::error::ResponseError;
use crate::helpers::Authentication;
use crate::routes::IndexParam;
use crate::Data;
pub fn services(cfg: &mut web::ServiceConfig) {
cfg.service(get).service(update).service(delete);
}
#[get(
"/indexes/{index_uid}/settings/synonyms",
wrap = "Authentication::Private"
)]
async fn get(
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
#[post(
"/indexes/{index_uid}/settings/synonyms",
wrap = "Authentication::Private"
)]
async fn update(
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
_body: web::Json<BTreeMap<String, Vec<String>>>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
#[delete(
"/indexes/{index_uid}/settings/synonyms",
wrap = "Authentication::Private"
)]
async fn delete(
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}