public function searchSynonyms($query, array $synonymType = array(), $page = null, $hitsPerPage = null)
{
$params = array();
if ($query !== null) {
$params['query'] = $query;
}
if (count($synonymType) > 0) {
$types = array();
foreach ($synonymType as $type) {
if (is_integer($type)) {
$types[] = SynonymType::getSynonymsTypeString($type);
} else {
$types[] = $type;
}
}
$params['type'] = implode(',', $types);
}
if ($page !== null) {
$params['page'] = $page;
}
if ($hitsPerPage !== null) {
$params['hitsPerPage'] = $hitsPerPage;
}
return $this->client->request($this->context, 'POST', '/1/indexes/' . $this->urlIndexName . '/synonyms/search', null, $params, $this->context->readHostsArray, $this->context->connectTimeout, $this->context->readTimeout);
}