Query Quill-Delta JSON array in Postgres
I've come up with a function and an index; this is the function, which takes alle the insert JSON-String keys and builds up a tsvector from them:

create or replace function public.fts_quill_delta(lang regconfig, delta text) returns tsvector as
$$
begin
return to_tsvector(lang, string_agg(value-&gt;&gt;'insert', ' ')) from jsonb_array_elements(delta::jsonb) where jsonb_typeof(value-&gt;'insert') = 'string';
end;
$$
language 'plpgsql' immutable;


this is the index:

create index content_delta_fts on my_table using gin(fts_quill_delta(lang, content));


Then you can query the index with:

select from my_table where fts_quill_delta(lang, content) @@ 'hello &amp; world'


Note that I added a lang column, used by the FTS engine to use correct I18N settings.