0
我有以下Elasticsearch映射:Elasticsearch嵌套查詢和過濾
"show": {
"properties": {
"startsAt": {
"type": "date"
},
"venue": {
"type": "nested",
"properties": {
"name": {
"type": "string"
},
"address": {
"type": "string",
"index": "no"
},
"location": {
"type": "geo_point",
"lat_lon": true
},
"section": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
我想找到使用show.startsAt
,show.venue.location
和show.venue.section
特性的精確匹配。我一直在嘗試以下查詢,但沒有考慮到show.venue.section
。
bool: {
must: [
{match: {startsAt: starts}},
{
nested: {
path: 'venue',
query: {
match: {'venue.section': section}
},
filter: {
geo_distance: {
distance: '1m',
'venue.location': location
}
}
}
}
]
}