在我的结果集中查询最佳结果的同时,我还使用Sphinx生成了一个代码段。为此,我使用以下SELECT
语句:
SELECT id, SNIPPET(Content, '(55byddQ%)') AS Snippet FROM RTTest WHERE MATCH(' (55byddQ%)');
但是,此查询返回了一些错误的结果(例如ID 1):
+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | snippet |
+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 1 | ... 55Hicsn2StA% 7ZE% 7ZHJY87we9v3264rkjaKB1q64UWPlEgAcAb_l90% _oE% <b>55byddQ%</b> udCuJ5W7Ew%% 64z3fsHm ;Jbjc80% ... 0yMqTJfByLxZRwNu9zYXv0m1miVLwus_fxl0<b>ZxNkrfpN</b>GNsG8KeEzr1fn05yTa7fJkq9ZHSjHLB2 ... 55Hicsn2StA% 5ov4 7ZE% 6oHiYsPl<b>Qg%% _oE</b>% ;I37dQ%% _4j5ZA%% 6ov5e8;tQw%% 7ov ... |
| 4 | ... 7IH0ddLsScfhx74tjS6HNgj5z6j2XnY9xWQgdCw% 65bzdM;3QNbp36k2 sd2vdcrxQd;j ;ov5YsDiR8D33ak2jjaJ <b>55byddQ%</b> ;ovkIZezHYC1 u8qgIJCvHYS1n;121GHWbg%% uA%% ... 7ZHk sd2veNPqV9njwQ%% 5p36f8g% 44jzZdToS8TxzKQ2iD2I <b>55byddQ%</b> udanIJS2FA%% v9a6JpayFo23n;xy0w%% uA%% ... |
| 9 | ... utSnJ5awFo0% 4YA% udelKJO3HIe7 uNSjIJazFoK1lvpw1G7bbQ%% <b>55byddQ%</b> vQ%% upP4fsu7V9Dq2LpziTXfPk2Znw%% ;oj5ddToSNHmyqIoiDeK _8r4fA%% ... utSnJZexFoU% 4YA% vdCjJpazE4W1m;p9 uNSkIJazFYWwnP5y12vcbA%% <b>55byddQ%</b> u9emJJa3F4CxmQ%% 7YXlZNbiTw%% utS7IZSuFoSzmg%% utSsI5c% ... |
| 23 | ... 7ov6dMPxVw%% 7pb5fQ%% 4Yrydd7iUN3twQ%% 4Yo% <b>55byddQ%</b> ;Is% 7Zz1fNPnQQ%% 7ov6dMPxVw%% 7pb5fQ%% ... 5oX7ddU% 7pb5fQ%% 4Yrydd7iUN3twQ%% 4Yo% <b>55byddQ%</b> ;Is% 7Zz1fNPnQQ%% 7o36dQ%% ... 7ZzidcjwTdvs3A%% 7pb5fQ%% 4Yrydd7iUN3twQ%% 4Yo% <b>55byddQ%</b> ;Is% 7Zz1fNPnQQ%% 7o36dQ%% ... |
| 29 | ... ;Izz 6YLwecrqRcDn3A%% 54I% 7o36ddQ% 4Yo% <b>55byddQ%</b> ;Is% 54LwddQ% 8Yvj ;Izz _4HkZs;gQcc% ... |
| 34 | ... 7ovkc8Pw _4HgddTiSA%% 6ZHieMnxTcfnyw%% 4IX4dNXrRd;n3A%% 4Yo% <b>55byddQ%</b> ;Is% 6ZHieMPtUN3hzrgh ;Izz 64v4fsPgUN3twQ%% _4s% ... |
+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
正如您在ID 1的代码段中所见,它还在突出显示诸如0yMqTJfByLxZRwNu9zYXv0m1miVLwus_fxl0<b>ZxNkrfpN</b>GNsG8KeEzr1fn05yTa7fJkq9ZHSjHLB2
之类的匹配项,而我正在搜索55byddQ%
。
因此,摘要功能无法向我返回正确的结果,但我不知道为什么不这样做。
配置:
我的词/句子已加密存储,并且始终由a-Z
,0-9
,_
,;
或%
组成,如您在我的配置{{1 }}指令。
配置:
charset_table
编辑: 插入的原始文档字符串为:
index RTTest
{
type = rt
path = /mnt/data001/RTTest
rt_field = Name
rt_field = Extension
rt_field = Content
rt_field = Tags
rt_attr_uint = Reference
rt_attr_uint = FileSize
rt_attr_uint = LastModified
rt_attr_uint = LastModifiedYear
rt_attr_uint = LastModifiedMonth
rt_attr_uint = LastModifiedDay
rt_attr_string = Content
rt_mem_limit = 1024M
charset_table = A..Z, a..z, 0..9, _, ;, %
ondisk_attrs = pool
}
searchd
{
listen = 9306:mysql41
log = /var/log/sphinxsearch/searchd.log
read_timeout = 5
max_children = 30
pid_file = /var/run/searchd.pid
max_packet_size = 128M
binlog_path = /mnt/data001
}