Trigram index on all values of a JSONB column
You can create a function which returns the data as a string:

CREATE OR REPLACE FUNCTION public.jsonb_val_to_string(jsonb)
 RETURNS text
 LANGUAGE plpgsql
 IMMUTABLE
AS $function$
declare x text;
BEGIN
  select string_agg(value,' ') into x from jsonb_each_text($1);
  return x;
END
$function$


And then create the index on that:

create index on jason using gin (jsonb_val_to_string(x) gin_trgm_ops);


And then query also using the function:

explain select * from jason where jsonb_val_to_string(x) ilike '%foo%';


Of course you might want to change the delimiter in string_agg to something you know will never be included in the ilike pattern.