Is there any difference between using synonyms_path and using synonyms when specifying synonym filter for Elasticsearch?

北慕城南 提交于 2019-12-04 01:30:39

问题


In term of performance, is there any difference between using synonyms_path and using synonyms when specifying synonym filter for Elasticsearch ? Please refer to the images for example. Note that in my ES cluster, there are many indices that will make use of this same synonym filter.

I am asking this question, because apparently AWS ES does not allow one to upload a file directly to the cluster. Therefore, I need to upload the synonym data by using the API.


回答1:


You don't have a choice then since you cannot use a synonyms file. Your only choice is to provide all the synonyms in the index settings.

Code-wise, whether the synonyms are read from a string or from a file, it makes almost no difference. The only difference will be that all the synonyms will be stored in all the indices that need them, so that boils down to wasting a bit of storage space, but that's negligible (of course it depends how many synonyms you have, i.e. a few hundreds or many thousands).

What hurts more is that if you need to modify the synonyms list, you'll need to modify all your indices, instead of just a single file.



来源:https://stackoverflow.com/questions/41480527/is-there-any-difference-between-using-synonyms-path-and-using-synonyms-when-spec

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!