When a shard becomes search active then trigger a refresh instead of waiting for the next scheduled refresh.
The `IndexShard#awaitShardSearchActive(...)` method registers a refresh listener and then often waits for the refresh scheduler to trigger a refresh. By default this is one second. In order to avoid increasing the query time of the Search API, the mentioned method should trigger a refresh instead for waiting it to happen.

As part of this change we also need to disable the refresh scheduler completely. Otherwise we run at risk of running two refreshes next after each other. One triggered from making shard search active and one from the refresh scheduler.  



server/src/main/java/org/elasticsearch/search/SearchService.java
hasRefreshPending = needsWaitForRefresh || (indexShard.hasRefreshPending() && checkRefreshPending);
                canMatchSearcher = indexShard.acquireSearcher(Engine.CAN_MATCH_SEARCH_SOURCE);
            }
            try (canMatchSearcher) {
                SearchExecutionContext context = indexService.newSearchExecutionContext(
                    request.shardId().id(),
                    0,
                    canMatchSearcher,
                    request::nowInMillis,
                    request.getClusterAlias(),
                    request.getRuntimeMappings()
                );
                final boolean canMatch = queryStillMatchesAfterRewrite(request, context);
                final MinAndMax<?> minMax;
                if (canMatch || hasRefreshPending) {
                    FieldSortBuilder sortBuilder = FieldSortBuilder.getPrimaryFieldSortOrNull(request.source());
                    minMax = sortBuilder != null ? FieldSortBuilder.getMinMaxOrNull(context, sortBuilder) : null;
                } else {
                    minMax = null;
                }
                return new CanMatchShardResponse(canMatch || hasRefreshPending, minMax);
            }
        } finally {
            Releasables.close(releasable);
        }
    }
    /**
     * This method tries to rewrite a query without using a {@link SearchExecutionContext}. It takes advantage of the fact that
     * we can skip some shards in the query phase because we have enough information in the index mapping to decide the 'can match'
     * outcome. One such example is a term based query against a constant keyword field. This queries can rewrite themselves to a