Inverted indices are the underpinning of all full-text search engines. There are different ways to do them, but ultimately, you do full-text indexing by loading individual terms in the content into and index that references the document, hence "inverted" from the normal sense of indexing the document to find the content.
It seems to me then that with a carefully thought out inverted index and using the trigrams mentioned above, you could go a long way towards having the capability of the Lucene-based implementations like Elasticsearch and Solr.