protected function filterStatuses(SearchNodesRequest $request, Query\BoolQuery $query): void
    {
        if (!$request->has('statuses')) {
            return;
        }

        $statuses = array_map('strval', $request->get('statuses'));
        $query->addFilter(new Query\Terms('status', $statuses));
    }