Re: [PATCH] few fts functions for jsonb

From: "Sven R(dot) Kunze" <srkunze(at)mail(dot)de>
To: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, obartunov(at)gmail(dot)com, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] few fts functions for jsonb
Date: 2017-04-03 19:41:54
Message-ID: eb944a89-a920-1449-1b4e-938a6dbb8675@mail.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03.04.2017 21:30, Andrew Dunstan wrote:
> On 04/03/2017 02:44 PM, Sven R. Kunze wrote:
>> On 01.04.2017 22:20, Andrew Dunstan wrote:
>>> I added documentation when I committed it for the new functions, in the
>>> FTS section. I'm not sure what we need to add to the JSON section if
>>> anything.
>> Not sure, if this is related but the formatting of
>> https://www.postgresql.org/docs/devel/static/functions-textsearch.html
>> looks a bit strange.
>>
>> Just 2 questions/notes:
>> 1) in what order are the values of the JSON extracted?
> In the order they exist in the underlying document.

Just asking as the order can have implications for fulltext searches.
So, might be valuable for the docs.

Are these documents equally ordered in this sense?

srkunze=# select '{"a": "abc", "b": "def"}'::jsonb;
jsonb
--------------------------
{"a": "abc", "b": "def"}
(1 row)

srkunze=# select '{"b": "def", "a": "abc"}'::jsonb;
jsonb
--------------------------
{"a": "abc", "b": "def"}
(1 row)

Also what about non-ascii keys? Are they ordered by the default locale
of the PostgreSQL cluster (say de_DE.utf-8)?

>> 2) Regarding the additional line:
>> to_tsvector([ config regconfig , ] document json(b)) tsvector
>> reduce document text to tsvector to_tsvector('english', '{"a": "The
>> Fat Rats"}'::json) 'fat':2 'rat':3
>>
>> Maybe change "reduce document text to tsvector" to "extracting JSON
>> values <in what order> and reduce to tsvector"?
>>
>>
>
> OK, I will do something along those lines.
>
> cheers
>
> andrew
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2017-04-03 19:52:25 Re: [PATCH] few fts functions for jsonb
Previous Message Daniel Verite 2017-04-03 19:32:17 Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)