1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-24 20:47:11 +00:00
This commit is contained in:
Xargin 2018-07-11 12:11:53 +08:00
parent f75bed0fc3
commit b76317b9d0

View File

@ -97,38 +97,43 @@ es 定义了一套查询 DSL当我们把 es 当数据库使用时,需要用
{ {
"query": { "query": {
"bool": { "bool": {
"must": [{ "must": [
"match": { {
"field_1": { "match": {
"query": "1", "a": {
"type": "phrase" "query": "1",
"type": "phrase"
}
}
},
{
"match": {
"b": {
"query": "2",
"type": "phrase"
}
}
},
{
"match": {
"c": {
"query": "3",
"type": "phrase"
}
}
},
{
"match": {
"d": {
"query": "4",
"type": "phrase"
}
} }
} }
}, { ]
"match": {
"field_2": {
"query": "2",
"type": "phrase"
}
}
}, {
"match": {
"field_3": {
"query": "3",
"type": "phrase"
}
}
}, {
"match": {
"field_4": {
"query": "4",
"type": "phrase"
}
}
}]
} }
}, },
"from": 0, "from": 0,
"size": 1 "size": 1
} }
``` ```