我有一个索引rt,配置如下
index rt
{
type = rt
min_stemming_len = 4
morphology = stem_en
wordforms = /home/mis/syns.txt
exceptions = /home/mis/exp.txt
# english charset defined with alias
#charset_table = 0..9, english, _
phrase_boundary = ., ?, !
path = /var/lib/sphinxsearch/data/rt
rt_field = title
rt_field = content
rt_attr_string = content
rt_attr_string = title
rt_attr_uint = gid
}索引中的数据是
mysql> select * from rt;
+------+------+--------------------------------------------------------------------+-------+
| id | gid | content | title |
+------+------+--------------------------------------------------------------------+-------+
| 1 | 2 | This is a test with walks. Then No data shown. Wow This is fine. | test1 |
| 2 | 2 | This is a test with walks | test1 |
+------+------+--------------------------------------------------------------------+-------+
2 rows in set (0.00 sec)我只想得到“哇,这很好”。从rt索引到代码段。我为索引设置了边界。这样我就可以对spippent使用use_boundaries选项。但是我仍然没有得到预期的结果。
SELECT id, SNIPPET(content, 'wow', 'use_boundaries=1') as t FROM rt;
+------+---------------------------------------------------------------------------+
| id | t |
+------+---------------------------------------------------------------------------+
| 1 | This is a test with walks. Then No data shown. <b>Wow</b> This is fine. |
| 2 | This is a test with walks |
+------+---------------------------------------------------------------------------+
2 rows in set (0.01 sec)无论如何,我都可以使用phrase_boundary通过‘语句’返回结果
发布于 2017-02-15 20:30:28
看不到任何use_boundaries不能工作的原因。
听起来你也想让limit_passages=1只得到结果中的一段。
也可能是allow_empty=1,用于处理第二个文档,其中无法突出显示查询单词。
https://stackoverflow.com/questions/42241671
复制相似问题