一 、索引(index)

1. 创建索引

(1)第一种方式

PUT twitter
{
"settings" : {
"index" : {
"number_of_shards" : 3,
"number_of_replicas" : 2
}
}
}

(2)第二种方式

①:没有指定mapping

curl -XPOST "http://127.0.0.1:9200/productindex"
{"acknowledged":true}

②:查看mapping

curl -XGET "http://127.0.0.1:9200/productindex/_mapping?pretty"
{
"productindex" : {
"mappings" : { }
}
}

2. 删除索引

DELETE /twitter

二、结构(map)

1. 创建index的过程中创建mapper,如果已经存在则报如下错误

PUT index_an
{
"mappings": {
"egan": {
"properties": {
"title": { "type": "string" },
"name": { "type": "string" },
"age": { "type": "integer" },
"created": {
"type": "date",
"format": "strict_date_optional_time||epoch_millis"
}
}
}
}
}

2. 下面的错误由于:elasticsearch 2.X不支持text,好像5.X才支持,2.X使用的是string

3. 正常如下

4. 添加mapping

5. 查看mapping

6. 添加mapping

{
"product": {
"properties": {
"amount":{
"type":"integer"
}
}
}
}

7. 查看

8. 修改mapping

http://www.cnblogs.com/Creator/p/3722408.html

elasticsearch RESTful的更多相关文章

  1. 利用kibana学习 elasticsearch restful api (DSL)

    利用kibana学习 elasticsearch restful api (DSL) 1.了解elasticsearch基本概念Index: databaseType: tableDocument: ...

  2. post 中文数据到elasticsearch restful接口报json_parse_exception 问题

    我们的客户端程序直接调用es 的restful接口, 通过post json数据去查询, 但post数据有中文的时候,有些中文会报异常,有些中文不会 {"error":{" ...

  3. 用 Mahout 和 Elasticsearch 实现推荐系统

    原文地址 本文内容 软件 步骤 控制相关性 总结 参考资料 本文介绍如何用带 Apache Mahout 的 MapR Sandbox for Hadoop 和 Elasticsearch 搭建推荐引 ...

  4. ElasticSearch入门 附.Net Core例子

    1.什么是ElasticSearch? Elasticsearch是基于Lucene的搜索引擎.它提供了一个分布式,支持多租户的全文搜索引擎,它具有HTTP Web界面和无模式JSON文档. Elas ...

  5. 学习笔记之Elasticsearch

    Elasticsearch: RESTful, Distributed Search & Analytics | Elastic https://www.elastic.co/products ...

  6. Net Core ElasticSearch入门

    ElasticSearch入门 附.Net Core例子 https://www.cnblogs.com/CoderAyu/p/9564977.html 1.什么是ElasticSearch? Ela ...

  7. ElasticSearch学习文档2018.11

    1       Elasticsearch安装 1.1    ES6.0版本安装head插件 1.1 下载head插件 下载地址:https://github.com/mobz/elasticsear ...

  8. Elasticsearch系列---生产数据备份恢复方案

    前言 生产环境中运行的组件,只要有数据存储,定时备份.灾难恢复是必修课,mysql数据库的备份方案已经非常成熟,Elasticsearch也同样有成熟的数据备份.恢复方案,我们来了解一下. 概要 本篇 ...

  9. Elasticsearch入坑指南之RESTful API

    Elasticsearch入坑指南之RESTful API Tags:Elasticsearch ES为开发者提供了非常丰富的基于Http协议的Rest API,通过简单的Rest请求,就可以实现非常 ...

随机推荐

  1. Ubuntu16.04 安装JDK Tomcat

    Ubuntu16.04安装jdk,下载linux中的64版本 需要下载jdk,tomcat安装包 tar.gz版本的 http://pan.baidu.com/s/1mi4WVhA 安装JDK: ho ...

  2. AngularJs 控制台

    在控制台查看$scope对象 html: 通过控制器里面的一个元素来获取这个控制器的$scope var node=document.getElementById("NewsVote&quo ...

  3. try catch finally return

    public override bool Start(IServerConfig config) { bool flag = true; listenSocket = new Socket(Liste ...

  4. 子网掩码与ip有实际关系吗?

    子网掩码是作为ip地址的标识,还是本身就是ip地址的一部分?例如10.10.10.1/24和10.10.10.1/25是同一个ip地址吗? 作者:知乎用户链接:https://www.zhihu.co ...

  5. hdu 4417 Super Mario 树状数组||主席树

    Super Mario Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Prob ...

  6. css3 导入字体

    在CSS中导入字体或是字体ICON @font-face{ src: url("具体的字体地址"), url("具体的字体地址"); }

  7. 关闭pm2

    先查找ID pm2 status 然后 pm2 stop id pm2 delete id

  8. MongoDB中的数据聚合工具Aggregate和Group

    周煦辰 2016-01-16 来说说MongoDB中的数据聚合工具. Aggregate是MongoDB提供的众多工具中的比较重要的一个,类似于SQL语句中的GROUP BY.聚合工具可以让开发人员直 ...

  9. Java实现GUI计算器【代码】

    这几天用java写了一个计算器程序,开始写的时候原本只是想实现一下GUI(这个是直接读三个字母还是什么“固椅”的发音)界面,熟悉一下Java GUI 编程,为Java期末大作业练练手,本以为代码不会很 ...

  10. vue.js-读取/发送数据

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...