Skip to content

Commit 6c67390

Browse files
lussolucahaydenhoang
authored andcommitted
#62 Pass the locale to the stopwords endpoint
1 parent 523db65 commit 6c67390

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

src/Stopwords.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Typesense\Exceptions\TypesenseClientError;
77

88
/**
9-
* Class Document
9+
* Class Stopwords
1010
*
1111
* @package \Typesense
1212
* @date 4/5/20
@@ -22,7 +22,7 @@ class Stopwords
2222
public const STOPWORDS_PATH = '/stopwords';
2323

2424
/**
25-
* Document constructor.
25+
* Stopwords constructor.
2626
*
2727
* @param ApiCall $apiCall
2828
*/
@@ -43,6 +43,7 @@ public function get(string $stopwordsName)
4343
[]
4444
);
4545
}
46+
4647
/**
4748
* @return array|string
4849
* @throws HttpClientException
@@ -62,24 +63,28 @@ public function getAll()
6263
*/
6364
public function put(array $options = [])
6465
{
65-
$stopwordsName = $options['stopwords_name'];
66-
$stopwordsData = $options['stopwords_data'];
66+
$stopwordsName = $options['name'];
67+
$stopwordsData = $options['stopwords'];
68+
$stopwordsLocale = $options['locale'];
6769
return $this->apiCall->put(
6870
$this->endpointPath($stopwordsName),
69-
['stopwords' => $stopwordsData]
71+
[
72+
'stopwords' => $stopwordsData,
73+
'locale' => $stopwordsLocale
74+
]
7075
);
7176
}
7277

7378
/**
74-
* @param $presetName
79+
* @param $stopwordsName
7580
* @return array
7681
* @throws HttpClientException
7782
* @throws TypesenseClientError
7883
*/
79-
public function delete($presetName)
84+
public function delete($stopwordsName)
8085
{
8186
return $this->apiCall->delete(
82-
$this->endpointPath($presetName)
87+
$this->endpointPath($stopwordsName)
8388
);
8489
}
8590

0 commit comments

Comments
 (0)