zoukankan      html  css  js  c++  java
  • Elasticsearch学习笔记(五)索引元数据和集群元数据

    一、索引元数据


    执行:GET /ecommerce/product/1
    返回结果:
    {
       "_index": "ecommerce",
       "_type": "product",
       "_id": "1",
       "_version": 1,
       "found": true,
       "_source": {
         "name": "gaolujie yagao",
         "desc": "gaoxiao meibai",
         "price": 30,
         "producer": "gaolujie producer",
         "tags": [
           "meibai",
           "fangzhu"
         ]
       }
    }

    image



    二、集群元数据


    三、document的_source元数据


    添加document:   
             PUT /test_index/test_type/1
    {
       "test_field1": "test field1",
       "test_field2": "test field2"
    }
    查询指定document:
    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的时候,会原封不动的给我们返回回来。
            定制返回的结果,指定_source中,返回哪些field
        
             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_field2": "test field2"
       }

    }

  • 相关阅读:
    2021.1.18 HTML标签及元素
    嵌入式发展史简述及一些概念
    06 突破512字节的限制 上
    50 排序的工程应用示例
    01 进阶操作系统
    05 主引导程序的扩展-下
    04 主引导程序的扩展-上
    03 调试环境的搭建
    在windows下使用linux命令,GnuWin32的使用.
    gcc -I -L -l区别
  • 原文地址:https://www.cnblogs.com/wshcn/p/8150529.html
Copyright © 2011-2022 走看看