When you're working with the JSON data type you need to create a number of indexes to get acceptable performance.
Typically one per natural key in the document set ( present in and unique to each document ) for queries that are using that key and then trigram indexes on fields where you're doing partial string matches.
If you're going to be doing random queries against the entire contents of the document you'll probably want to add a full text index.
Typically one per natural key in the document set ( present in and unique to each document ) for queries that are using that key and then trigram indexes on fields where you're doing partial string matches.
If you're going to be doing random queries against the entire contents of the document you'll probably want to add a full text index.
Like so https://gist.github.com/laprice/90ea359c4f4dcd99e9f2