示例
GET /movies/_search?q=2012&df=title
{
"profile": true
}
# 泛查询
GET /movies/_search?q=2012
{
"profile": true
}
# 指定字段查询
GET /movies/_search?q=title:2012
{
"profile": true
}
#Term or phrase
# "beautiful mind" 等价于 beautiful AND mind, 还要求前后顺序保持一致
# beautiful mind 等价于 beautiful OR mind
# 使用引号,短语查询
GET /movies/_search?q=title:"beautiful mind"
{
"profile": true
}
# 分组查询
GET /movies/_search?q=title:(beautiful mind)
{
"profile": true
}
# 错误使用分组,mind 为泛查询
GET /movies/_search?q=title:beautiful mind
{
"profile": true
}
# 逻辑运算
GET /movies/_search?q=title:(beautiful AND mind)
{
"profile": true
}
GET /movies/_search?q=title:(beautiful NOT mind)
{
"profile": true
}
# 范围查询
GET /movies/_search?q=year:>1980
{
"profile": true
}
# 通配符查询
GET /movies/_search?q=title:b*
{
"profile": true
}
# 模糊查询
GET /movies/_search?q=title:beautifl~1
{
"profile": "true"
}
GET /movies/_search?q=title:"lord rings"~2
{
"profile": "true"
}
来源:oschina
链接:https://my.oschina.net/lemos/blog/3195251