IntelliJ Platform Plugin SDK
 
IntelliJ Platform Explorer

File-Based Indexes

Edit pageLast modified: 12 March 2024

File-based indexes are based on a Map/Reduce architecture. Each index has a specific type of key and a particular type of value.

The key is what's later used to retrieve data from the index.

Example: in the word index, the key is the word itself.

The value is arbitrary data, which is associated with the key in the index.

Example: in the word index, the value is a mask indicating in which context the word occurs (code, string literal, or comment).

In the simplest case, when one needs to know in what files some data is present, the value has type Void and is not stored in the index.

When the index implementation indexes a file, it receives a file's content and returns a map from the keys found in the file to the associated values.

When accessing an index, specify the key you're interested in and get back the list of files in which the key occurs, and the value associated with each file.