如何使用原始关键字和转换后的关键字进行搜索?我用 Elastica 索引了这样的数据:
id1: {
content: "Phòng tránh rủi ro",
content_canonical: "Phong tranh rui ro"
},
id2: {
content: "Phóng nhanh vượt ẩu",
content_canonical: "Phong nhanh vuot au"
},
id3: {
content: "Mô phỏng thực tế",
content_canonical: "Mo phong thuc te"
}
现在,当人们想搜索关键字phòng
时,我也想搜索关键字phong
(从 转换而来phòng
),但前者的得分应该高于后者。
如何使用 FOSElasticaBundle 或 ElasticSearch 做到这一点?