element-hq / element-hq/element-web

EW appears to refuse to display search results for unencrypted room messages at certain times.

Open
#33,496 0 comments 0 reactions 0 assignees View on GitHub
A-Search O-Occasional S-Major T-Defect
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

n/a, see below.

### Outcome

#### What did you expect?
Return search results (messages) containing the specified keywords.

#### What happened instead?
The target room (unencrypted, version 6) has 2 messages, both containing the keywords I specified.
Testing revealed that when I entered the specified keywords to search within this room, EW seems to intentionally reduce the number of search results, even directly displaying "No more results". The image shows the extreme case (i.e., theoretically there should be at least 2 results, but EW returns no search results)..
Image

Keyword used: `惩罚`
URI: `/_matrix/client/v3/search`

**Note: As shown in the figure, EW indicates that it found 19 results; however, in reality, the entire room contains only two messages that include the specified keywords. One of these messages, however, has undergone multiple edits. I suspect that, by design, the search function incorporates the edit history of that message—a behavior I consider inappropriate.**

The following is the data returned by the request (anonymized):
[{4EF8693B-03E5-C211-1B07-56A1CE0B3683}.txt](https://github.com/user-attachments/files/27753288/4EF8693B-03E5-C211-1B07-56A1CE0B3683.txt)
**It can be found in the returned data that the message containing the specified keyword has been found, but EW still refuses to render.**

**In order to meet the needs of the target users, I additionally installed zhparser (which is a word segmenter for Chinese) for Postgres and injected a modified Python script into Synapse. These two parts need to exist at the same time to take effect. The ultimate goal is to improve Chinese message search for non-encrypted rooms.**

### Operating system

x64 Windows 11 (10.0.26200)

### Browser information

Chromium 134.0.6998.136

### URL for webapp

Element Web 1.12.18

### Application version

Element Dwsktop 1.12.18

### Homeserver

Synapse 1.153.0

### Will you send logs?

No

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.