Secondary filter on search results

There’s an emacs package (consult) that lets you apply a secondary filter to a list of search results. I’m curious if there’s something similar available to nvim or vim.

To illustrate, this screencast shows a project-wide search where I search for “main”, then filter the results to those that contain “test” or occur in a file whose path contains “test”.


In other words, we run a project-wide search, generating a list of results with accompanying metadata (paths to the files containing results). We then run a secondary query, searching within the results and their metadata.

Is anyone aware of a way to do this kind of search refinement in vim/neovim?