Commit 1ace25a
feat: add configurable keyword positioning in search results
1. Added positioningMaxLength parameter to HighlightOptions structure to
allow configuration of keyword positioning window size
2. Modified customHighlight function to accept and use this parameter
for better keyword positioning in search results
3. Enforced minimum window size of 30 characters for proper keyword
visibility
4. Updated all function calls to pass the new parameter
5. Improved documentation for the customHighlight function parameters
Log: Added configurable keyword positioning window for better search
result snippets
Influence:
1. Test search results with different positioningMaxLength values (below
30 and above 30)
2. Verify keyword visibility and snippet positioning in results
3. Check HTML highlighting still works when enabled
4. Test with both short and long content samples
5. Verify behavior with empty content or keyword lists
feat: 添加可配置的关键词定位功能
1. 在HighlightOptions结构中添加positioningMaxLength参数,用于配置关键词
定位窗口大小
2. 修改customHighlight函数以接受并使用此参数,改进搜索结果中的关键词定位
3. 强制30个字符的最小窗口尺寸以确保关键词可见性
4. 更新所有函数调用以传递新参数
5. 改进了customHighlight函数的参数文档
Log: 新增可配置关键词定位窗口,改进搜索结果片段显示
Influence:
1. 使用不同的positioningMaxLength值测试搜索结果(小于30和大于30)
2. 验证结果中的关键词可见性和片段定位
3. 检查启用HTML高亮时是否仍正常工作
4. 测试短内容和长内容样本
5. 验证空内容或关键词列表时的行为
Fixes: #3650831 parent ad74c48 commit 1ace25a
4 files changed
Lines changed: 16 additions & 12 deletions
File tree
- include/dfm-search/dfm-search
- src/dfm-search/dfm-search-lib/utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
195 | | - | |
| 194 | + | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
200 | | - | |
| 199 | + | |
| 200 | + | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | | - | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
| 223 | + | |
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
| |||
260 | 261 | | |
261 | 262 | | |
262 | 263 | | |
263 | | - | |
| 264 | + | |
| 265 | + | |
264 | 266 | | |
265 | 267 | | |
266 | 268 | | |
| |||
0 commit comments