Synonyms path vs inline array?

In the documentation for synonyms it is recommended to use synonyms_path instead of a string array in synonyms.

In my environment, file access is not simple, and I plan on updating my synonyms frequently. As such I've decided instead to programmatically fill in the synonyms into the mapping at index update time instead of trying to deal with a file.

Is there a performance reason why not to use synonyms as an array of strings? What are the benefits to using a synonyms file over just putting it directly into the mapping during update?

Hello Kevin_Christensen,

By using the inline representation, there will be 2 data structures in memory to represent the same thing (the one from the mapping and the other one parsed inside the token filter itself), so you'll consume more memory.

For large datasets, it is recommended to use the file to reduce memory usage.

Cheers