Meilisearch FTS backend implementation (closes #1482)

This commit is contained in:
mdecimus
2025-12-14 15:21:27 +01:00
parent 8e85a616ff
commit 89f0229191
18 changed files with 1046 additions and 136 deletions

View File

@@ -25,6 +25,8 @@ use std::{borrow::Cow, sync::Arc};
use utils::config::cron::SimpleCron;
use write::ValueClass;
use crate::backend::{elastic::ElasticSearchStore, meili::MeiliSearchStore};
pub trait Deserialize: Sized + Sync + Send {
fn deserialize(bytes: &[u8]) -> trc::Result<Self>;
fn deserialize_owned(bytes: Vec<u8>) -> trc::Result<Self> {
@@ -184,7 +186,8 @@ pub enum BlobBackend {
#[derive(Clone)]
pub enum SearchStore {
Store(Store),
ElasticSearch(Arc<backend::elastic::ElasticSearchStore>),
ElasticSearch(Arc<ElasticSearchStore>),
MeiliSearch(Arc<MeiliSearchStore>),
}
#[derive(Clone, Debug)]
@@ -280,12 +283,18 @@ impl From<backend::azure::AzureStore> for BlobStore {
}
}
impl From<backend::elastic::ElasticSearchStore> for SearchStore {
fn from(store: backend::elastic::ElasticSearchStore) -> Self {
impl From<ElasticSearchStore> for SearchStore {
fn from(store: ElasticSearchStore) -> Self {
Self::ElasticSearch(Arc::new(store))
}
}
impl From<MeiliSearchStore> for SearchStore {
fn from(store: MeiliSearchStore) -> Self {
Self::MeiliSearch(Arc::new(store))
}
}
#[cfg(feature = "redis")]
impl From<backend::redis::RedisStore> for InMemoryStore {
fn from(store: backend::redis::RedisStore) -> Self {