https://www.amazon.com/Managing-Gigabytes-Compressing-Multim...
For instance you might be keep track of facts like
the word "the" is contained in document 1 the word "john" is contained in document 1 the word "the" is contained in document 2 ... the word "john" is contained in document 12 and you code the gaps; the word "the" appears in every document and the gap is always 1, but the gap for "john" is 11. With a variable-sized encoding you use fewer bits for smaller gaps -- with that kind of encoding you don't have to make "the" be a stopword because you can afford to encode all the postings.
https://www.amazon.com/Managing-Gigabytes-Compressing-Multim...
https://www.amazon.com/Information-Retrieval-Implementing-Ev...
https://www.amazon.com/Introduction-Information-Retrieval-Ch...