element-hq / element-hq/element-meta

[Story] Search for messages

Open
#3,252 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

App: ElementX Android App: ElementX iOS T-User Story Team: Element X Platform
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.