单个条件
from,size可省略,size默认10
curl 'localhost:9200/accounts/person/_search' -d '
{
"query": {
"match": {
"desc": "管理"
}
},
"from": 0,
"size": 10,
"sort": [
{
"order_no": "asc"
}
]
}'
多个条件
各个条件之间为and关系
curl 'localhost:9200/accounts/person/_search' -d '
{
"query": {
"bool": {
"must": [
{
"match": {
"corpus_statement": "情况 意思"
}
},
{
"terms": {
"corpus_speaker": ["坐席","客户"]
}
},
{
"terms": {
"corpus_type": ["服务质量-语气生硬","服务语气-调侃"]
}
},
{
"match": {
"create_date": "20200424"
}
}
]
}
}
}'
批量查询
比如根据ID
curl 'localhost:9200/accounts/person/_mget' -d '
{
"ids":["2peNO3IB2wbGJe6oFY5B","0pfHL3IB2wbGJe6o4Y4K"]
}'