我正在将以下文档编入索引如下:
{
"_index": "transactions",
"_type": "transaction",
"_id": "1",
"_score": 1,
"_source": {
"title": "another backup",
"action": "3"
}
}
现在让我们假设我有另一个静态文档,其中包含操作的所有映射:
{
"_index": "transactions",
"_type": "actions",
"_id": "1",
"_score": 1,
"_source": {
"3": "backup",
"2": "upload",
"1": "AnotherAction"
}
},
它会将action字段值映射到存储在transactions / actions / 1?
中的值所以当我做GET /transactions/transaction/_search
我会得到这样的东西:
{
"_index": "transactions",
"_type": "transaction",
"_id": "1",
"_score": 1,
"_source": {
"title": "another backup",
"action": "backup"
}
}
如果我可以这样做的话?如果没有其他方法可以将属性值为“枚举”的此类文档编入索引,同时知道它们的值将来可能会发生变化。
感谢, 射线。