Try just "synonyms.txt". Note that synonyms.txt must be in the same directory that the configuration file since that path is relative to the config dir.
This is a different error than before. It tells you that some rule in your synonyms file (line 3) is bad. Usually the offending term appears after "term: " which is why I think this might be a blank line or something in your file. The error points out that some input terms in your synonyms file can never match because they get eliminated by the analysis chain the precedes the synonym filter.
Looks like the problem is not yet solved. Because when I put the file name instead of the entire path. The script runs successfully but the synonyms inside are not really mapped.
However when do it explicitly in the code like below, i get the results correctly.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.