Skip to content

Commit 6fcce14

Browse files
committed
docs(overrides-synonyms): add phpdoc for legacy collection-scoped override and synonym methods
1 parent 6b15b89 commit 6fcce14

4 files changed

Lines changed: 68 additions & 0 deletions

File tree

src/Override.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ private function endPointPath(): string
5858
}
5959

6060
/**
61+
* Retrieve an override (curation rule) by ID on this collection.
62+
*
63+
* @example
64+
* $client->collections['products']->overrides['promote-hat']->retrieve()
65+
*
66+
* @see https://typesense.org/docs/latest/api/curation.html
67+
*
6168
* @return array
6269
* @throws TypesenseClientError|HttpClientException
6370
*/
@@ -67,6 +74,13 @@ public function retrieve(): array
6774
}
6875

6976
/**
77+
* Delete an override (curation rule) by ID on this collection.
78+
*
79+
* @example
80+
* $client->collections['products']->overrides['promote-hat']->delete()
81+
*
82+
* @see https://typesense.org/docs/latest/api/curation.html
83+
*
7084
* @return array
7185
* @throws TypesenseClientError|HttpClientException
7286
*/

src/Overrides.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ public function endPointPath(string $overrideId = ''): string
6060
}
6161

6262
/**
63+
* Create or update an override (curation rule) on this collection.
64+
*
65+
* @example
66+
* $client->collections['products']->overrides->upsert('promote-hat', ['rule' => ['query' => 'hat', 'match' => 'exact'], 'includes' => []])
67+
*
68+
* @see https://typesense.org/docs/latest/api/curation.html
69+
*
6370
* @param string $overrideId
6471
* @param array $config
6572
*
@@ -72,6 +79,13 @@ public function upsert(string $overrideId, array $config): array
7279
}
7380

7481
/**
82+
* Retrieve all overrides (curation rules) on this collection.
83+
*
84+
* @example
85+
* $client->collections['products']->overrides->retrieve()
86+
*
87+
* @see https://typesense.org/docs/latest/api/curation.html
88+
*
7589
* @return array
7690
* @throws TypesenseClientError|HttpClientException
7791
*/

src/Synonym.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* Class synonym
1010
*
1111
* @package \Typesense
12+
*
13+
* @deprecated Deprecated starting with Typesense Server v30. Please migrate to `$client->synonymSets` (new Synonym Sets APIs).
1214
*/
1315
class Synonym
1416
{
@@ -56,6 +58,15 @@ private function endPointPath(): string
5658
}
5759

5860
/**
61+
* Retrieve a synonym (legacy v1) by ID on this collection.
62+
*
63+
* @example
64+
* $client->collections['products']->synonyms['syn-1']->retrieve()
65+
*
66+
* @see https://typesense.org/docs/29.0/api/synonyms.html
67+
*
68+
* @deprecated Deprecated starting with Typesense Server v30. Please migrate to `$client->synonymSets` (new Synonym Sets APIs).
69+
*
5970
* @return array
6071
* @throws TypesenseClientError|HttpClientException
6172
*/
@@ -65,6 +76,15 @@ public function retrieve(): array
6576
}
6677

6778
/**
79+
* Delete a synonym (legacy v1) by ID on this collection.
80+
*
81+
* @example
82+
* $client->collections['products']->synonyms['syn-1']->delete()
83+
*
84+
* @see https://typesense.org/docs/29.0/api/synonyms.html
85+
*
86+
* @deprecated Deprecated starting with Typesense Server v30. Please migrate to `$client->synonymSets` (new Synonym Sets APIs).
87+
*
6888
* @return array
6989
* @throws TypesenseClientError|HttpClientException
7090
*/

src/Synonyms.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* Class Synonyms
1010
*
1111
* @package \Typesense
12+
*
13+
* @deprecated Deprecated starting with Typesense Server v30. Please migrate to `$client->synonymSets` (new Synonym Sets APIs).
1214
*/
1315
class Synonyms implements \ArrayAccess
1416
{
@@ -58,6 +60,15 @@ public function endPointPath(string $synonymId = ''): string
5860
}
5961

6062
/**
63+
* Create or update a synonym (legacy v1) on this collection.
64+
*
65+
* @example
66+
* $client->collections['products']->synonyms->upsert('syn-1', ['synonyms' => ['nyc', 'new york']])
67+
*
68+
* @see https://typesense.org/docs/29.0/api/synonyms.html
69+
*
70+
* @deprecated Deprecated starting with Typesense Server v30. Please migrate to `$client->synonymSets` (new Synonym Sets APIs).
71+
*
6172
* @param string $synonymId
6273
* @param array $config
6374
*
@@ -70,6 +81,15 @@ public function upsert(string $synonymId, array $config): array
7081
}
7182

7283
/**
84+
* Retrieve all synonyms (legacy v1) on this collection.
85+
*
86+
* @example
87+
* $client->collections['products']->synonyms->retrieve()
88+
*
89+
* @see https://typesense.org/docs/29.0/api/synonyms.html
90+
*
91+
* @deprecated Deprecated starting with Typesense Server v30. Please migrate to `$client->synonymSets` (new Synonym Sets APIs).
92+
*
7393
* @return array
7494
* @throws TypesenseClientError|HttpClientException
7595
*/

0 commit comments

Comments
 (0)