feat: implement full-text search functionality with API integration, add search router and persistence logic, and create related schemas and tests
This commit is contained in:
@@ -25,6 +25,8 @@ pub struct Model {
|
||||
pub reply_to_id: Option<Uuid>,
|
||||
pub visibility: Visibility,
|
||||
pub created_at: DateTimeWithTimeZone,
|
||||
#[sea_orm(column_type = "custom(\"tsvector\")", nullable, ignore)]
|
||||
pub search_document: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
|
@@ -19,6 +19,8 @@ pub struct Model {
|
||||
pub custom_css: Option<String>,
|
||||
pub created_at: DateTimeWithTimeZone,
|
||||
pub updated_at: DateTimeWithTimeZone,
|
||||
#[sea_orm(column_type = "custom(\"tsvector\")", nullable, ignore)]
|
||||
pub search_document: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
|
@@ -1,3 +1,4 @@
|
||||
pub mod api_key;
|
||||
pub mod search;
|
||||
pub mod thought;
|
||||
pub mod user;
|
||||
|
9
thoughts-backend/models/src/schemas/search.rs
Normal file
9
thoughts-backend/models/src/schemas/search.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
use super::{thought::ThoughtListSchema, user::UserListSchema};
|
||||
use serde::Serialize;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
#[derive(Serialize, ToSchema)]
|
||||
pub struct SearchResultsSchema {
|
||||
pub users: UserListSchema,
|
||||
pub thoughts: ThoughtListSchema,
|
||||
}
|
Reference in New Issue
Block a user