我对ElasticSearch中的query_string
查询有疑问。我想创建索引中的所有类型和字段的全文搜索。字符串是否对嵌套对象执行query_string
?例如,我有这个映射Elasticsearch嵌套对象query_string
{
"my_index": {
"mappings": {
"my_type": {
"properties": {
"group": {
"type": "string"
},
"user": {
"type": "nested",
"properties": {
"first": {
"type": "string"
},
"last": {
"type": "string"
}
}
}
}
}
}
}
}
和查询
GET /my_index/_search
{
"query": {
"query_string" : {
"query" : "paul"
}
}
}
所以,当我打电话查询,将ES跨越包括嵌套或仅在my_type对象和嵌套搜索所有字段进行搜索我将不得不使用嵌套查询?
感谢@anthonybruni,“不过,我发现,伪场‘_all’包含嵌套字段,所以这个查询我uld在myNestedObj.myTextField(以及其他任何地方)找到包含'food'的文档“这个答案正是我所要求的 – Pauli