One option -- and likely the best -- is to create a recursive function (official documentation on functions) that combines the text
values of the entire JSONB structure into a single string (which it returns). You can full-text index the output of that function (see @thomas-wayne-shelton's answer) as if it were just a string. So long as you use the same function in your WHERE
conditions, pgSQL should recognize the index.
I just built/tested a similar "flattening" function so I'm confident that it can be done. Unfortunately, my case was very different so I suspect the code would confuse rather than enlighten. I can say that the function(s) must be marked as IMMUTABLE to support indexing.
===
The other path that looks promising (but I believe a dead-end) is a recursive CTE.
It is certainly possible to unwrap the recursive data using a recursive CTE. Here's the official documentation, a SO answer, and a blog example -- the last two for recursive nested JSONB specifically.
However, I don't believe you can index this output. It's my (tentative) understanding that a query using a recursive CTE is a lot like a view. It's a runtime optimization. I no longer have reference on-hand but recall seeing recent (as of Apr. 2018) discussion that indexing views was still a long way off (and I'm not even sure an index on a view would actually work for a CTE).