日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

16、分布式文档系统--document的_source元数据以及定制返回结果解析(来自学习资料+自己整理)

發布時間:2024/9/27 windows 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 16、分布式文档系统--document的_source元数据以及定制返回结果解析(来自学习资料+自己整理) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1、_source元數據

準備一條數據

put /test_index/test_type/1 {"test_field1": "test field1","test_field2": "test field2" }

然后獲取數據

get /test_index/test_type/1

顯示的結果是:

{"_index": "test_index","_type": "test_type","_id": "1","_version": 2,"found": true,"_source": {"test_field1": "test field1","test_field2": "test field2"} }

知識點:
_source元數據:就是說,我們在創建一個document的時候,使用的是那個放在request body的json串。默認情況下,在get的時候,會原封不動的返回回來。

為了能夠定制返回的結果,可以使用下面的方式:

2、定制返回結果

定制返回的結果,是通過指定_source,然后寫上返回哪些field來實現。
命令:

GET /test_index/test_type/1?_source=test_field1

返回內容是:

{"_index": "test_index","_type": "test_type","_id": "1","_version": 2,"found": true,"_source": {"test_field1": "test field1"} }

如果想指定多列,命令如下:

GET /test_index/test_type/1?_source=test_field1,test_field2

結果如下:

{"_index": "test_index","_type": "test_type","_id": "1","_version": 2,"found": true,"_source": {"test_field1": "test field1","test_field2": "test field2"} }

也就是說,可以通過逗號,然后加上列名即可

總結

以上是生活随笔為你收集整理的16、分布式文档系统--document的_source元数据以及定制返回结果解析(来自学习资料+自己整理)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。