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"
       }

    }

  • 相关阅读:
    javamail发送邮件
    java复制文件夹中的所有文件和文件夹到另一个文件夹中
    jsp中使用out和response.getOutputStream的方法
    PHP数组用法
    PHP中的session
    java中list按照某个属性排序方法
    java读取xml文件内容
    C#实现验证码
    java实现验证码功能
    Java IO(四)------字节输入输出流
  • 原文地址:https://www.cnblogs.com/wshcn/p/8150529.html
Copyright © 2011-2022 走看看