我是elasticsearch的新手,并且很难在嵌套对象中查询->leftjoin('k.personToKey', 'ptk')
字段。这是我的映射(我在谈论'not_analyzed'
字段):
"subscriptions.entity_type"
这是一个示例条目:
{
"app": {
"mappings": {
"user_subscriptions": {
"properties": {
"subscriptions": {
"type": "nested",
"properties": {
"entity_id": {
"type": "integer"
},
"entity_type": {
"type": "string",
"index": "not_analyzed"
},
"event_name": {
"type": "string"
}
}
},
"test": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}
在尝试使用精确值查询{
"took": 1,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "app",
"_type": "user_subscriptions",
"_id": "12",
"_score": 1,
"_source": {
"test": "DevCommunityBundle:Topic",
"subscriptions": [
{
"entity_type": "DevCommunityBundle:Topic",
"entity_id": 3,
"event_name": "test"
}
]
}
}
]
}
}
字段时,我会得到预期的结果,但是,当我尝试使用相同的确切值查询"test"
时,我得不到任何结果。