Skip to content
Snippets Groups Projects

Search API: experimentally expose ChunkMatches over GraphQL

Created by: camdencheek

This experimentally adds ChunkMatches to our search resolvers which enables returning multiline matches from the GraphQL API. This is marked as experimental because I haven't hooked it up to anything and the field might still change after trying to use it.

Note that Zoekt still does not return multiline matches, but we convert all our matches into ChunkMatches even if they have been split up into multiple lines. Using this new API should be at least as powerful as the lineMatch API since we do return multiline matches for things like unindexed search and structural search.

I reused the Code Intel Range and Position GraphQL types for this, but a notable difference is that Position does not expose the byte offset. I think this fine since we don't actually need this in any of our clients, but it does somewhat limit the flexibility of the API.

Test plan

Not updating tests until I've also implemented this for the streaming API. It's not used, so backend integration tests should still pass (running for this PR). I'll update tests as I migrate things to use the new API.

However, a screenshot to prove this passes manual smoke tests:

Screen Shot 2022-06-07 at 11 07 37

Merge request reports

Approval is optional

Merged by avatar (Nov 11, 2025 8:42am UTC)

Merge details

  • Changes merged into main with af81909a.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Created by: tbliu98

    Review: Approved

    LGTM pending green buildkite run :thumbsup:

  • Created by: rvantonder

    Review: Approved

    thoughts on exposing via streaming? (I seem to recall we did this for the chunked highlighting experimental stuff, and it was guarded by a a URL param?). Might be the preferred place to expose for clients at some point, not sure where all the GQL values end up getting consumed.

  • Merged by: camdencheek at 2022-06-07 21:56:22 UTC

Please register or sign in to reply
Loading