mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-10 21:48:48 +08:00
feat(native): native reader for indexer (#14055)
This commit is contained in:
@@ -3,6 +3,7 @@ pub mod blob_sync;
|
||||
pub mod doc;
|
||||
pub mod doc_sync;
|
||||
pub mod error;
|
||||
pub mod indexer;
|
||||
pub mod pool;
|
||||
pub mod storage;
|
||||
|
||||
@@ -117,6 +118,20 @@ impl DocStoragePool {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[napi]
|
||||
pub async fn crawl_doc_data(
|
||||
&self,
|
||||
universal_id: String,
|
||||
doc_id: String,
|
||||
) -> Result<indexer::NativeCrawlResult> {
|
||||
let result = self
|
||||
.get(universal_id)
|
||||
.await?
|
||||
.crawl_doc_data(&doc_id)
|
||||
.await?;
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
#[napi]
|
||||
pub async fn set_space_id(&self, universal_id: String, space_id: String) -> Result<()> {
|
||||
self.get(universal_id).await?.set_space_id(space_id).await?;
|
||||
|
||||
Reference in New Issue
Block a user