mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-18 08:28:10 +01:00
🕵️ 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:
parent
f9aebeba92
commit
57f8b333bc
9 changed files with 263 additions and 31 deletions
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ const messageSchema: Schema<IMessage> = new Schema(
|
|||
index: true,
|
||||
required: true,
|
||||
default: null,
|
||||
meiliIndex: true,
|
||||
},
|
||||
model: {
|
||||
type: String,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue