Roaring bitmaps are really useful for doing phrase search in search engines.
Basically you can find cases where one term is immediately before another by left shifting the right terms roaring encoded positions in all documents and bitwise-anding the similarly roaring-encoded payload of the preceding term. All with a highly compressed representation of term positions.
With something like numpy you can do this in a handful of logical operations in python.
https://softwaredoug.com/blog/2024/01/21/search-array-phrase...