From 95912e266ca12a854c526b9912587b426fcea17e Mon Sep 17 00:00:00 2001 From: Bartosz Sypytkowski Date: Mon, 24 Jun 2024 07:45:56 +0200 Subject: [PATCH] fix: add types removed after rebase --- libs/database-entity/src/dto.rs | 6 ++++++ .../appflowy-collaborate/src/indexer/document_indexer.rs | 3 ++- services/appflowy-collaborate/src/indexer/indexer.rs | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libs/database-entity/src/dto.rs b/libs/database-entity/src/dto.rs index 27c7397c..68d01066 100644 --- a/libs/database-entity/src/dto.rs +++ b/libs/database-entity/src/dto.rs @@ -822,6 +822,12 @@ pub struct PublishCollabMetadata { pub metadata: Metadata, } +#[derive(Debug)] +pub struct PublishCollabItem { + pub meta: PublishCollabMetadata, + pub data: Data, +} + /// Indexing status of a document. #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub enum IndexingStatus { diff --git a/services/appflowy-collaborate/src/indexer/document_indexer.rs b/services/appflowy-collaborate/src/indexer/document_indexer.rs index 67edd87b..c185422d 100644 --- a/services/appflowy-collaborate/src/indexer/document_indexer.rs +++ b/services/appflowy-collaborate/src/indexer/document_indexer.rs @@ -64,7 +64,8 @@ impl Indexer for DocumentIndexer { encoding_format: EmbeddingEncodingFormat::Float, dimensions: 1536, }) - .await?; + .await + .map_err(|e| AppError::Internal(e.into()))?; for embedding in resp.data { let param = &mut params[embedding.index as usize]; diff --git a/services/appflowy-collaborate/src/indexer/indexer.rs b/services/appflowy-collaborate/src/indexer/indexer.rs index 4f11a862..7a13cffc 100644 --- a/services/appflowy-collaborate/src/indexer/indexer.rs +++ b/services/appflowy-collaborate/src/indexer/indexer.rs @@ -49,7 +49,7 @@ impl IndexerProvider { let uuid = Uuid::parse_str(workspace_id)?; let settings = select_workspace_settings(&self.db, &uuid).await?; match settings { - Some(settings) if settings.disable_indexing => Ok(None), + Some(settings) if settings.disable_search_indexing => Ok(None), _ => Ok(indexer), } }