Too many synonyms in n-way synonym

Hi there. I’m Koh from Japan.

When I updated search synonyms, I met an error that said below.

res = index.save_synonyms(mini_batch,
  File "/Users/k_kitahara/.pyenv/versions/3.9.6/envs/py396/lib/python3.9/site-packages/algoliasearch/search_index.py", line 314, in save_synonyms
    raw_response = self._transporter.write(
  File "/Users/k_kitahara/.pyenv/versions/3.9.6/envs/py396/lib/python3.9/site-packages/algoliasearch/http/transporter.py", line 35, in write
    return self.request(verb, hosts, path, data, request_options, timeout)
  File "/Users/k_kitahara/.pyenv/versions/3.9.6/envs/py396/lib/python3.9/site-packages/algoliasearch/http/transporter.py", line 72, in request
    return self.retry(hosts, request, relative_url)
  File "/Users/k_kitahara/.pyenv/versions/3.9.6/envs/py396/lib/python3.9/site-packages/algoliasearch/http/transporter.py", line 92, in retry
    raise RequestException(content, response.status_code)
algoliasearch.exceptions.RequestException: too many synonyms in n-way synonym (in [370])

The batch of synonyms like as follows.

  • synonym A: a1, a2, a3, … a6
  • synonym B: b1, b2, b3, …, b30
  • synonym C: c1, c2

[NOTE] Since I restricted the maximum size of each synonym in 20, this error disappeared. In that sense, I suspect that Algolia couldn’t handle a synonym that has too many (maybe over 30) items in each group.

Does anyone have the idea that solves this, or know the maximum?

Best wishes,

Kosuke

1 Like