Skip to content

Code Search: provide count of matches returned

Problem to solve

The backend supports two types of code (blob) search: basic search (backed by database on GitLab.com and only available for project level) and advanced search (backed by Elasticsearch on GitLab.com). For this issue, the scope is advanced search. In the advanced search, we are not showing multiple matches within the same file. Users do not have any indication of multiple matches within the same file.

Proposal

As a first iteration provide the count of line matches within the single file.

This can be accomplished by counting the HIGHLIGHT_START_TAG occurrences in ::Gitlab::Elastic::SearchResults.

Edited by Ravi Kumar