Elasticsearch 抛出异常。我添加了一个额外的[ 并使用 Kibana 中的开发工具控制台运行了正则表达式查询。
GET indexname/_search
{
"query": {
"regexp":{
"field_name": "t.[st"
}
}
}
我得到search_phase_exception如下:
{
"error": {
"root_cause": [
{
"type": "query_shard_exception",
"reason": "failed to create query: {\n \"regexp\" : {\n \"field_name\" : {\n \"value\" : \"t.[st\",\n \"flags_value\" : 65535,\n \"max_determinized_states\" : 10000,\n \"boost\" : 1.0\n }\n }\n}",
"index_uuid": "6fy0LZRxQrOrNEFMGqL0wA",
"index": "indexname"
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "systems",
"node": "LvCoGAkyTbiVIeyF7UtXTw",
"reason": {
"type": "query_shard_exception",
"reason": "failed to create query: {\n \"regexp\" : {\n \"field_name\" : {\n \"value\" : \"t.[st\",\n \"flags_value\" : 65535,\n \"max_determinized_states\" : 10000,\n \"boost\" : 1.0\n }\n }\n}",
"index_uuid": "6fy0LZRxQrOrNEFMGqL0wA",
"index": "indexname",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "expected ']' at position 5"
}
}
}
]
},
"status": 400
}
希望有帮助!