On a side note, if you're looking to support a general list of words, you might want to consider using semantic search, which uses ML models to pull up conceptually related words, without having to set them up as synonyms:
https://typesense.org/docs/guide/semantic-search.html