text-prefix search in 9.4's JSONB

Started by Andreas Joseph Kroghalmost 12 years ago3 messagesgeneral
Jump to latest
#1Andreas Joseph Krogh
andreas@visena.com

Hi all.   I'm excited about 9.4's new JSONB and search-performance.   Is it
possible to combine tsearch's prefix-search with the new JSONB-format?  
Something like this (pseudo-code): SELECT '{"subject": "visena"}'::jsonb @> 
'{"subject": to_tsquery('simple', '(vise:*|office:*)')}';   and have the above
query match documents where subject contains the prefixes "vise" and "office",
which would match subject="visena" and subject="officenet"   Would be ultimate
cool if this was possible!   Thanks.   -- Andreas Jospeh Krogh CTO / Partner -
Visena AS Mobile: +47 909 56 963 andreas@visena.com <mailto:andreas@visena.com>
www.visena.com <https://www.visena.com&gt; <https://www.visena.com&gt;

#2Vik Fearing
vik@postgresfriends.org
In reply to: Andreas Joseph Krogh (#1)
Re: text-prefix search in 9.4's JSONB

On 07/07/2014 11:28 AM, Andreas Joseph Krogh wrote:

Hi all.

I'm excited about 9.4's new JSONB and search-performance.

Is it possible to combine tsearch's prefix-search with the new JSONB-format?

Something like this (pseudo-code):
SELECT '{"subject": "visena"}'::jsonb @> '{"subject":
to_tsquery('simple', '(vise:*|office:*)')}';

and have the above query match documents where subject contains the
prefixes "vise" and "office", which would match subject="visena" and
subject="officenet"

Would be ultimate cool if this was possible!

This will absolutely not happen in 9.4 but something like it is being
worked on for 9.5

See this presentation, starting at page 17:
http://www.pgcon.org/2014/schedule/attachments/318_pgcon-2014-vodka.pdf
--
Vik

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Andreas Joseph Krogh
andreas@visena.com
In reply to: Vik Fearing (#2)
Re: text-prefix search in 9.4's JSONB

På mandag 07. juli 2014 kl. 20:15:16, skrev Vik Fearing <vik.fearing@dalibo.com
<mailto:vik.fearing@dalibo.com>>: On 07/07/2014 11:28 AM, Andreas Joseph Krogh
wrote:

Hi all.
 
I'm excited about 9.4's new JSONB and search-performance.
 
Is it possible to combine tsearch's prefix-search with the new JSONB-format?
 
Something like this (pseudo-code):
SELECT '{"subject": "visena"}'::jsonb @>  '{"subject":
to_tsquery('simple', '(vise:*|office:*)')}';
 
and have the above query match documents where subject contains the
prefixes "vise" and "office", which would match subject="visena" and
subject="officenet"
 
Would be ultimate cool if this was possible!

This will absolutely not happen in 9.4 but something like it is being
worked on for 9.5

See this presentation, starting at page 17:
http://www.pgcon.org/2014/schedule/attachments/318_pgcon-2014-vodka.pdf  
Interesting!   -- Andreas Jospeh Krogh CTO / Partner - Visena AS Mobile: +47
909 56 963 andreas@visena.com <mailto:andreas@visena.com> www.visena.com
<https://www.visena.com&gt; <https://www.visena.com&gt;