Closed
Description
正则表达式模式下搜索失效
Is there an existing issue for this?
- I have searched the existing issues
Can the issue be reproduced with the default theme (daylight/midnight)?
- I was able to reproduce the issue with the default theme
Could the issue be due to extensions?
- I've ruled out the possibility that the extension is causing the problem.
Describe the problem
使用正则表达式模式进行搜索时无搜索结果, API /api/search/fullTextSearchBlock
响应体 data.blocks
字段值为空数组, data.matchedRootCount
与 data.matchedBlockCount
字段值不为 0
No search results when searching using regular expression mode, API /api/search/fullTextSearchBlock
response body data.blocks
field value is an empty array, data.matchedRootCount
and data.matchedBlockCount
field values are not '0'
Expected result
API /api/search/fullTextSearchBlock
响应体 data.blocks
字段值为正常的查询结果
API /api/search/fullTextSearchBlock
response body data.blocks
field value is normal query results
Screenshot or screen recording presentation
No response
Version environment
- Version: 2.8.3-dev1
- Operating System:
- Browser (if used):
Log file
无有效信息输出
No valid information output
More information
No response
Metadata
Metadata
Assignees
Type
Projects
Relationships
Development
No branches or pull requests
Activity
[-]正则表达式模式下搜索失效 | The search fails in regular expression mode[/-][+]The search fails in regular expression mode[/+]88250 commentedon Apr 2, 2023
I've tested fine here:
Please give the regular expression used for testing and the data of the content block to be searched, thank you.
Zuoqiu-Yingyi commentedon Apr 2, 2023
排序方案使用
按相关度降序/升序
The sorting scheme uses
Relevance DESC/ASC
请求体 | Request body
[-]The search fails in regular expression mode[/-][+]The search fails in regular expression with order by Relevance[/+][-]The search fails in regular expression with order by Relevance[/-][+]The search fails in regular expression with order by relevance[/+]88250 commentedon Apr 3, 2023
已经确认问题,同时也发现另一个问题,即相关度排序是通过 FTS 查询语法实现的(排序字段是
rank
),也就是说正则表达式和 SQL 搜索实际上不能使用 FTS 相关度排序,下个版本会将该情况下强制使用sort
字段和内置的相关度算法进行排序。The problem has been confirmed, and another problem has been found, that is, the correlation ranking is implemented through the FTS query syntax (the sorting field is
rank
), which means that regular expressions and SQL searches cannot actually use relevance ranking provided by FTS, the next version will force sorting using thesort
field and built-in relevance algorithm in this case.[-]The search fails in regular expression with order by relevance[/-][+]The search fails in regular expression/SQL with order by relevance[/+][-]The search fails in regular expression/SQL with order by relevance[/-][+]The search fails in REGEXP/SQL with order by relevance[/+]🐛 The search fails in REGEXP/SQL with order by relevance Fix #7861
🐛 The search fails in REGEXP/SQL with order by relevance Fix #7861