Add `count_occurrences` index function (closes #54)

Merge request reports