🕵️ refactor: Optimize Message Search Performance (#9818)

* 🕵️ feat: Enhance Index Sync and MeiliSearch filtering for User Field

- Implemented `ensureFilterableAttributes` function to configure MeiliSearch indexes for messages and conversations to filter by user.
- Updated sync logic to trigger a full re-sync if the user field is missing or index settings are modified.
- Adjusted search queries in Conversation and Message models to include user filtering.
- Ensured 'user' field is marked as filterable in MongoDB schema for both messages and conversations.

This update improves data integrity and search capabilities by ensuring user-related data is properly indexed and retrievable.

* fix: message processing in Search component to use linear list and not tree

* feat: Implement user filtering in MeiliSearch for shared links

* refactor: Optimize message search retrieval by batching database calls

* chore: Update MeiliSearch parameters type to use SearchParams for improved type safety
This commit is contained in:
Danny Avila 2025-09-24 16:27:34 -04:00 committed by GitHub
parent f9aebeba92
commit 57f8b333bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 263 additions and 31 deletions

View file

@ -19,6 +19,7 @@ const convoSchema: Schema<IConversation> = new Schema(
user: {
type: String,
index: true,
meiliIndex: true,
},
messages: [{ type: Schema.Types.ObjectId, ref: 'Message' }],
agentOptions: {

View file

@ -21,6 +21,7 @@ const messageSchema: Schema<IMessage> = new Schema(
index: true,
required: true,
default: null,
meiliIndex: true,
},
model: {
type: String,