Skip to content

Improve database field sorting for content containing emojis #14323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TCOTC opened this issue Mar 9, 2025 · 10 comments
Closed

Improve database field sorting for content containing emojis #14323

TCOTC opened this issue Mar 9, 2025 · 10 comments
Assignees
Milestone

Comments

@TCOTC
Copy link
Contributor

TCOTC commented Mar 9, 2025

数据库文本字段排序的一点疑问

字段值是特殊符号的情况下是怎么排序的?

感觉这种字符都相同的情况下应该按符号数来排序的:

video.webm
@88250
Copy link
Member

88250 commented Mar 10, 2025

麻烦导出 .sy.zip 上传

@88250 88250 self-assigned this Mar 10, 2025
@TCOTC
Copy link
Contributor Author

TCOTC commented Mar 10, 2025

@88250
Copy link
Member

88250 commented Mar 11, 2025

这个字符 Unicode Character “★” (U+2605),会做作为 emoji 移除,所以相当于比较空字符串:

Image

@88250 88250 closed this as completed Mar 11, 2025
@TCOTC
Copy link
Contributor Author

TCOTC commented Mar 11, 2025

这里是为什么要移除?

@88250
Copy link
Member

88250 commented Mar 11, 2025

不移除的话 emoji 1emoji 2 这种情况排序会失效。

@TCOTC
Copy link
Contributor Author

TCOTC commented Mar 11, 2025

我看 Notion FlowUs wolai Anytype AFFiNE 都是能排序的,思源要不改一下?

@88250
Copy link
Member

88250 commented Mar 11, 2025

这个是之前的需求,最好是不要动了。

@88250
Copy link
Member

88250 commented Mar 11, 2025

可以稍微优化一下,如果文本全部都是 emoji 的情况,按字符串排序,如果不是则去掉 emoji 按拼音排序(之前的逻辑)。

@88250 88250 added this to the 3.1.25 milestone Mar 11, 2025
@TCOTC
Copy link
Contributor Author

TCOTC commented Mar 11, 2025

全部文本 不包含中文字符 的时候 按字符串排序 怎么样?

@88250 88250 changed the title 数据库文本字段排序的一点疑问 Improve database field sorting for content containing emojis Mar 11, 2025
88250 added a commit that referenced this issue Mar 11, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@88250
Copy link
Member

88250 commented Mar 11, 2025

还是按是否包含 emoji 区分好一些

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants