Elasticsearch 短语搜索 query->match_phrase
Elasticsearch 全文检索 大约 899 字短语搜索
精确匹配一系列单词或者短语。
使用match_phrase
curl -X GET "localhost:9200/megacorp/employee/_search?pretty=true" -H 'Content-Type: application/json' -d'
{
"query" : {
"match_phrase" : {
"about" : "rock climbing"
}
}
}
'
返回:
{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 1,
"relation" : "eq"
},
"max_score" : 1.4167402,
"hits" : [
{
"_index" : "megacorp",
"_type" : "employee",
"_id" : "1",
"_score" : 1.4167402,
"_source" : {
"first_name" : "John",
"last_name" : "Smith",
"age" : 25,
"about" : "I love to go rock climbing",
"interests" : [
"sports",
"music"
]
}
}
]
}
}
阅读 1643 · 发布于 2019-04-25
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看
换一批
-
VisualVM 监控注册成 Windows 服务的 Tomcat 之 jstatd 方式二阅读 937
-
Windows 使用 curl阅读 1623
-
Docker 部署 PostgreSQL阅读 362
-
软考-系统架构设计师:需求分类-需求获取阅读 1445
-
Arthas 使用 tt 命令抓取调用异常、调用耗时、传入参数、返回参数阅读 1938
-
Spring Boot logback 导致 /tmp 磁盘爆满阅读 2256
-
Oracle 两种连接模式 thin 与 oci 的区别阅读 2608
-
SpringMVC 请求流程阅读 508
-
走进 Rust:Windows 环境搭建阅读 3536
-
算法:二叉树的啮齿形层序遍历(蛇形遍历)阅读 644