In order to implement multi threaded search we need to adjust the logic that creates the slices.
The new slice logic should take the following into account:

- A minimum doc count per slice. In order to avoid a number of aggregations to produce in-accurate results, a slice should at least contain 10% of the total documents in the Lucene index.
- A maximum number of slices. The number of slices that a shard level search creates should be capped. To avoid creating more slices than available search threads.
server/src/test/java/org/elasticsearch/search/internal/ContextIndexSearcherTests.java
DirectoryReader directoryReader = DirectoryReader.open(directory);
        ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(4);
        AtomicInteger missingDocs = new AtomicInteger();
        AtomicInteger visitDocs = new AtomicInteger(0);
        CollectorManager<Collector, Void> collectorManager = new CollectorManager<>() {
            boolean first = true;
            @Override
            public Collector newCollector() {
                if (first) {
                    first = false;
                    return new Collector() {
                        @Override
                        public LeafCollector getLeafCollector(LeafReaderContext context) {
                            missingDocs.set(context.reader().numDocs());
                            throw new IllegalArgumentException("fake exception");
                        }
                        @Override
                        public ScoreMode scoreMode() {
                            return ScoreMode.COMPLETE;
                        }
                    };
                } else {
                    return new Collector() {
                        @Override
                        public LeafCollector getLeafCollector(LeafReaderContext context) {
                            return new LeafBucketCollector() {
                                @Override
                                public void collect(int doc, long owningBucketOrd) {
                                    while (true) {
                                        int current = visitDocs.get();