-
验证通过
GET /accounts/person/_validate/query?explain
{
"query":{
"match": {
"user": "lisi"
}
}
}
返回:
{
"valid": true,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"explanations": [
{
"index": "accounts",
"valid": true,
"explanation": "+user:lisi #(#_type:person)"
}
]
}
-
验证不通过
GET /accounts/person/_validate/query?explain
{
"query":{
"math": {
"user": "lisi"
}
}
}
返回:
{
"valid": false,
"error": "org.elasticsearch.common.ParsingException: no [query] registered for [math]"
}