PUT test
{
"mappings": {
"dynamic": true,
"properties": {
"firstname": {
"type": "text",
"copy_to": "fullname"
},
"lastname": {
"type": "text",
"copy_to": "fullname"
}
}
}
} PUT test/_doc/1
{
"firstname":"zhang"
} PUT test/_doc/2
{
"lastname":"san"
} # 搜索有结果,两者是or的关系
GET test/_search?q=fullname:(zhang san) # 搜索没有结果,两者and的关系
GET test/_search
{
"query": {
"term": {
"fullname": {
"value": "zhang san"
}
}
}
} DELETE test


#设置 index 为 false
DELETE users
PUT users
{
"mappings" : {
"properties" : {
"firstName" : {
"type" : "text"
},
"lastName" : {
"type" : "text"
},
"mobile" : {
"type" : "text",
"index": false
}
}
}
} PUT users/_doc/1
{
"firstName":"Ruan",
"lastName": "Yiming",
"mobile": "12345678"
} POST /users/_search
{
"query": {
"match": {
"mobile":"12345678"
}
}
} #设定Null_value DELETE users
PUT users
{
"mappings" : {
"properties" : {
"firstName" : {
"type" : "text"
},
"lastName" : {
"type" : "text"
},
"mobile" : {
"type" : "keyword",
"null_value": "NULL"
} }
}
} PUT users/_doc/1
{
"firstName":"Ruan",
"lastName": "Yiming",
"mobile": null
} PUT users/_doc/2
{
"firstName":"Ruan2",
"lastName": "Yiming2" } GET users/_search
{
"query": {
"match": {
"mobile":"NULL"
}
} } #设置 Copy to
DELETE users
PUT users
{
"mappings": {
"properties": {
"firstName":{
"type": "text",
"copy_to": "fullName"
},
"lastName":{
"type": "text",
"copy_to": "fullName"
}
}
}
}
PUT users/_doc/1
{
"firstName":"Ruan",
"lastName": "Yiming"
} GET users/_search?q=fullName:(Ruan Yiming) POST users/_search
{
"query": {
"match": {
"fullName":{
"query": "Ruan Yiming",
"operator": "and"
}
}
}
} #数组类型
PUT users/_doc/1
{
"name":"onebird",
"interests":"reading"
} PUT users/_doc/1
{
"name":"twobirds",
"interests":["reading","music"]
} POST users/_search
{
"query": {
"match_all": {}
}
} GET users/_mapping

自定义mapping与常见参数的更多相关文章

  1. 显式Mapping设置与常见参数介绍

    原文:显式Mapping设置与常见参数介绍 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/ ...

  2. java自定义注解实现前后台参数校验

    2016.07.26 qq:992591601,欢迎交流 首先介绍些基本概念: Annotations(also known as metadata)provide a formalized way ...

  3. asp.net core参数保护之自定义要保护的参数类型

    asp.net core参数保护之自定义要保护的参数类型 Intro 为了实现 asp.net core 下的参数保护,扩展了asp.net core 中 DataProtection,可以自动化的保 ...

  4. Java虚拟机--------JVM常见参数

    JVM 调优常见参数 Java1.7的jvm参数查看一下官方网站. http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java. ...

  5. 性能测试三十六:内存溢出和JVM常见参数及JVM参数调优

    堆内存溢出: 此种溢出,加内存只能缓解问题,不能根除问题,需优化代码堆内存中存在大量对象,这些对象都有被引用,当所有对象占用空间达到堆内存的最大值,就会出现内存溢出OutOfMemory:Java h ...

  6. Jmeter,常见参数 vars、prev、ctx 、props 类的api--beanshell

    http://www.cnblogs.com/fnng/p/5827577.html---------jmeter 性能测试 jmeter常见参数 vars.prev.ctx .props 类的api ...

  7. JVM系列(1)- JVM常见参数及堆内存分配

    常见参数配置 基于JDK1.6 -XX:+PrintGC 每次触发GC的时候打印相关日志 -XX:+UseSerialGC 串行回收模式 -XX:+PrintGCDetails 打印更详细的GC日志 ...

  8. ElasticSearch(五):Mapping和常见字段类型

    ElasticSearch(五):Mapping和常见字段类型 学习课程链接<Elasticsearch核心技术与实战> 什么是Mapping Mapping类似数据库中的schema的定 ...

  9. Dynamic Mapping和常见字段类型

    原文:Dynamic Mapping和常见字段类型 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn. ...

随机推荐

  1. postgresql自增id

    drop index Ix_product_define_id; drop index Ix_user_umid; drop table invims_product_attention; /*=== ...

  2. 03 uniapp自定义导航栏的开发

    在我眼里自定义导航分2类: 原生基础上 || 非原生基础上 总结:项目当中能原生就原生,提高性能 区别 uni-app 自带原生导航栏,在pages.json里配置. 原生导航的体验更好,渲染新页面时 ...

  3. git和提交分支

    实习到今天,已经开始做项目一段时间了,当然只是实习生的个人项目. 项目是导师发在git上面的,要求我们用git的PR提交 可是我不会啊...git仅仅是简单的个人提交总的项目到仓库里,什么新建分支,p ...

  4. HMS Core音频编辑服务音源分离与空间音频渲染,助力快速进入3D音频的世界

    从单声道.立体声.环绕声发展到三维声,音频回放技术的迭代演进是为了还原真实世界的声音.其中,三维声技术使用信号处理的方法对到达两耳的声音信号进行模拟,将声场还原为三维空间,更接近真实世界.凭借这个技术 ...

  5. Vue 监视数据总结 && 表单控件使用总结

    1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8" /> 5 & ...

  6. MySQL主从复制之半同步(semi-sync replication)

    GreatSQL社区原创内容未经授权不得随意使用,转载请联系小编并注明来源. 半同步简介 MASTER节点在执行完客户端提交的事务后不是立刻返回结果给客户端,而是等待至少一个SLAVE节点接收并写到r ...

  7. Spring的简单使用(3)

    一:SM框架的整合: 所需要的依赖: <dependency> <groupId>junit</groupId> <artifactId>junit&l ...

  8. 总结-LCT

    题单: https://www.zybuluo.com/xzyxzy/note/1027479 LuoguP3203 [HNOI2010]弹飞绵羊 动态加边,删边 #include <cstdi ...

  9. SpringBoot接收MultipartFile文件,并保存文件

    package com.hrw.controller; import com.hrw.pojo.Result; import org.apache.tomcat.util.http.fileuploa ...

  10. 手把手教你怎么将linux的一个函数性能搞奔溃

    static struct fib_table *fib_empty_table(struct net *net){    u32 id;    for (id = 1; id <= RT_TA ...