It is also possible to add different boosts to different fields of a document. The only requirement here is that the boosted fields must store the norms (“omitNorms” attribute in the schema must be set to “false”).
最近接到一个需要,需要在spring data elasticsearch关联的实体类中动态的根据配置文件动态创建索引名称,比如开发环境下索引名称为user-dev,测试环境下为user-test,生产环境为user-prod
一开始接到这个需要觉得很怪,因为不同环境的区分直接搭建不同的es服务器环境不就行了吗,为什么要这么麻烦来处理呢?后来了解到是因为当前项目成本受限,需要隔离开发环境和测试环境用的同一台服务器,于是就产生了这个奇怪的需求。
其实想想,不排除某些场景下,就需要动态的创建索引名称。于是今天我们就来看看怎么实现这个需求