elasticsearch RESTful
一 、索引(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的更多相关文章
- 利用kibana学习 elasticsearch restful api (DSL)
利用kibana学习 elasticsearch restful api (DSL) 1.了解elasticsearch基本概念Index: databaseType: tableDocument: ...
- post 中文数据到elasticsearch restful接口报json_parse_exception 问题
我们的客户端程序直接调用es 的restful接口, 通过post json数据去查询, 但post数据有中文的时候,有些中文会报异常,有些中文不会 {"error":{" ...
- 用 Mahout 和 Elasticsearch 实现推荐系统
原文地址 本文内容 软件 步骤 控制相关性 总结 参考资料 本文介绍如何用带 Apache Mahout 的 MapR Sandbox for Hadoop 和 Elasticsearch 搭建推荐引 ...
- ElasticSearch入门 附.Net Core例子
1.什么是ElasticSearch? Elasticsearch是基于Lucene的搜索引擎.它提供了一个分布式,支持多租户的全文搜索引擎,它具有HTTP Web界面和无模式JSON文档. Elas ...
- 学习笔记之Elasticsearch
Elasticsearch: RESTful, Distributed Search & Analytics | Elastic https://www.elastic.co/products ...
- Net Core ElasticSearch入门
ElasticSearch入门 附.Net Core例子 https://www.cnblogs.com/CoderAyu/p/9564977.html 1.什么是ElasticSearch? Ela ...
- ElasticSearch学习文档2018.11
1 Elasticsearch安装 1.1 ES6.0版本安装head插件 1.1 下载head插件 下载地址:https://github.com/mobz/elasticsear ...
- Elasticsearch系列---生产数据备份恢复方案
前言 生产环境中运行的组件,只要有数据存储,定时备份.灾难恢复是必修课,mysql数据库的备份方案已经非常成熟,Elasticsearch也同样有成熟的数据备份.恢复方案,我们来了解一下. 概要 本篇 ...
- Elasticsearch入坑指南之RESTful API
Elasticsearch入坑指南之RESTful API Tags:Elasticsearch ES为开发者提供了非常丰富的基于Http协议的Rest API,通过简单的Rest请求,就可以实现非常 ...
随机推荐
- 解决应用程序无法正常启动0xcxxxxxxxxxx问题
简述:使用VS2008写了一个MFC程序,结果传到别人的机子上(WIN7)出现应用程序正常初始化(0xc0150002)失败的问题.为什么我的机子上可以,而别人的机子上运行不了呢?下面是我找到的一个解 ...
- 学习Zookeeper之第1章Zookeeper入门
第 1 章 Zookeeper入门 1.1 概述 1.2 特点 1.3 数据结构 1.4 应用场景 统一命名服务 统一配置管理 统一集群管理 服务器动态上下线 软负载均衡 1.5 下载地址 第 1 章 ...
- 【问题解决:未找到端口号】启动报错Circular placeholder reference 'server.port' in property definitions
问题描述: 启动spring boot项目时报错:Circular placeholder reference 'server.port' in property definitions 解决过程: ...
- luogu P1162 填涂颜色
https://www.luogu.org/problem/show?pid=1162 //其实很简单的吧 //就是最外圈加一圈0 ,然后把外圈里面的0都遍历了 //剩下的0 就变成2 就行了 #in ...
- k8s 学习笔记 etcd
1. Etcd Etcd是Kubernetes集群中的一个十分重要的组件,用于保存集群所有的网络配置和对象的状态信息.在后面具体的安装环境中,我们安装的etcd的版本是v3.1.5,整个kuberne ...
- python 返回系统名称,系统平台,系统版本
import platform import os print(os.name) print(platform.system()) print(platform.release())
- css可应用的渐进增强新特性
1. 让有滚动行为的元素平滑滚动 scroll-behavior: smooth; <div class="smooth"> </dvi> .smooth ...
- Java网络编程和NIO详解4:浅析NIO包中的Buffer、Channel 和 Selector
Java网络编程与NIO详解4:浅析NIO包中的Buffer.Channel 和 Selector 转自https://www.javadoop.com/post/nio-and-aio 本系列文章首 ...
- Python - learn note(1)
1. 下载安装Python 2.7(为了向下兼容以前的版本), Python 3.5(VS2015不支持配置3.6的环境) 教程 需要使用VS2015进行开发,必须勾选上后面两项: 2. VS2015 ...
- 《转》深入理解Activity启动流程(二)–Activity启动相关类的类图
本文原创作者:Cloud Chou. 出处:本文链接 本系列博客将详细阐述Activity的启动流程,这些博客基于Cm 10.1源码研究. 在介绍Activity的详细启动流程之前,先为大家介绍Act ...