mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-23 13:02:21 +08:00
feat(core): use cloud indexer for search (#12899)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added enhanced error handling and user-friendly error messages in quick search and document search menus. - Introduced loading state indicators for search operations. - Quick Search now provides explicit error feedback in the UI. - **Improvements** - Search and aggregation operations can now prefer remote or local indexers based on user or system preference. - Streamlined indexer logic for more consistent and reliable search experiences. - Refined error handling in messaging and synchronization layers for improved stability. - Enhanced error object handling in messaging for clearer error propagation. - Updated cloud workspace storage to always use IndexedDB locally and CloudIndexer remotely. - Shifted indexer operations to use synchronized indexer layer for better consistency. - Simplified indexer client by consolidating storage and sync layers. - Improved error propagation in messaging handlers by wrapping error objects. - Updated document search to prioritize remote indexer results by default. - **Bug Fixes** - Improved robustness of search features by handling errors gracefully and preventing potential runtime issues. - **Style** - Added new styles for displaying error messages in search interfaces. - **Chores** - Removed the obsolete "Enable Cloud Indexer" feature flag; cloud indexer behavior is now always enabled where applicable. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -265,16 +265,6 @@ class StoreConsumer {
|
||||
}),
|
||||
'awarenessSync.collect': ({ collectId, awareness }) =>
|
||||
collectJobs.get(collectId)?.(awareness),
|
||||
'indexerStorage.aggregate': ({ table, query, field, options }) =>
|
||||
this.indexerStorage.aggregate(table, query, field, options),
|
||||
'indexerStorage.search': ({ table, query, options }) =>
|
||||
this.indexerStorage.search(table, query, options),
|
||||
'indexerStorage.subscribeSearch': ({ table, query, options }) =>
|
||||
this.indexerStorage.search$(table, query, options),
|
||||
'indexerStorage.subscribeAggregate': ({ table, query, field, options }) =>
|
||||
this.indexerStorage.aggregate$(table, query, field, options),
|
||||
'indexerStorage.waitForConnected': (_, ctx) =>
|
||||
this.indexerStorage.connection.waitForConnected(ctx.signal),
|
||||
'indexerSync.state': () => this.indexerSync.state$,
|
||||
'indexerSync.docState': (docId: string) =>
|
||||
this.indexerSync.docState$(docId),
|
||||
@@ -287,6 +277,14 @@ class StoreConsumer {
|
||||
this.indexerSync.waitForCompleted(ctx.signal),
|
||||
'indexerSync.waitForDocCompleted': (docId: string, ctx) =>
|
||||
this.indexerSync.waitForDocCompleted(docId, ctx.signal),
|
||||
'indexerSync.aggregate': ({ table, query, field, options }) =>
|
||||
this.indexerSync.aggregate(table, query, field, options),
|
||||
'indexerSync.search': ({ table, query, options }) =>
|
||||
this.indexerSync.search(table, query, options),
|
||||
'indexerSync.subscribeSearch': ({ table, query, options }) =>
|
||||
this.indexerSync.search$(table, query, options),
|
||||
'indexerSync.subscribeAggregate': ({ table, query, field, options }) =>
|
||||
this.indexerSync.aggregate$(table, query, field, options),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user