一 、索引(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. 数据导入(一):Hive On HBase

    Hive集成HBase可以有效利用HBase数据库的存储特性,如行更新和列索引等.在集成的过程中注意维持HBase jar包的一致性.Hive与HBase的整合功能的实现是利用两者本身对外的API接口 ...

  2. 如何解决ubuntu报的错误:You must put some 'source' URIs in your sources.list

    答:添加deb-src开头的源,如 deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

  3. Data caching per request in Owin application

    Data caching per request in Owin application 解答1 Finally I found OwinRequestScopeContext. Very simpl ...

  4. Codeforces Round #398 (Div. 2) A,B,C,D

    A. Snacktower time limit per test 2 seconds memory limit per test 256 megabytes input standard input ...

  5. vue-router详解

    对于单页应用,官方提供了vue-router进行路由跳转的处理,本篇主要也是基于其官方文档写作而成. 安装 基于传统,我更喜欢采用npm包的形式进行安装. npm install vue-router ...

  6. python实现本地批量ping多个IP

    本文主要利用python的相关模块进行批量ping ,测试IP连通性. 下面看具体代码(python3): #!/usr/bin/env python#-*-coding:utf-8-*- impor ...

  7. 【Demo】jQuery 图片放大镜效果——模仿淘宝图片放大效果

    实现功能: 模仿淘宝图片放大效果,鼠标移动到小图片的某一处,放大镜对应显示大图片的相应位置. 实现效果: 实现代码: <!DOCTYPE html> <html> <he ...

  8. [转载]SQL语句练习

    .查询“生物”课程比“物理”课程成绩高的所有学生的学号: 思路: 获取所有有生物课程的人(学号,成绩) - 临时表 获取所有有物理课程的人(学号,成绩) - 临时表 根据[学号]连接两个临时表: 学号 ...

  9. bzoj 1854 构图 并查集

    我们可以把一件装备看成一条边,两个属性看成两个点,那么这就相当于读入了一张图 当读入每一个x,y时,我们找到两个点的祖先节点,fx,fy,我们保证祖先节点在该连通块 中编号(装备属性)最大,用flag ...

  10. cn_office_Professional_Plus_2010_vol_with_sp2-【x86+x64仅2.45GB】

    用官方sp2补丁在cn_office_Professional_Plus_2010_vol基础上集成,无其他任何添加及修改! 文件: cn_office_Professional_Plus_2010_ ...