➜ elasticsearch cat query.sh
curl -XPOST http://192.168.2.143:9200/poems/poem/_search/ -d '
{
"query": {
"bool": {
"must": {
"bool" : { "should": [
{ "match": { "title": "静夜思" }},
{ "match": { "content": "故人" }}
] }
},
"must": { "term": { "cat_id": 1 }}
}
}
}'
类似
select *from poems where cat_id=1 and (title like '%静夜思%' or content like '%故人%');