我的问题基本上与这里描述的相同,但是在该讨论组中仍未得到答案。
我的映射:
{
"abstract": {
"properties": {
"summary": {
"type": "string"
}
}
},
"authors": {
"type": "nested",
"properties": {
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
}
}
}
}
我想在这两个字段上执行全文搜索,可能是不均匀加权的。我能想到的查询语句是这样的,但不幸的是它不起作用:{
"query": {
"bool": {
"should": [{
"multi_match": {
"query": "higgs boson",
"fields": ["abstract.summary^5", "author.last_name^2"]
}
}]
}
}
}
由于作者字段的嵌套映射,我没有得到任何结果。但我也无法摆脱嵌套属性 - 我需要它进行聚合。有没有什么优雅的想法来解决这个问题?