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

前端 未结 1 752
闹比i
闹比i 2021-01-13 04:50

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

相关标签:
1条回答
  • 2021-01-13 05:19

    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.

    0 讨论(0)
提交回复
热议问题