本文介绍了在指定Elasticsearch的同义词过滤器时,使用peers_path和使用同义词有什么区别吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在性能方面,在指定Elasticsearch的同义词过滤器时,在使用同义词_path和使用同义词之间有什么区别吗?请参考图像。请注意,在我的ES集群中,有许多索引将使用同一个同义词过滤器。

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.

我提出这个问题,因为显然AWS ES不允许将文件直接上传到集群。因此,我需要使用API​​上传同义词数据。

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.

推荐答案

你没有选择,因为你不能使用同义词文件。您唯一的选择是提供索引设置中的所有同义词。

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.

这篇关于在指定Elasticsearch的同义词过滤器时,使用peers_path和使用同义词有什么区别吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-28 08:24