如何在 Sphinx 中搜索“/”和“$”?
How can I search on "/" and "$" in Sphinx?
我正在尝试向 Sphinx 搜索添加 NOT 条件:
!($|/) NEAR/3 (HR)
然而 Sphinx returns "unexpected $" 或 "unexpected /" 所以我假设这些是用作语法搜索的字符。如何让 Sphinx 将此搜索用作字符?
您应该使用 \
:
转义这些符号
select * from my_index where match('!(\$|\/) NEAR/3 (HR)');
我正在尝试向 Sphinx 搜索添加 NOT 条件:
!($|/) NEAR/3 (HR)
然而 Sphinx returns "unexpected $" 或 "unexpected /" 所以我假设这些是用作语法搜索的字符。如何让 Sphinx 将此搜索用作字符?
您应该使用 \
:
select * from my_index where match('!(\$|\/) NEAR/3 (HR)');