【发布时间】:2016-12-05 16:11:25
【问题描述】:
我对 ElasticSearch 中的 query_string 查询有疑问。我想对索引中的所有类型和字段创建全文搜索。 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 对象中,而对于嵌套搜索,我将不得不使用嵌套查询?
【问题讨论】:
标签: elasticsearch