Сделать-то можно. Но лучше все-таки хотя бы отдельное поле под tsvector завести.
create table t (col jsonb);
create index ix_t_col using gin(to_tsvector('pg_catalog.english', jsonb_path_query_array(col, '$.obj.TEXT')));
insert into t values('{
"obj": [
{
"TEXT": "These functions act like their counterparts described above without the _tz suffix, except that these functions support comparisons of date/time values that require timezone-aware conversions.",
"key1": 77,
"key2": "a"
},
{
"TEXT": "Returns target with new_value inserted. If the item designated by the path is an array element, new_value will be inserted before that item if insert_after is false (which is the default), or after it if insert_after is true. If the item designated by the path is an object field, new_value will be inserted only if the object does not already contain that key",
"key1": 99,
"key2": false
}
]
}');
select ts_headline(col, 'function'::tsquery),
ts_headline(arr, 'function'::tsquery)
from (
select col, jsonb_path_query_array(col, '$.obj.TEXT') arr,
to_tsvector('pg_catalog.english', jsonb_path_query_array(col, '$.obj.TEXT')) tsv
from t
) q
where tsv @@ 'function'::tsquery;
jsonb_path_query_array(col, '$.obj.TEXT')
- выделяет все, что у вас по ключу TEXT в массив. Дальше он индексируется