|
8 | 8 |
|
9 | 9 | package org.elasticsearch.search.fetch.subphase; |
10 | 10 |
|
11 | | -import org.apache.lucene.index.LeafReaderContext; |
12 | | -import org.apache.lucene.index.memory.MemoryIndex; |
13 | 11 | import org.elasticsearch.common.Strings; |
14 | 12 | import org.elasticsearch.common.bytes.BytesReference; |
15 | 13 | import org.elasticsearch.common.xcontent.XContentBuilder; |
@@ -147,14 +145,10 @@ private HitContext hitExecuteMultiple(XContentBuilder source, boolean fetchSourc |
147 | 145 | when(fetchContext.getSearchExecutionContext()).thenReturn(sec); |
148 | 146 |
|
149 | 147 | final SearchHit searchHit = new SearchHit(1, null, nestedIdentity, null, null); |
150 | | - |
151 | | - // We don't need a real index, just a LeafReaderContext which cannot be mocked. |
152 | | - MemoryIndex index = new MemoryIndex(); |
153 | | - LeafReaderContext leafReaderContext = index.createSearcher().getIndexReader().leaves().get(0); |
154 | 148 | ValuesLookup valuesLookup = source == null |
155 | 149 | ? ValuesLookup.sourceOnly(Collections.emptyMap()) |
156 | 150 | : ValuesLookup.sourceOnly(BytesReference.bytes(source)); |
157 | | - HitContext hitContext = new HitContext(searchHit, valuesLookup, leafReaderContext, 1); |
| 151 | + HitContext hitContext = new HitContext(searchHit, valuesLookup, null, 1); |
158 | 152 |
|
159 | 153 | FetchSourcePhase phase = new FetchSourcePhase(); |
160 | 154 | FetchSubPhaseProcessor processor = phase.getProcessor(fetchContext); |
|
0 commit comments