我将实现多语言搜索功能,我正在阅读'Spring data Solr但是找不到有关如何使用Spring数据Solr实现多语言查询的更多细节 .

考虑有一个带有动态字段的Solr集合,我们根据区域设置索引文档 . 现在,如果我使用Spring数据Solr,我将不得不创建一个包含与所有语言环境匹配的字段的实体 .

例如 . Solr schema.xml中定义的字段

......

dynamicField name =“name_en_us”type =“text_en_us”indexed =“true”stored =“true”required =“false”docValues =“false”multiValued =“false”

dynamicField name =“name_fr_fr”type =“text_fr_fr”indexed =“true”stored =“true”required =“false”docValues =“false”multiValued =“false”

......

'name'字段将在实体中添加为:name_en_us,name_fr_fr,name_en_uk,......

我们有什么方法可以动态地做到这一点吗?我的意思是在实体中只有一个字段名称并且基于语言环境使用Spring数据从Solr获取文档?

请建议 .