Skip to content

Send highlight info from Zoekt multi-match graphQL

Background

Related discussion: #501284 (comment 2243994538)

The highlighting for zoekt multi-match is being done on the backend. It's too slow because it's highlighting 10 full pages of results using the Ruby rouge library.

Proposal

  1. backend will send array of highlights in graphQL response. Array will contain either start/end ([ [start, end], [start, end] ]) or offset/length ([ [offset, length], [offset, length] ]) to allow the frontend to bold the matched text
  2. backend will send the language in graphQL response, this can be passed to Highlight.js
  3. backend will not highlight matches and will not provide rich_text in graphQL response. This must be done in a separate MR once the frontend is consuming the new backend responses. This will allow for backwards compatibility across deploys