Code Duplication    Length = 17-18 lines in 2 locations

src/Lodash/ElasticSearch/ElasticSearchManager.php 2 locations

@@ 160-177 (lines=18) @@
157
        }
158
    }
159
160
    public function refreshIndex(string $index_name)
161
    {
162
        if (! $this->isEnabled()) {
163
            return;
164
        }
165
166
        $params = [
167
            'index' => $index_name,
168
        ];
169
170
        if (! empty($this->timeout)) {
171
            $params['client'] = [
172
                'timeout' => $this->timeout,
173
            ];
174
        }
175
176
        $this->client->indices()->refresh($params);
177
    }
178
179
    public function performSearch(ElasticSearchQueryContract $query): array
180
    {
@@ 179-195 (lines=17) @@
176
        $this->client->indices()->refresh($params);
177
    }
178
179
    public function performSearch(ElasticSearchQueryContract $query): array
180
    {
181
        if (! $this->isEnabled()) {
182
            return [];
183
        }
184
185
        $params = $query->build();
186
        if (! empty($this->timeout)) {
187
            $params['client'] = [
188
                'timeout' => $this->timeout,
189
            ];
190
        }
191
192
        $results = $this->client->search($params);
193
194
        return $results;
195
    }
196
197
    public function switchIndexAlias(string $alias_name, string $index_name)
198
    {