Re: json(b)_to_tsvector with numeric values

2018-04-07 Thread Teodor Sigaev
Thank you, pushed with some editorization Dmitry Dolgov wrote: On 7 April 2018 at 17:09, Teodor Sigaev wrote: See workable sketch for parsing jsonb flags and new worker variant. Yep, thanks for the sketch. Here is the new version of patch, does it look close to what you

Re: json(b)_to_tsvector with numeric values

2018-04-07 Thread Dmitry Dolgov
> On 7 April 2018 at 17:09, Teodor Sigaev wrote: >>> See workable sketch for parsing jsonb flags and new worker variant. >> >> >> Yep, thanks for the sketch. Here is the new version of patch, does it look >> close to what you have in mind? > > > Patch looks good except error

Re: json(b)_to_tsvector with numeric values

2018-04-07 Thread Teodor Sigaev
See workable sketch for parsing jsonb flags and new worker variant. Yep, thanks for the sketch. Here is the new version of patch, does it look close to what you have in mind? Patch looks good except error messaging, you took it directly from sketch where I didn't spend time for it. Please,

Re: json(b)_to_tsvector with numeric values

2018-04-07 Thread Dmitry Dolgov
> On 6 April 2018 at 18:55, Teodor Sigaev wrote: > > > Dmitry Dolgov wrote: >>> >>> On 6 April 2018 at 16:25, Teodor Sigaev wrote: >>> 1) I don't like jsonb_all_to_tsvector too.. What if we will accept new >>> variant to index? Let me suggest: >>> >>> tsvector

Re: json(b)_to_tsvector with numeric values

2018-04-06 Thread Teodor Sigaev
Dmitry Dolgov wrote: On 6 April 2018 at 16:25, Teodor Sigaev wrote: 1) I don't like jsonb_all_to_tsvector too.. What if we will accept new variant to index? Let me suggest: tsvector jsonb_to_tsvector([regclass,] jsonb, text[]) where text[] arg is actually a flags, array

Re: json(b)_to_tsvector with numeric values

2018-04-06 Thread Dmitry Dolgov
> On 6 April 2018 at 16:25, Teodor Sigaev wrote: > 1) I don't like jsonb_all_to_tsvector too.. What if we will accept new > variant to index? Let me suggest: > > tsvector jsonb_to_tsvector([regclass,] jsonb, text[]) > > where text[] arg is actually a flags, array contains any

Re: json(b)_to_tsvector with numeric values

2018-04-06 Thread Teodor Sigaev
1) I don't like jsonb_all_to_tsvector too.. What if we will accept new variant to index? Let me suggest: tsvector jsonb_to_tsvector([regclass,] jsonb, text[]) where text[] arg is actually a flags, array contains any combination of literals 'numeric', 'string', 'boolean' (and even 'key' to

Re: json(b)_to_tsvector with numeric values

2018-04-05 Thread Dmitry Dolgov
> On 4 April 2018 at 16:09, Teodor Sigaev wrote: > >>> Hm, seems, it's useful feature, but I suggest to make separate function >>> jsonb_any_to_tsvector and add support for boolean too (if you know better >>> name for function, do not hide it). Changing behavior of existing >>>

Re: json(b)_to_tsvector with numeric values

2018-04-04 Thread Teodor Sigaev
Hm, seems, it's useful feature, but I suggest to make separate function jsonb_any_to_tsvector and add support for boolean too (if you know better name for function, do not hide it). Changing behavior of existing function is not obvious for users and, seems, should not backpatched. What do you

Re: json(b)_to_tsvector with numeric values

2018-04-02 Thread Dmitry Dolgov
> On 2 April 2018 at 11:27, Arthur Zakirov wrote: > On Mon, Apr 02, 2018 at 11:41:12AM +0300, Oleg Bartunov wrote: >> On Mon, Apr 2, 2018 at 9:45 AM, Arthur Zakirov >> wrote: >> I found this bug, when working on presentation about FTS and it

Re: json(b)_to_tsvector with numeric values

2018-04-02 Thread Arthur Zakirov
On Mon, Apr 02, 2018 at 11:41:12AM +0300, Oleg Bartunov wrote: > On Mon, Apr 2, 2018 at 9:45 AM, Arthur Zakirov > wrote: > I found this bug, when working on presentation about FTS and it looked > annoying, since it validates > the consistency of FTS.I think this is a

Re: json(b)_to_tsvector with numeric values

2018-04-02 Thread Oleg Bartunov
Postgres Professional: http://www.postgrespro.com The Russian Postgres Company On Mon, Apr 2, 2018 at 9:45 AM, Arthur Zakirov wrote: > Hello Dmitry, > > Dmitry Dolgov <9erthali...@gmail.com> wrote: >> >> Any opinions about this suggestion? Can it be considered as a bug

Re: json(b)_to_tsvector with numeric values

2018-04-02 Thread Arthur Zakirov
Hello Dmitry, Dmitry Dolgov <9erthali...@gmail.com> wrote: > > Any opinions about this suggestion? Can it be considered as a bug fix and > included into this release? > I think there is no chance to include it into v11. You can add the patch to the 2018-09 commitfest. -- Arthur Zakirov

json(b)_to_tsvector with numeric values

2018-04-01 Thread Dmitry Dolgov
Hi, We've just noticed, that current implementation of `json(b)_to_tsvector` can be confusing sometimes, if the target document contains numeric values. In this case we just drop them, and only string values will contribute to the result: select to_tsvector('english', '{"a": "The Fat Rats",