Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Postgresql查询中删除pg_目录约束?_Postgresql_Full Text Search_Knex.js - Fatal编程技术网

如何在Postgresql查询中删除pg_目录约束?

如何在Postgresql查询中删除pg_目录约束?,postgresql,full-text-search,knex.js,Postgresql,Full Text Search,Knex.js,我对Postgresql非常陌生,使用的是第9.6页,下面是一个示例查询: select * from (select "posts".* from "posts" inner join "feeds" on posts.destination_feed_ids # feeds.id > 0 and feeds.name='Posts' inner join "users" on feeds.user_id=users.uid and not users.is_private where

我对Postgresql非常陌生,使用的是第9.6页,下面是一个示例查询:

select * from (select "posts".* from "posts" inner join "feeds" on posts.destination_feed_ids # feeds.id > 0 and feeds.name='Posts' inner join "users" on feeds.user_id=users.uid and not users.is_private where to_tsvector('pg_catalog.russian', posts.body) @@ to_tsquery('pg_catalog.russian', 'xxx')   union select "posts".* from "posts" inner join "feeds" on posts.destination_feed_ids # feeds.id > 0 and feeds.name='Posts' inner join "users" on feeds.user_id=users.uid and not users.is_private where
          posts.uid in (
            select post_id from comments where to_tsvector('pg_catalog.russian', comments.body) @@ to_tsquery('pg_catalog.russian', 'xxx')  
          )  union select "posts".* from "posts" where "posts"."user_id" = '48d85d83-b562-439f-addf-d75cd75d092f' and to_tsvector('pg_catalog.russian', posts.body) @@ to_tsquery('pg_catalog.russian', 'xxx')  union select "posts".* from "posts" where "posts"."user_id" = '48d85d83-b562-439f-addf-d75cd75d092f' and
          posts.uid in (
            select post_id from comments where to_tsvector('pg_catalog.russian', comments.body) @@ to_tsquery('pg_catalog.russian', 'xxx')  
          )  union select "posts".* from "posts" inner join "feeds" on posts.destination_feed_ids # feeds.id > 0 and feeds.name='Posts' inner join "users" on feeds.user_id=users.uid and users.is_private=true where to_tsvector('pg_catalog.russian', posts.body) @@ to_tsquery('pg_catalog.russian', 'xxx')  and "feeds"."id" in (5,10,11,12,15,16,17)  union select "posts".* from "posts" inner join "feeds" on posts.destination_feed_ids # feeds.id > 0 and feeds.name='Posts' inner join "users" on feeds.user_id=users.uid and users.is_private=true where
          posts.uid in (
            select post_id from comments where to_tsvector('pg_catalog.russian', comments.body) @@ to_tsquery('pg_catalog.russian', 'xxx')  
          )
          and "feeds"."id" in (5,10,11,12,15,16,17) ) as found_posts order by found_posts.bumped_at desc offset 0 limit 31
正如您所看到的,有几个
pg_catalog.俄语
,我不理解它们在查询中的作用。当前,对于“无ascii”结果,查询不返回任何结果

查询是使用knex配置文件构造的,该文件具有:

textSearchConfigName:“pg_catalog.俄语”

我想要的是更改查询(或数据库?),以便它可以查询所有utf8字符串

to_tsvector([config regconfig,]document text)返回tsvector to_tsvector将文本文档解析为标记,减少标记 ,并返回一个tsvector,其中列出了所有词素 他们在文件中的位置。文件已被处理 根据指定的或默认的文本搜索配置

此外:

解析器、字典的选择以及索引的标记类型 由选定的文本搜索配置(第节)确定 12.7). 在同一个数据库中可以有许多不同的配置,并且预定义的配置可用于不同的数据库 语言

换句话说,如果删除
'pg_catalog.russic'
,将选择默认配置。它不会是“任何语言”的

为了使用FTS,您需要在使用之前了解该语言。通常,这意味着在保存文本以便与FTS一起使用时,您可以将语言保存在下一列中,这样您就可以执行smth操作,如
select to_tsvector(language_column,body)
而不是fixed
俄语

您还可以
default\u text\u search\u config

选择这些变体使用的文本搜索配置 没有显式参数的文本搜索函数的 指定配置。详见第12章。 内置默认值为pg_catalog.simple,但initdb将初始化 配置文件,其设置与所选的 lc_ctype locale,如果可以使用与该区域设置匹配的配置 确定

不确定
textSearchConfigName
是否会以任何方式影响这一点