Add json(b)_to_tsvector function
authorTeodor Sigaev <teodor@sigaev.ru>
Sat, 7 Apr 2018 17:58:03 +0000 (20:58 +0300)
committerTeodor Sigaev <teodor@sigaev.ru>
Sat, 7 Apr 2018 17:58:03 +0000 (20:58 +0300)
commit1c1791e00065f6986f9d44a78ce7c28b2d1322dd
tree7287b278140f8fe30ceb289146afc4fdcc97a040
parent529ab7bd1fb9c836fe5ccd96f79329d407522e20
Add json(b)_to_tsvector function

Jsonb has a complex nature so there isn't best-for-everything way to convert it
to tsvector for full text search. Current to_tsvector(json(b)) suggests to
convert only string values, but it's possible to index keys, numerics and even
booleans value. To solve that json(b)_to_tsvector has a second required
argument contained a list of desired types of json fields. Second argument is
a jsonb scalar or array right now with possibility to add new options in a
future.

Bump catalog version

Author: Dmitry Dolgov with some editorization by me
Reviewed by: Teodor Sigaev
Discussion: https://www.postgresql.org/message-id/CA+q6zcXJQbS1b4kJ_HeAOoOc=unfnOrUEL=KGgE32QKDww7d8g@mail.gmail.com
doc/src/sgml/func.sgml
src/backend/tsearch/to_tsany.c
src/backend/utils/adt/jsonfuncs.c
src/include/catalog/catversion.h
src/include/catalog/pg_proc.h
src/include/utils/jsonapi.h
src/test/regress/expected/json.out
src/test/regress/expected/jsonb.out
src/test/regress/sql/json.sql
src/test/regress/sql/jsonb.sql