Sphinx搜索如何使用空的before_match和after_match

时间:2017-07-31 16:27:54

标签: sphinx sphinxql

使用Sphinx的SNIPPET()功能,如何从查询中删除任何before_matchafter_match?我不希望任何东西缠绕在匹配的文本上。

SNIPPET(field, 'word', 'after_match=""', 'before_match=""')

我已尝试过after_match="",但这会为比赛添加文字引号。

我已经尝试了after_match=''",但这失败了

我已经尝试了after_match=,但这也失败了

有什么建议吗?

1 个答案:

答案 0 :(得分:2)

我唯一的建议是将它设置为一些无害的字符串,然后在帖子中删除。 'after_match=*'然后可以做<?php $str = str_replace('*','',$str);种事情。

或者只使用strip_tags样式功能删除自动

<b>...</b> 

:)