postgres全文搜索,如运算符 [英] postgres full text search like operator

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

问题描述

什么是用于搜索与like运算符匹配的文本的查询。

what is the query to use to search for text that matches the like operator.

我问的是全文搜索查询,其形式为

I am asking about full text search query, which is of the form

 SELECT * FROM eventlogging WHERE description_tsv @@ plainto_tsquery('mess');   

我也想要带有消息的结果,但是不,它不会返回任何内容

I want results with "message" as well but right not it does not return anything

推荐答案

如果我阅读了手册中的说明正确,您将需要同时使用 to_tsquery()而不是plainto_tsquery带有通配符以允许前缀匹配:

If I read the description in the manual correctly, you'll need to use to_tsquery() instead of plainto_tsquery together with a wildcard to allow prefix matching:


SELECT * 
FROM eventlogging 
WHERE description_tsv @@ to_tsquery('mess:*');

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

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