Re: pgsql: Add json(b)_to_tsvector function

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Add json(b)_to_tsvector function
Date: 2018-04-07 18:23:32
Message-ID: 65ad400b-30b8-0722-8124-d0dec9af5f60@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Forget to add to test 'english' FTS configuration, will fix
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=dunlin&dt=2018-04-07%2018%3A05%3A17

Teodor Sigaev wrote:
> 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
>
> Branch
> ------
> master
>
> Details
> -------
> https://git.postgresql.org/pg/commitdiff/1c1791e00065f6986f9d44a78ce7c28b2d1322dd
>
> Modified Files
> --------------
> doc/src/sgml/func.sgml | 20 ++++
> src/backend/tsearch/to_tsany.c | 128 ++++++++++++++++++++++----
> src/backend/utils/adt/jsonfuncs.c | 179 ++++++++++++++++++++++++++++++++----
> src/include/catalog/catversion.h | 2 +-
> src/include/catalog/pg_proc.h | 24 +++--
> src/include/utils/jsonapi.h | 21 ++++-
> src/test/regress/expected/json.out | 122 ++++++++++++++++++++++++
> src/test/regress/expected/jsonb.out | 122 ++++++++++++++++++++++++
> src/test/regress/sql/json.sql | 30 ++++++
> src/test/regress/sql/jsonb.sql | 30 ++++++
> 10 files changed, 629 insertions(+), 49 deletions(-)
>

--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Teodor Sigaev 2018-04-07 18:30:06 pgsql: Make test of json(b)_to_tsvector language-independ
Previous Message Teodor Sigaev 2018-04-07 17:59:11 pgsql: Add json(b)_to_tsvector function