您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
elasticSearch的multi_match查询(指定多个字段查询)
发布时间:2021-09-06 21:05:02编辑:雪饮阅读()
elasticSearch的multi_match查询
此查询将文本或短语与多个字段匹配。 例如,
请求正文:
{
"query":{
"multi_match" : {
"query": "pune",
"fields": [ "city", "name" ]
}
}
}
响应正文:
{
"took": 9,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 2,
"relation": "eq"
},
"max_score": 1.7427702,
"hits": [
{
"_index": "schools",
"_type": "school",
"_id": "4",
"_score": 1.7427702,
"_source": {
"name": "pune",
"description": "ICSE",
"street": "West End",
"state": "UP",
"zip": "250002",
"location": [
28.9926174,
77.692485
],
"fees": 3500,
"tags": [
"fully computerized"
],
"rating": "4.5"
}
},
{
"_index": "schools",
"_type": "school",
"_id": "3",
"_score": 1.2039728,
"_source": {
"name": "Central School",
"description": "ICSE",
"street": "West End",
"city": "pune",
"state": "UP",
"zip": "250002",
"location": [
28.9926174,
77.692485
],
"fees": 3500,
"tags": [
"fully computerized"
],
"rating": "4.5"
}
}
]
}
}
关键字词:elasticSearch,multi_match,查询
相关文章
- elasticSearch匹配查询
- elasticSearch集群健康状态变黄yellow及Unassigned问
- elasticSearch查询DSL-匹配所有查询
- elasticSearch节点hot_threads
- elasticSearch集群api-节点统计
- elasticSearch群集更新设置api参数flat_settings的使
- elasticSearch群集更新设置(transient)
- elasticSearch集群获取设置api与群集更新设置(persist
- elasticSearch分片(主分片、副本分片)与节点的关系
- elasticSearch集群配置-cluster.initial_master_nodes