This is exactly the problem and the reason why there isn't a "generic" synonym support available as far as I know, neither in Lucene nor in Elasticsearch. A lot of people use something like WordNet or some similar resources available on the web though and it kind of works most of the time. The synonym token filter has Wordnet syntax support, I think you need to download the Prolog version, then dive for the "wn_s.pl" in the tar file and use that. I haven't tried it myself to be honest but looking at the file, the format looks about right. Don't know about the quality though. Let me know if that works, I'd be interested in getting it a shot myself...
1 Like