【发布时间】:2018-04-17 03:46:22
【问题描述】:
我有以下 MongoDB 文档,我想在全文搜索中匹配每个属性时分配分数
@Document
public class User {
// there would be multiple industries and few or all could match, if any of the substring matched score is 40
private String industries;
// if there is any matching substring score is 10
private String regions;
// score is 20 on any match
private String cities;
}
在聚合阶段,如果是特定匹配,我可以检查计数并分配分数,但在全文搜索中,我如何知道哪些字段匹配?并为他们分配相关分数?
【问题讨论】:
标签: java mongodb search spring-data