#openGauss #入门 #安装 #数据库 #开源
知识来源:docs-opengauss.osinfra.cn/zh/
基本文本匹配
openGauss的全文检索基于匹配算子@@,当一个tsvector(document)匹配到一个tsquery(query)时,则返回true。其中,tsvector(document)和tsquery(query)两种数据类型可以任意排序。
openGauss=# SELECT 'a fat cat sat on a mat and ate a fat rat'::tsvector @@ 'cat & rat'::tsquery AS RESULT;
result
----------
t
(1 row)
openGauss=# SELECT 'fat & cow'::tsquery @@ 'a fat cat sat on a mat and ate a fat rat'::tsvector AS RESULT;
result
----------
f
(1 row)
#openGauss #入门 #安装 #数据库 #开源