Forgot password?
 Create new account
View 269|Reply 11

关于搜索

[Copy link]

701

Threads

110K

Posts

910K

Credits

Credits
94177
QQ

Show all posts

kuing Posted at 2022-6-10 15:15:28 |Read mode
如果直接在上方搜索条里输入内容再点那个放大镜,那只是搜索标题。

要搜索全文,需进入高级搜索,现已在放大镜右边增加“高级搜索”的链接,方便进入。

801

Threads

4889

Posts

310K

Credits

Credits
36169

Show all posts

isee Posted at 2022-6-10 16:34:51

{:call:}

isee=freeMaths@知乎

701

Threads

110K

Posts

910K

Credits

Credits
94177
QQ

Show all posts

 Author| kuing Posted at 2022-6-10 16:42:42
call 这个表情被我删了 新增了一些表情 (如果表情列表里还没出现,可以清理一下缓存)

701

Threads

110K

Posts

910K

Credits

Credits
94177
QQ

Show all posts

 Author| kuing Posted at 2023-1-29 22:35:45
搜索其他 emoji 也能找到这些帖子,搜出来的帖子似乎都有 emoji,虽然不是同一个,但或许可能是有一个字节相同?

701

Threads

110K

Posts

910K

Credits

Credits
94177
QQ

Show all posts

 Author| kuing Posted at 2023-1-29 23:21:38
kuing 发表于 2023-1-29 22:35
搜索其他 emoji 也能找到这些帖子,搜出来的帖子似乎都有 emoji,虽然不是同一个,但或许可能是有一个字节相同?
钓鱼 emoji 🎣 的 UTF-8 编码是:
\xf0\x9f\x8e\xa3
搜到的第一个“彭赛列?”那帖里我打了一个 emoji 🙄 的 UTF-8 编码是:
\xf0\x9f\x99\x84
前两个相同,于是就搜出来了,是酱紫吧?

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2023-1-29 23:25:54
kuing 发表于 2023-1-29 16:21
前两个相同,于是就搜出来了,是酱紫吧?

有个问题: 为什么前两个相同就能匹配? 中间没有空格, 也不是 or 连接啊

Comment

不知道😁  Posted at 2023-1-29 23:41

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2023-1-29 23:42:13
kuing 发表于 2023-1-29 16:21
钓鱼 emoji 🎣 的 UTF-8 编码是:
\xf0\x9f\x8e\xa3
搜到的第一个“彭赛列?”那帖里我打了一个 emoji 🙄 ...
相关:mb_strpos把Emoji当成一个整体来匹配, 例如
  1. <?php
  2. $text = "11🎣🎣\xf0";
  3. print "mb_stripos\n";
  4. print mb_stripos($text,"\xf0");
  5. print "\nstripos\n";
  6. print stripos($text,"\xf0");
Copy the Code

Output (onlinephp.io/)
  1. mb_stripos
  2. 4
  3. stripos
  4. 2
Copy the Code

mb_stripos把🎣作为整体, 不匹配\xf0
mb_stripos处理较简单, 把🎣作为几个字节, 匹配\xf0

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2023-2-7 08:33:48
Mroonga is a storage engine for MySQL. It provides fast fulltext search feature for all languages including Chinese, Japanese and Korean to all MySQL users.
mroonga.org/

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2023-2-11 23:02:09
通常的搜索引擎会显示关键词所在的上下文, 凭此可在搜索结果中选择, 再点击进入, 很方便.
但Discuz搜索只显示开始几句, 不一定含关键词

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2023-3-5 19:13:04
Discuz!X3.6 开发计划预规划
5. 搜索功能需要继续优化,底线是上线新版 Sphinx ,最好能上线搜索扩展功能从而可以支持多种搜索引擎接入。
——老周部落

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2023-4-19 12:00:30

趁着时间停止,研究一下搜索机制

搜索帖子标题(title)的关键词为a+bBase64编码YSti
搜索范围为全部版块.
后台所进行的MySQL查询为 (为了解释方便,我进行了分行)
  1. SELECT searchid, dateline,
  2. ('10'<>'0' AND uid='2861' AND 1681876835-dateline<'10') AS flood,
  3. (searchstring='forum|title|YSti|0||\\\'5\\\',\\\'6\\\',\\\'14\\\',\\\'7\\\',\\\'11\\\',\\\'12\\\',\\\'13\\\',\\\'9\\\',\\\'10\\\',\\\'2\\\'|0|0|all|||0' AND expiration>'1681876835') AS indexvalid
  4. FROM common_searchindex
  5. WHERE srchmod='2' AND ('10'<>'0' AND uid='2861' AND 1681876835-dateline<10) OR (searchstring='forum|title|YSti|0||\\\'5\\\',\\\'6\\\',\\\'14\\\',\\\'7\\\',\\\'11\\\',\\\'12\\\',\\\'13\\\',\\\'9\\\',\\\'10\\\',\\\'2\\\'|0|0|all|||0' AND expiration>'1681876835')
  6. ORDER BY flood
Copy the Code
先看第一行 SELECT 语句用于从表 common_searchindex 中选择特定的列。被选中的列是 searchid、dateline、flood 和 indexvalid。
第二行('10'<>'0' AND uid='2861' AND 1681876835-dateline<'10') AS flood创建一个名为 flood 的新列,它返回一个布尔值 true 或 false。它检查 uid 为 2861 的当前用户(我)是否在最近 10 秒内进行了搜索。如果是,则 flood 设置为 true,否则设置为 false。
第三行创建另一个名为 indexvalid 的新列,它也返回一个布尔值 true 或 false。它检查searchstring是否有效且expiration未过期,则将 indexvalid 设置为 true,否则设置为 false。
第四行指定了从中选择数据的表,即 common_searchindex。
第五行指定了数据必须满足的条件才能被选中。条件有点复杂。
('10'<>'0' AND uid='2861' AND 1681876835-dateline<10):这个子条件检查uid为2861的当前用户是否在最近10秒内进行了搜索。
第六行“ORDER BY flood”将选中的数据按“flood”列升序排列。

手机版Mobile version|Leisure Math Forum

2025-4-20 22:20 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list