1.得到所有数据。
POST /_search
2.查询索引库所有
POST /db_test/_search
3.查询索引库中某个类型数据
POST /db_test/person/_search
4.查询年龄等于3的人
POST /db_test/person/_search?q=age:3
5.对字段查询
POST /db_test/person/_search
{ "query":{ "bool":{ "must":[
{ "range":{ "age":{ "from":"500","to":"800" }
}
},
{ "term":{ "intro":"研究" }
}]
}
}
}
6.查询索引库db_test表person中age大于500,intro包含"研究"或者"方鸿渐"的数据
POST /db_test/person/_search
{ "query":{ "bool":{ "must":[
{ "range":{ "age":{ "gt":"500" }
}
},
{ "terms":{ "intro":["研究","方鸿渐"]
}
}]
}
}
}
7.
引用于http://eggtwo.com/news/detail/147