element-hq / element-hq/element-meta
[Story] Search for messages
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 112
- Forks
- 26
- Avg merge
- 6h 6m
- Merged PRs (30d)
- 4
Description
### Description
The search will find the messages by:
* text message content
* the filename of the media/attachment
* the caption of the media/attachment
For start the search algorithm will assume English in all rooms, if the results are poor in non-English rooms, it needs to be enhanced by allowing the user somehow specify the language or auto-detect it based on content.
The largest technical challenge is that it is impossible to ensure we can find any message in any room because the mobile device may not have yet all the messages or not all of them may be yet indexed. It is also not feasible to blindly go and fetch all messages in all rooms and index all of them at full speed as this may overload the server as well as drain user's battery and 5G bandwidth.
The provisional approach (to be tested and confirmed) is as follows:
* Back-paginate (fetch) and index messages up to 3 months in the 100 most recent rooms.
* Process last week of all those 100 rooms, then the week before that for all those rooms, etc.
All the parameters here (3 months, 100 most recent and weekly batches) are easily adjustable if that leads to a better experience.
The fetching and indexing will take happen:
* In the background when the device is connected to the power source and wifi.
* In the foreground when user goes to searching for messages.
Designs:
* [iOS](https://www.figma.com/design/jFIZitqmUlE7P2tUIwXphe/Global-Search?node-id=206-14891&t=lxOjyUTLtyvygj48-4)
# Acceptance criteria
- TBD
# Dependencies
- None
# Out of scope
- A stretch goal: highlight the search term in the message when showing the search results. This may be non-trivial as the search term may be somewhere in the middle or end of a long message.
# Questions
- [x] None
# Subtasks
### Android
-
### iOS
-
### Rust
-
### Other
-
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked iOS Figma design and determine which Android, iOS, and Rust subtasks need separate implementation issues. Clarify the TBD acceptance criteria, indexing and fetching scope, and adjustable parameters before changing code. Done should include agreed platform subtasks and testable search behavior for message text, attachment filenames, and captions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, ios, rust
- Domain
- mobile-dev, search
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100