Skip to content

Commit 3278837

Browse files
committed
Add OpenSearch documentation links
1 parent 4ba0136 commit 3278837

6 files changed

Lines changed: 162 additions & 6 deletions

File tree

src/Documents/DocumentManagerInterface.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ interface DocumentManagerInterface
1414
/**
1515
* Index the given documents into OpenSearch.
1616
*
17+
* @see https://docs.opensearch.org/latest/api-reference/document-apis/bulk/
18+
*
1719
* @param array<int, Document> $documents
1820
*
1921
* @throws BulkRequestException
@@ -23,6 +25,8 @@ public function index(string $index, array $documents, bool $refresh = false, ?D
2325
/**
2426
* Delete the given documents from OpenSearch.
2527
*
28+
* @see https://docs.opensearch.org/latest/api-reference/document-apis/bulk/
29+
*
2630
* @param array<int, string> $ids
2731
*
2832
* @throws BulkRequestException
@@ -32,12 +36,16 @@ public function delete(string $index, array $ids, bool $refresh = false, ?Docume
3236
/**
3337
* Delete documents that match the given OpenSearch query.
3438
*
39+
* @see https://docs.opensearch.org/latest/api-reference/document-apis/delete-by-query/
40+
*
3541
* @param array<string, mixed> $query
3642
*/
3743
public function deleteByQuery(string $index, array $query, bool $refresh = false): static;
3844

3945
/**
4046
* Search an index using the given search request.
47+
*
48+
* @see https://docs.opensearch.org/latest/api-reference/search-apis/search/
4149
*/
4250
public function search(string $index, SearchRequest $request): SearchResponse;
4351
}

src/Indices/IndexManagerInterface.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,53 +9,73 @@ interface IndexManagerInterface
99
{
1010
/**
1111
* Open the given index.
12+
*
13+
* @see https://docs.opensearch.org/latest/api-reference/index-apis/open-index/
1214
*/
1315
public function open(string $index): static;
1416

1517
/**
1618
* Close the given index.
19+
*
20+
* @see https://docs.opensearch.org/latest/api-reference/index-apis/close-index/
1721
*/
1822
public function close(string $index): static;
1923

2024
/**
2125
* Determine if the given index exists.
26+
*
27+
* @see https://docs.opensearch.org/latest/api-reference/index-apis/exists/
2228
*/
2329
public function exists(string $index): bool;
2430

2531
/**
2632
* Create an index from the given blueprint.
33+
*
34+
* @see https://docs.opensearch.org/latest/api-reference/index-apis/create-index/
2735
*/
2836
public function create(IndexBlueprint $index): static;
2937

3038
/**
3139
* Update the mapping for the given index.
40+
*
41+
* @see https://docs.opensearch.org/latest/api-reference/index-apis/put-mapping/
3242
*/
3343
public function putMapping(string $index, Mapping $mapping): static;
3444

3545
/**
3646
* Update the settings for the given index.
47+
*
48+
* @see https://docs.opensearch.org/latest/api-reference/index-apis/update-settings/
3749
*/
3850
public function putSettings(string $index, Settings $settings): static;
3951

4052
/**
4153
* Delete the given index.
54+
*
55+
* @see https://docs.opensearch.org/latest/api-reference/index-apis/delete-index/
4256
*/
4357
public function delete(string $index): static;
4458

4559
/**
4660
* Get the aliases for the given index.
4761
*
62+
* @see https://docs.opensearch.org/latest/api-reference/index-apis/alias/
63+
*
4864
* @return array<string, Alias>
4965
*/
5066
public function getAliases(string $index): array;
5167

5268
/**
5369
* Create or update an alias for the given index.
70+
*
71+
* @see https://docs.opensearch.org/latest/api-reference/index-apis/alias/
5472
*/
5573
public function putAlias(string $index, Alias $alias): static;
5674

5775
/**
5876
* Delete the given alias from the index.
77+
*
78+
* @see https://docs.opensearch.org/latest/api-reference/index-apis/alias/
5979
*/
6080
public function deleteAlias(string $index, string $aliasName): static;
6181
}

src/Indices/Mapping.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function byte(string $name, array $parameters = []): self
121121
/**
122122
* Add a completion field definition.
123123
*
124-
* @see https://docs.opensearch.org/latest/mappings/supported-field-types/autocomplete/
124+
* @see https://docs.opensearch.org/latest/mappings/supported-field-types/completion/
125125
*
126126
* @param array<string, mixed> $parameters
127127
*/
@@ -135,7 +135,7 @@ public function completion(string $name, array $parameters = []): self
135135
/**
136136
* Add a constant keyword field definition.
137137
*
138-
* @see https://docs.opensearch.org/latest/mappings/supported-field-types/string/
138+
* @see https://docs.opensearch.org/latest/mappings/supported-field-types/keyword/
139139
*
140140
* @param array<string, mixed> $parameters
141141
*/
@@ -555,7 +555,7 @@ public function scaledFloat(string $name, array $parameters = []): self
555555
/**
556556
* Add a search-as-you-type field definition.
557557
*
558-
* @see https://docs.opensearch.org/latest/mappings/supported-field-types/autocomplete/
558+
* @see https://docs.opensearch.org/latest/mappings/supported-field-types/search-as-you-type/
559559
*
560560
* @param array<string, mixed> $parameters
561561
*/
@@ -625,7 +625,7 @@ public function sparseVector(string $name, array $parameters = []): self
625625
/**
626626
* Add a text field definition.
627627
*
628-
* @see https://docs.opensearch.org/latest/mappings/supported-field-types/string/
628+
* @see https://docs.opensearch.org/latest/mappings/supported-field-types/text/
629629
*
630630
* @param array<string, mixed> $parameters
631631
*/
@@ -639,7 +639,7 @@ public function text(string $name, array $parameters = []): self
639639
/**
640640
* Add a token count field definition.
641641
*
642-
* @see https://docs.opensearch.org/latest/mappings/supported-field-types/string/
642+
* @see https://docs.opensearch.org/latest/mappings/supported-field-types/token-count/
643643
*
644644
* @param array<string, mixed> $parameters
645645
*/
@@ -653,7 +653,7 @@ public function tokenCount(string $name, array $parameters = []): self
653653
/**
654654
* Add a wildcard field definition.
655655
*
656-
* @see https://docs.opensearch.org/latest/mappings/supported-field-types/string/
656+
* @see https://docs.opensearch.org/latest/mappings/supported-field-types/wildcard/
657657
*
658658
* @param array<string, mixed> $parameters
659659
*/

0 commit comments

Comments
 (0)