Postgres匹配运算符@@ [英] Postgres match operator @@

查看:106
本文介绍了Postgres匹配运算符@@的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清楚@@运算符在postgres中的工作方式。

I'm trying to figure out how exactly does @@ operator work in postgres.

我有两个查询:

SELECT description FROM product WHERE description @@ '%apple%'
SELECT description FROM product WHERE description @@ 'apple'



<两个查询返回相同数量的行。显然postgres从查询中删除了所有非
字母数字字符。

The two queries return the same number of rows. Apparently postgres removes all non alfanumeric characters from the query. Is this actually the case?

我也可以做 @@'@apple .. ,,。我仍然得到相同数量的结果。

I can also do @@ '@apple..,,.' and I still get the same number of results.

推荐答案

@@运算符是TSearch2全文搜索引擎的一部分。默认情况下,它会删除此类字符。 TSearch2的主题方法太大而无法在此处包含所有内容,因此,我只将您指向文档

@@ operator is part of TSearch2 Full Text Search Engine. It does remove such characters, by default. The topic of TSearch2 is way too big to include it all here, so I'll just point you to documentation.

这篇关于Postgres匹配运算符@@的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆