Skip to content

Conversation

@devilb2103
Copy link
Contributor

@devilb2103 devilb2103 commented Dec 5, 2025

Summary

Added global search functionality that searches through both conversation titles and message content.

Instead of modifying the existing getConvosByCursor function, a new dedicated searchConversations method was created to maintain separation of concerns:

  • getConvosByCursor → Lightweight conversation listing (unchanged, title-only search)
  • searchConversations → Global search across titles + message content

Changes:

  • Added searchConversations() method in api/models/Conversation.js that queries both Conversation and Message MeiliSearch indexes in parallel
  • Updated api/server/routes/convos.js to use searchConversations when search param is provided, otherwise falls back to getConvosByCursor

Change Type

  • New feature (non-breaking change which adds functionality)

Testing

  1. Ensure MeiliSearch is configured and running
  2. Create conversations with various titles and message content
  3. Test regular listing (no search) → should work as before
  4. Test search functionality:
    • Terms in conversation titles → should return matches
    • Terms in message content → should now return matches
    • Terms in both → should return deduplicated results
  5. Test with archived conversations (isArchived=true)

Test Configuration:

  • MeiliSearch enabled with SEARCH=true
  • Existing indexed conversations and messages

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • My changes do not introduce new warnings
  • Local unit tests pass with my changes

- Updated the conversation search functionality to simultaneously search both conversation titles and message content, improving the relevance of search results.
- Implemented parallel searches using MeiliSearch for both conversations and messages, and combined the results to ensure deduplication of conversation IDs.
- This enhancement allows users to find conversations based on message content, providing a more comprehensive search experience.
- Added a new `searchConversations` function to enable global search across conversation titles and message content, enhancing the search capabilities for users.
- The function supports pagination, filtering by archived status, tags, and sorting order, providing a comprehensive search experience.
- Updated the conversation routes to utilize the new search functionality, allowing for more flexible and efficient retrieval of conversations based on user queries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant