操作
原文:https://docs.elrond.com/sdk-and-tools/indices/es-index-operations
## _id
该索引的 _id 字段由十六进制编码的交易或智能合约结果哈希表示。
字段
该索引包含交易和智能合约结果。这很有用,因为可以在一个请求中同时查询这两者。
统一的结构将包含一个额外的字段,以便能够区分它们。
田 | 描述 |
---|---|
类型 | 交易时可以是normal ,智能合约结果时可以是unsigned 。 |
查询示例
取地址的最新操作
ADDRESS="erd1..."
curl --request GET \
--url ${ES_URL}/operations/_search \
--header 'Content-Type: application/json' \
--data '{
"query": {
"bool": {
"should": [
{
"match": {
"sender": "${ADDRESS}"
}
},
{
"match": {
"receiver": "${ADDRESS}"
}
},
{
"match": {
"receivers": "${ADDRESS}"
}
}
]
}
},
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}'