Query DSL 方式
GET /_search
{
“json字符串”
}GET /_search
{
"query": {
"match_all": {}
}
}GET /test_index/test_type/_search
{
"query": {
"match": {
"test_field": "test"
}
}
}Last updated
GET /_search
{
“json字符串”
}GET /_search
{
"query": {
"match_all": {}
}
}GET /test_index/test_type/_search
{
"query": {
"match": {
"test_field": "test"
}
}
}Last updated
GET /website/article/_search
{
"query": {
"bool": {
"must": [
{
"match": {
"title": "elasticsearch"
}
}
],
"should": [
{
"match": {
"content": "elasticsearch"
}
}
],
"must_not": [
{
"match": {
"author_id": 111
}
}
]
}
}
}{
"query": {
"bool": {
"must": { "match": { "name": "tom" }},
"should": [
{ "match": { "hired": true }},
{ "bool": {
"must": { "match": { "personality": "good" }},
"must_not": { "match": { "rude": true }}
}}
],
"minimum_should_match": 1
}
}
}