↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / Functions

json_to_tsvector

Selects each item in the JSON document that is requested by the filter and converts each one to a tsvector, normalizing words according to the specified or default configuration. The results are then concatenated in document order to produce the output. Position information is generated as though one stopword exists between each pair of selected items. (Beware that “document order” of the fields of a JSON object is implementation-dependent when the input is jsonb.) The filter must be a jsonb array containing zero or more of these keywords: "string" (to include all string values), "numeric" (to include all numeric values), "boolean" (to include all boolean values), "key" (to include all keys), or "all" (to include all the above). As a special case, the filter can also be a simple JSON value that is one of these keywords.

English manual coverage begins with PostgreSQL 7.1. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

group
textsearch
group label
文本搜索函数和操作符
lang
en
layout
table-new
pages
functions-textsearch.html
prose only
false

Definition PG 18

Selects each item in the JSON document that is requested by the filter and converts each one to a tsvector, normalizing words according to the specified or default configuration. The results are then concatenated in document order to produce the output. Position information is generated as though one stopword exists between each pair of selected items. (Beware that “document order” of the fields of a JSON object is implementation-dependent when the input is jsonb.) The filter must be a jsonb array containing zero or more of these keywords: "string" (to include all string values), "numeric" (to include all numeric values), "boolean" (to include all boolean values), "key" (to include all keys), or "all" (to include all the above). As a special case, the filter can also be a simple JSON value that is one of these keywords.

Signatures and overloads

json_to_tsvector ( [config regconfig, ] document json, filter jsonb ) → tsvector → tsvector
Selects each item in the JSON document that is requested by the filter and converts each one to a tsvector, normalizing words according to the specified or default configuration. The results are then concatenated in document order to produce the output. Position information is generated as though one stopword exists between each pair of selected items. (Beware that “document order” of the fields of a JSON object is implementation-dependent when the input is jsonb.) The filter must be a jsonb array containing zero or more of these keywords: "string" (to include all string values), "numeric" (to include all numeric values), "boolean" (to include all boolean values), "key" (to include all keys), or "all" (to include all the above). As a special case, the filter can also be a simple JSON value that is one of these keywords.

Compare versions

Complete source facts

documentation revision

{"inputs":[{"file":"functions-textsearch.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"2383d74fd6eee4b71e1b97dec9754623081103120b67a9793f8deac5fff77727","version":"18.7"},{"file":"functions-textsearch.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"d8d1661c6d67bb109c5266be16236950471c11d91181aafa96e9055792c4fa78","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"}

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · wiki-repair-20261023:b99fabf8179c2bb58f6b685ed45ff08e8cbf4246ac31af7d52649a62e18a14d4

Text language: en · wiki-repair-20261023:b99fabf8179c2bb58f6b685ed45ff08e8cbf4246ac31af7d52649a62e18a14d4