elasticsearc 参考资料
_source 和store
http://stackoverflow.com/questions/17103047/why-do-i-need-storeyes-in-elasticsearch
You usually send a field to elasticsearch because you either want to search on it, or retrieve it. But it's true that if you don't store the field explicitly and you don't disable the source you can still retrieve the field using the _source. This means that in some cases it might actually make sense to have a field that is not indexed nor stored.
When you store a field, that's done in the underlying lucene. Lucene is an inverted index, that allows for fast full-text search and gives back document ids given text queries. Beyond the inverted index Lucene has some kind of storage where the field values can be stored in order to be retrieved given a document id. You usually store in lucene the fields that you want to return as search results. Elasticsearch doesn't require to store every field that you want to return because it always stores by default every document that you send to it, thus it's always able to return everything you sent to it as search result.
In just a few cases it might be useful to store fields explicitly in lucene: when the _source field is disabled, or when we want to avoid parsing it, even if the parsing is done automatically by elasticsearch. Keep in mind though that retrieving many stored fields from lucene might require one disk seek per field while with retrieving only the _source from lucene and parsing it in order to retrieve the needed fields is just a single disk seek and just faster in most of the cases.
如果字段的属性store 被设置为no,也可以通过_source获取文档,然后解析出该字段的内容,但是前提是_source的属性"enabled": true。
Aggregation
http://chrissimpson.co.uk/elasticsearch-aggregations-overview.html
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations.html
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-order
Top Hit Aggregation
https://www.elastic.co/guide/en/elasticsearch/reference/1.6/search-aggregations-metrics-top-hits-aggregation.html
Shards and replicas
一个shard 实际上是一个lucence index
主分片可以接受index,副本不行;但是查询都可以
http://blog.trifork.com/2014/01/07/elasticsearch-how-many-shards/
Aggregation
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations.html
Aggregation不准确
Mapping
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/mapping-intro.html
每个文档在索引中都有一个类型,每个类型有自己的mapping或者叫模型定义。mapping定义类型中的字段,每个字段的数据类型,以及在弹性搜索中字段是被如何处理的。mapping也用来配置与类型相关的元数据。
弹性搜索支持如下的简单字段数据类型:
- String:
string - Whole number:
byte,short,integer,long - Floating-point:
float,double - Boolean:
boolean - Date:
date
当你索引一个包含新字段的文档时,弹性搜索根据JSON的基本数据类型来猜测文档字段的数据类型。具体的对应关系如下:
|
JSON type |
Field type |
|
Boolean: |
|
|
Whole number: |
|
|
Floating point: |
|
|
String, valid date: |
|
|
String: |
|
analyzed- 先分词,再索引。
not_analyzed- 直接索引,所以它是可搜索的,但是用全值建索引,不分词。
no- 不建索引,所以该字段是不可搜索的。
String类型的属性,默认值是analyzed,所以想要用原始值建索引,需要设置为 not_analyzed。
其他类型(例如long,double,date)也有index属性,但是备选值只有no和not_analyzed,这些值永远不会被分词
elasticsearc 参考资料的更多相关文章
- Node相关参考资料
参考资料: [玩转Nodejs日志管理log4js]http://blog.fens.me/nodejs-log4js/ [dependencies与devDependencies之间的区别]http ...
- CQRS及.NET中的参考资料
(此文章同时发表在本人微信公众号"dotNET每日精华文章",欢迎右边二维码来关注.) 题记:CQRS作为一种设计模式,其实一点都不新鲜了.不过今天有朋友感叹.NET朋友也关注CQ ...
- 【GoLang】GoLang 微服务、开源库等参考资料
参考资料: GoLang书籍: https://github.com/dariubs/GoBooksGo名库: https://github.com/Unknwon/go-rock-libraries ...
- 最大化 AIX 上的 Java 性能,第 5 部分: 参考资料和结论
http://www.ibm.com/developerworks/cn/aix/library/es-Javaperf/es-Javaperf5.html 最大化 AIX 上的 Java 性能,第 ...
- Cocos2d-x--开发参考资料
1.CocoStudio使用指南 所用版本:CocoStudio v3.0.0 Cocos2d-x1.5b 自己网上查找并整理的一些资料,留下做个纪念,也希望对有需要的人有点帮助 链接地址:http: ...
- Android各层推荐开发书籍及参考资料
Android各层推荐开发书籍及参考资料 转自:http://blog.csdn.net/fancylovejava/article/details/8657058 Android系统按照架构来说一共 ...
- JVM调优总结(十二)-参考资料
能整理出上面一些东西,也是因为站在巨人的肩上.下面是一些参考资料,供大家学习,大家有更好的,可以继续完善:) · Java 理论与实践: 垃圾收集简史 · Java SE 6 HotSpot[tm] ...
- c# WebBrowser开发参考资料
原文:c# WebBrowser开发参考资料 c# WebBrowser开发参考资料,所有资料的采集均来自网上 话说有了WebBrowser类,终于不用自己手动封装SHDocVw的AxWebBrows ...
- C# 语言规范_版本5.0 (第21章 附录C_参考资料)
A. 参考资料 Unicode 联合会.The Unicode Standard, Version 3.0(Unicode 标准 3.0 版).Addison-Wesley,Reading,Massa ...
随机推荐
- 校园网络 usaco
这道题和上一道[最受欢迎的牛]差不多,都是强连通分量的练习题: 第一问实际上就是问缩点后入度为0的点有多少,第二问就是问添加几条边能使缩点后的图变成强连通图: 第一问好做,第二问需要动下脑子,也不难: ...
- UVA - 11475 Extend to Palindrome —— 字符串哈希 or KMP or 后缀数组
题目链接:https://vjudge.net/problem/UVA-11475 题意: 给出一个字符串,问在该字符串后面至少添加几个字符,使得其成为回文串,并输出该回文串. 题解: 实际上是求该字 ...
- <tx:advice/> 有关的设置
将描述通过 <tx:advice/> 标签来指定不同的事务性设置.默认的 <tx:advice/> 设置如下: 事务传播设置是 REQUIRED 隔离级别是 DEFAULT 事 ...
- 使用C++模拟C#的委托机制
1. [代码][C/C++]代码 //Event.h #ifndef _EVENT_H_#define _EVENT_H_class EmptyObject {};template<typen ...
- 创建一个HTML5与JQuery结合的幻灯片
1. [代码][JavaScript]代码 $(window).load(function(){ //我们监听了 window.load 事件,因此我们确定幻灯片上的所有图片都能够正确进行加载. ...
- 第一节 课程简介与HTML5概述
第一节 课程简介与HTML5概述 *********************************************************** 1.1课程简介 教学目的: 从基础入手到能够运 ...
- PyNLPIR python中文分词工具
官网:https://pynlpir.readthedocs.io/en/latest/ github:https://github.com/tsroten/pynlpir NLP ...
- composer镜像安装laravel
博主最近在学习Laravel的框架的相关知识,对于Laravel的许多新特性,大家最好还是去查看官网文档最好,Laravel的文档非常完善,中文英文的都有,可以很好的解决你的困惑. 但是我们会发现学习 ...
- nginx开发笔记_ngx_hash源码解析
ngx_hash源码解析 ngx_hash是nginx中的hash表结构,具有以下特点: 静态结构,hash表创建后无法动态添加/删除KV. 采用连续存储方式解决碰撞问题.即出现碰撞的KV存放在连续地 ...
- robotium 测试APK<一> 建立测试工程
1.准备Android开发环境 2.准备签名工具http://www.troido.de/re-sign.jar 1.建立测试工程 打开Eclipse,点击File->New一个Android ...