GET /his_index/_search
{
"query": {
"match": {
"project_name": "血清白蛋白测定(化学法)"
}
},
"collapse": {
"field": "project_name"
}
}
报错
{
"error" : {
"root_cause" : [
{
"type" : "illegal_argument_exception",
"reason" : "collapse is not supported for the field [project_name] of the type [text]"
}
],
"type" : "search_phase_execution_exception",
"reason" : "all shards failed",
"phase" : "query",
"grouped" : true,
"failed_shards" : [
{
"shard" : 0,
"index" : "his_index",
"node" : "fSOy_2PUTGar7-7gO6YREg",
"reason" : {
"type" : "illegal_argument_exception",
"reason" : "collapse is not supported for the field [project_name] of the type [text]"
}
}
],
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "collapse is not supported for the field [project_name] of the type [text]",
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "collapse is not supported for the field [project_name] of the type [text]"
}
}
},
"status" : 400
}
text分词的字段不支持 collapse吗?还是我写错了?还是7.14.0版本不支持collapse
{
"query": {
"match": {
"project_name": "血清白蛋白测定(化学法)"
}
},
"collapse": {
"field": "project_name"
}
}
报错
{
"error" : {
"root_cause" : [
{
"type" : "illegal_argument_exception",
"reason" : "collapse is not supported for the field [project_name] of the type [text]"
}
],
"type" : "search_phase_execution_exception",
"reason" : "all shards failed",
"phase" : "query",
"grouped" : true,
"failed_shards" : [
{
"shard" : 0,
"index" : "his_index",
"node" : "fSOy_2PUTGar7-7gO6YREg",
"reason" : {
"type" : "illegal_argument_exception",
"reason" : "collapse is not supported for the field [project_name] of the type [text]"
}
}
],
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "collapse is not supported for the field [project_name] of the type [text]",
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "collapse is not supported for the field [project_name] of the type [text]"
}
}
},
"status" : 400
}
text分词的字段不支持 collapse吗?还是我写错了?还是7.14.0版本不支持collapse
1 个回复
Charele - Cisco4321
赞同来自:
text是分词的,collapse不了。
换成project_name.keyword