我想用 NEST 索引 JsonObjects,在发布属性在索引中但值为空“[]”之后。当我用 Postman 发布相同的 json 时,结果是正确的。
指数:
string indexName = "testindex";
IIndexResponse response = client.Index<JObject>(docItem, i => i.Type("my_type").Index(indexName));
docItem 中的 json:
{
"Source":"test",
"CreatedAt": "2018-05-26 12:23:33",
"SessionId":"1234",
"ResponseParam":{
"ItemA":"bla",
"ItemB": 123
}
}
搜索查询:
http://[IP]:9200/testindex/_search
搜索结果
{
"took": 8,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 4,
"max_score": 1,
"hits": [
{
"_index": "testindex",
"_type": "my_type",
"_id": "u44ucmMB687Uyj7O8xKY",
"_score": 1,
"_source": {
"Source": [],
"CreatedAt": [],
"SessionId": [],
"ResponseParam": {
"ItemA": [],
"ItemB": []
}
}
},
相关分类