Inverted indexes are a method commonly used by search engines.

A forward index provides a mapping from Document to its keywords. An inverted index provides a reverse mapping from keywords to its relevant documents.

Elasticsearch for example maintains an inverted index as more documents are ingested. The inverted index is continuously updated as new documents are added or existing ones are modified — it’s an incremental, persistent structure, not something created on the fly.

https://www.geeksforgeeks.org/inverted-index/

https://www.youtube.com/watch?v=JsJ_ZGMztVg&ab_channel=Olena%27sData%26EngineeringCorner

Indexing