Since an inverted index is everything to keep the connection between words and their locations inside the document, I'm not sure if this is a really good use case for NoSQL. Traditional SQL will work better here. For example, try the data structure as follows:
Documents (DocumentID primary key, DocumentText text)
Words (WordID primary key, Word text)
Instances (InstanceID primary key, WordID foreign key, DocumentID foreign key, WordIndex integer)
, Documents, Words, WordID, , Instances.
NoSQL, - MongoDB . Word Instances, ObjectID . , MongoDB . "a" "the" 4 , , .