Elasticsearch报出这个错误是因为查询了一个数组到带有null的原因:
{
"query": {
"bool": {
"must": [{
"term": {
"jz_customer-customer_type": 2
}
}, {
"bool": {
"should": [{
"terms": {
"jz_customer-city_id": [null,"2","3","4"] //注意就是这个地方
}
}]
}
}, {
"term": {
"jz_customer-has_ka": 0
}
}, {
"term": {
"jz_customer-status": 0
}
}]
}
},
"from": 0,
"size": 10,
"sort": {
"jz_customer-modify_at": "desc"
}
}
相当于sql 中的where in (null ,1,2,3),打印出请求的json 串,如果到检索中查询,返回的错误: