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

}

二、集群元数据

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

}

原文地址:https://www.cnblogs.com/wshcn/p/8150529.html

时间: 2024-08-09 18:47:53

Elasticsearch学习笔记(五)索引元数据和集群元数据的相关文章

蜗龙徒行-Spark学习笔记【三】Spark集群中worker节点扩展实战经验

一.集群原先配置: 从机名sparkMaster,Ubuntu12.04-32 ,用户名Root , 内存4g    (只用于任务调度和分配,不做计算节点) 从机名sparkSlave1,Ubuntu12.04-32 ,用户名Root , 内存4g    (计算节点) 从机名sparkSlave2,Ubuntu12.04-32 ,用户名Root , 内存1.7g (计算节点) 二.扩展原因:计算数据量增大,原先的两个工作节点已不不能满足实时性的需求,由于实验室计算资源有限,故将原先的调度节点也增

Elasticsearch 学习笔记2 集群和数据

集群术语 - 节点: 一个elasticsearch实例(一个elasticsearch进程)就是一个节点 - 集群: 由一个或者多个elasticsearch节点组成 - 主节点: 临时管理集群级别变更:新建/删除索引,新建/移除节点,不参与文档级别变更或者搜索,当数据量增长时,不会成为集群瓶颈,集群只有一个主节点,通过各个节点选举产生 - 分片(shard):是最小级别工作单元,它只是保存了索引中所有数据的一部分 - 主分片:每个文档属于一个单独主分片,主分片数量可以在创建索引时指定,默认个

jQuery源码学习笔记五 六 七 八 转

jQuery源码学习笔记五 六 七 八 转 Js代码   <p>在正式深入jQuery的核心功能选择器之前,还有一些方法,基本都是数组方法,用于遴选更具体的需求,如获得某个元素的所有祖选元素啦,等等.接着是其缓存机制data.</p> <pre class="brush:javascript;gutter:false;toolbar:false"> //@author  司徒正美|なさみ|cheng http://www.cnblogs.com/ru

Caliburn.Micro学习笔记(五)----协同IResult

Caliburn.Micro学习笔记(五)----协同IResult 今天说一下协同IResult 看一下IResult接口 /// <summary> /// Allows custom code to execute after the return of a action. /// </summary> public interface IResult { /// <summary> /// Executes the result using the specif

NLTK学习笔记(五):分类和标注词汇

[TOC] 词性标注器 之后的很多工作都需要标注完的词汇.nltk自带英文标注器pos_tag import nltk text = nltk.word_tokenize("And now for something compleyely difference") print(text) print(nltk.pos_tag(text)) 标注语料库 表示已经标注的标识符:nltk.tag.str2tuple('word/类型') text = "The/AT grand/J

python之list(学习笔记五)

python之list(学习笔记五) Python内置的一种数据类型是列表:list.list是一种有序的集合,可以随时添加和删除其中的元素. 比如,列出公司里同事的名字,就可以用一个list表示: >>> worker = ['wtf','laotan','xiaoxian'] >>> worker ['wtf', 'laotan', 'xiaoxian'] 变量 worker 就是一个list.用 len() 函数可以获得list元素的个数: >>>

Elasticsearch学习笔记(四)ElasticSearch分布式机制

一.Elasticsearch对复杂分布式机制透明的隐藏特性 1.分片机制: (1)index包含多个shard,每个shard都是一个最小工作单元,承载部分数据,lucene实例,完整的建立索引和处理请求的能力           (2)shard分为:primary shard和replica shard.                 primary shard:接受写和读请求.                 replica shard是primary shard的副本,负责容错,以及

angular学习笔记(五)-阶乘计算实例(1)

<!DOCTYPE html> <html ng-app> <head> <title>2.3.2计算阶乘实例1</title> <meta charset="utf-8"> <script src="../angular.js"></script> <script src="script.js"></script> </

Linux System Programming 学习笔记(五) 进程管理

1. 进程是unix系统中两个最重要的基础抽象之一(另一个是文件) A process is a running program A thread is the unit of activity inside of a process the virtualization of memory is associated with the process, the threads all share the same memory address space 2. pid The idle pro