↑↓ 选择 ↵ 打开 ⌫ 改范围 完整检索页

pgsql.cc 提供对 postgresql.org 官网内容的中文翻译,由 Pigsty 团队维护。

百科 / 全文检索组件 / 配置

irish

全文搜索配置 irish。

当前查看 PostgreSQL 18。

中文定义与说明

全文搜索配置 irish。

解析器
default
配置
irish

词元与词典映射

词元类型顺序词典
email1simple
url1simple
url_path1simple
host1simple
file1simple
version1simple
sfloat1simple
float1simple
int1simple
uint1simple
numword1simple
hword_numpart1simple
numhword1simple
asciiword1irish_stem
hword_asciipart1irish_stem
asciihword1irish_stem
word1irish_stem
hword_part1irish_stem
hword1irish_stem

同版本中文手册节选

一个文本检索配置指定了将一个文档转换成一个 tsvector 所需的所有选项:用于把文本分解成词元的解析器,以及用于将每一个词元转换成词位的词典。每一次 to_tsvector 或 to_tsquery 的调用都需要一个文本检索配置来执行其处理。配置参数 default_text_search_config 指定了默认配置的名称,如果省略了显式的配置参数,文本检索函数将会使用它。它可以在 postgresql.conf 中设置,或者使用 SET 命令为一个单独的会话设置。

有一些预定义的文本检索配置可用,并且你可以容易地创建自定义的配置。为了便于管理文本检索对象,可以使用一组 SQL 命令,并且有多个 psql 命令可以显示有关文本检索对象(第 12.10 节)的信息。

作为一个示例,我们将创建一个配置 pg,从复制内置的 english 配置开始:

我们将使用一个 PostgreSQL 相关的同义词列表,并将它存储在 $SHAREDIR/tsearch_data/pg_dict.syn 中。文件内容看起来像:

查看完整中文手册与上下文。

说明

全文搜索配置 irish。

配置
irish
解析器
默认

initdb 生成的定义

根据此版本的 Snowball 语言列表和 SQL 模板生成。

/*
 * text search configuration for irish language
 *
 * Copyright (c) 2007-2025, PostgreSQL Global Development Group
 *
 * src/backend/snowball/snowball.sql.in
 *
 * irish and certain other macros are replaced for each language;
 * see the Makefile for details.
 *
 * Note: this file is read in single-user -j mode, which means that the
 * command terminator is semicolon-newline-newline; whenever the backend
 * sees that, it stops and executes what it's got.  If you write a lot of
 * statements without empty lines between, they'll all get quoted to you
 * in any error message about one of them, so don't do that.  Also, you
 * cannot write a semicolon immediately followed by an empty line in a
 * string literal (including a function body!) or a multiline comment.
 */

CREATE TEXT SEARCH DICTIONARY irish_stem
	(TEMPLATE = snowball, Language = irish );

COMMENT ON TEXT SEARCH DICTIONARY irish_stem IS 'snowball stemmer for irish language';

CREATE TEXT SEARCH CONFIGURATION irish
	(PARSER = default);

COMMENT ON TEXT SEARCH CONFIGURATION irish IS 'configuration for irish language';

ALTER TEXT SEARCH CONFIGURATION irish ADD MAPPING
	FOR email, url, url_path, host, file, version,
	    sfloat, float, int, uint,
	    numword, hword_numpart, numhword
	WITH simple;

ALTER TEXT SEARCH CONFIGURATION irish ADD MAPPING
    FOR asciiword, hword_asciipart, asciihword
	WITH irish_stem;

ALTER TEXT SEARCH CONFIGURATION irish ADD MAPPING
    FOR word, hword_part, hword
	WITH irish_stem;

词元到词典的映射

词元类型顺序词典
email1简单
url1简单
url_path1简单
host1简单
file1简单
version1简单
sfloat1简单
float1简单
int1简单
uint1简单
numword1简单
hword_numpart1简单
numhword1简单
asciiword1irish_stem
hword_asciipart1irish_stem
asciihword1irish_stem
word1irish_stem
hword_part1irish_stem
hword1irish_stem

相关条目

文档与源码

来源构建
版本
18.6
构建
https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2
来源指纹
555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f

版本比较

PostgreSQL 17 → 18: 无变化。

比较已记录的接口与属性,排除来源指纹和构建元数据。某个样本中没有记录,不能据此判断实际引入或移除的版本。

相关条目

导出 JSON · 返回全文检索组件 · 收录范围为 PostgreSQL 12 至 20;最早采样版本不一定是实际引入版本。