【发布时间】:2016-03-23 21:45:33
【问题描述】:
所以我的问题与here 描述的基本相同,但是在小组中仍然没有答案。
我的映射:
{
"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"]
}
}]
}
}
}
由于作者字段的嵌套映射,我没有得到任何结果。我也无法摆脱嵌套属性 - 我将它用于聚合。任何优雅的想法如何解决它?
【问题讨论】:
-
在文档映射中,我看不到 2 个对象之间的链接。我相信如果您使用
nested对象,则需要将其映射为子对象,在properties内部,并指定nested query。 elastic.co/guide/en/elasticsearch/guide/current/…
标签: elasticsearch nested match nested-properties