Sphinx Search how to use an empty before_match and after_match

喜夏-厌秋 提交于 2019-12-23 22:59:54

问题


Using Sphinx's SNIPPET() function, how can I remove any before_match and after_match from my query? I don't want anything wrapped around the matching text.

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

I've tried after_match="" but this adds literal quotes to the match.

I've tried after_match=''" but this fails

I've tried after_match= and this fails too

Any suggestions?


回答1:


My only suggestion is just to set it to some innocuous string, and then remove in post. 'after_match=*' then can do <?php $str = str_replace('*','',$str); sort of thing.

Or just use strip_tags style function to remove the automatic

<b>...</b> 

:)



来源:https://stackoverflow.com/questions/45420989/sphinx-search-how-to-use-an-empty-before-match-and-after-match

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!