Skip to content

Commit 4ac2aea

Browse files
authored
Merge pull request #15 from ensi-platform/task-100913
#100913 add indicesSearchAnalyzers method
2 parents 5788006 + 65eb2de commit 4ac2aea

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ $index->deleteByQuery(); // Send deleteByQuery request
249249
$index->catIndices();
250250
$index->indicesDelete();
251251
$index->indicesRefresh();
252+
$index->indicesReloadSearchAnalyzers();
252253
```
253254

254255
## Query Log

src/Concerns/InteractsWithIndex.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,26 @@ public function documentDelete(int|string $id): array
6666
return $this->resolveClient()->documentDelete($this->indexName(), $id);
6767
}
6868

69-
public function catIndices(string $indexName, ?array $getFields = null)
69+
public function catIndices(string $indexName, ?array $getFields = null): array
7070
{
7171
return $this->resolveClient()->catIndices($indexName, $getFields);
7272
}
7373

74-
public function indicesDelete(string $index)
74+
public function indicesDelete(string $index): array
7575
{
7676
return $this->resolveClient()->indicesDelete($index);
7777
}
7878

79-
public function indicesRefresh()
79+
public function indicesRefresh(): array
8080
{
8181
return $this->resolveClient()->indicesRefresh($this->indexName());
8282
}
8383

84+
public function indicesReloadSearchAnalyzers(): array
85+
{
86+
return $this->resolveClient()->indicesReloadSearchAnalyzers($this->indexName());
87+
}
88+
8489
public static function query(): SearchQuery
8590
{
8691
return new SearchQuery(new static());

src/ElasticClient.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function documentDelete(string $index, int|string $id): array
7272
]);
7373
}
7474

75-
public function catIndices(string $indexName, ?array $getFields = null)
75+
public function catIndices(string $indexName, ?array $getFields = null): array
7676
{
7777
$params = ['index' => "$indexName*"];
7878
if ($getFields) {
@@ -82,16 +82,21 @@ public function catIndices(string $indexName, ?array $getFields = null)
8282
return $this->client->cat()->indices($params);
8383
}
8484

85-
public function indicesDelete(string $indexName)
85+
public function indicesDelete(string $indexName): array
8686
{
8787
return $this->client->indices()->delete(['index' => $indexName]);
8888
}
8989

90-
public function indicesRefresh(string $indexName)
90+
public function indicesRefresh(string $indexName): array
9191
{
9292
return $this->client->indices()->refresh(['index' => $indexName]);
9393
}
9494

95+
public function indicesReloadSearchAnalyzers(string $indexName): array
96+
{
97+
return $this->client->indices()->reloadSearchAnalyzers(['index' => $indexName]);
98+
}
99+
95100
public function enableQueryLog(): void
96101
{
97102
$this->queryLog ??= new QueryLog();

0 commit comments

Comments
 (0)