Add support for filtering by archived and forks in Zoekt code search
Proposal
Updated proposal for first iteration is to not change anything on Zoekt side. We can filter the list of projects in Rails and only send those that match the filters through to Zoekt.
The frontend already has filtering for archived, we just need to enable it for Zoekt code search
Forked filter does not currently exist so we can implement backend only and frontend will be in a follow up issue (To be created)
Original proposal
Zoekt is already capable of storing booleans for fork
and archive
. Once we've done #402984 (closed) we'll need to update that indexer to also set these fields when indexing. Probably this will be sent from GitLab -> Zoekt in the indexing request.
Once we are persisting that correctly we should be able to search by this. It seems fork:no
and fork:yes
was already added to the query syntax and based on that PR it seems archived:no
and archived:yes
was already supported before that. So at this point we will be able to pass these options in the query. We can just document to users how they do it using Zoekt query syntax or we can additionally add it to the query automatically if we also have a UI for it introduced in #18262 (closed) .