< back

Bitmap

A Bitmap is a data structure that can be used to implement a set over a discrete number of items. The bits referred to in it's name are used to represent the presence or absence of items within the set.

This is useful in the Search context for implementing an Inverted Index or Postings List. In this case we would create a mapping from a term to the set of documents which contain that term.

Maintaining sets via bitmaps can make the set operations we typically use within a search engine quite fast, as we can use bitwise operations to calculate our results. These operations might occur where we handle a boolean search or apply filtering to a retrieved set of documents.

Examples

Example code written for this wiki to show how these data structures can work.

References

Libraries