私は次の関数を書き、以下に示すような応答を得ました:
public async Task<GetMappingResponse> ShowMapping(string indexname)
{
var result =await _client.Indices.GetMappingAsync(new GetMappingRequest(indexname));
return result;
}
応答:
{
"apiCall": {
"auditTrail": [
{
"event": 5,
"node": {
"clientNode": false,
......
......
"name": null,
"settings": {},
"uri": "http://localhost:9200/"
},
"path": "pure/_mapping",
"ended": "2020-01-22T11:25:48.2324298Z",
"started": "2020-01-22T11:25:47.836833Z",
"exception": null
}
],
"debugInformation": "Successful (200) low level call on GET: /pure/_mapping\r\n# Audit trail of this API call:\r\n - [1] PingSuccess: Node: http://localhost:9200/ Took: 00:00:00.1716082\r\n - [2] HealthyResponse: Node: http://localhost:9200/ Took: 00:00:00.3955968\r\n# Request:\r\n<Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>\r\n
#Response:\r\n{\"pure\":{\"mappings\":{\"properties\":{\"ID\":{\"type\":\"integer\"},\"Name\":{\"type\":\"text\"},\"category\":{\"type\":\"nested\",\"properties\":{\"catid\":{\"type\":\"integer\"},\"catname\":{\"type\":\"text\"}}}}}}}\r\n",
"deprecationWarnings": [],
..........
..........
"uri": "http://localhost:9200/pure/_mapping",
"connectionConfiguration": {}
}
}
ご覧のとおり、debuginformation フィールドには必要な応答が含まれています。kibana で取得するようなマッピング形式を取得する方法を教えてください。
必要な応答:
{
"pure": {
"mappings": {
"properties": {
"ID": {
"type": "integer"
},
"Name": {
"type": "text"
},
"category": {
"type": "nested",
"properties": {
"catid": {
"type": "integer"
},
"catname": {
"type": "text"
}
}
}
}
}
}
}