mongo同步至ES数据

Wesley13
• 阅读 511

启动服务

#查看所有记录状态

GET _search
{
"query": {
"match_all": {}
}
}

#查看集群健康状态

GET _cat/health

#查看节点状态
GET _cat/nodes

#查看索引状态
GET _cat/indices

#查看总记录数
get _cat/count

#查看分片情况
get _cat/shards

#查看安装的插件

get _cat/plugins

删除索引
DELETE /joke_test

PUT /joke_test

POST _reindex
{
"source": {
"index": "joke_test"
},
"dest": {
"index": "joke_testa"
}}

PUT /joke_test
GET joke_test/_mapping?pretty

get joke_test/_search

get _cat/plugins
put joke/_alias/joke_test
get joke3

get _template
delete _template/

get _template/ptt_joke

POST _template/ptt_joke
{
"order": 0,
"template": "joke_test*",
"settings": {
"index": {
"refresh_interval": "5s",
"analysis": {
"analyzer": {
"optimizeIK": {
"filter": [
"stemmer"
],
"type": "custom",
"tokenizer": "ik_max_word"
}
}
},
"number_of_shards": "3",
"number_of_replicas": "1"
}
}
}

get _search/template
delete joke3/_mapping/
delete joke_test
get joke_test

PUT joke_test
{
"mappings": {
"news_article": {
"properties": {
"ability": {
"properties": {
"ability_code": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"id": {
"type": "long"
},
"img_id": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"parent_id": {
"type": "long"
}
}
},
"author_id": {
"type": "long"
},
"content": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"gmt_create": {
"type": "date"
},
"gmt_update": {
"type": "date"
},
"is_delete": {
"type": "long"
},
"is_online": {
"type": "long"
},
"is_original": {
"type": "long"
},
"label_array": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "ik_smart"
},
"level_code": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"news_type": {
"type": "long"
},
"online_date": {
"type": "date"
},
"resource_ids": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"source": {
"type": "long"
},
"status": {
"type": "long"
},
"transmit_type": {
"type": "long"
},
"type": {
"type": "long"
},
"user": {
"properties": {
"age": {
"type": "long"
},
"gender": {
"type": "long"
},
"id": {
"type": "long"
},
"loc": {
"properties": {
"coordinates":{
"type": "geo_point"
}
}
},
"popularity": {
"type": "long"
}
}
}
}
},
"resource": {
"dynamic": "false",
"properties": {
"label_array": {
"type": "text",
"analyzer": "ik_smart"
},
"online_time": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss"
},
"source_crawl_time": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"source_publish_time": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"title": {
"type": "text",
"analyzer": "ik_smart"
}
}
}
}
}

点赞
收藏
评论区
推荐文章
blmius blmius
2年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Stella981 Stella981
2年前
Linux下查看CPU型号,内存大小,硬盘空间的命令(详解)
1查看CPU1.1查看CPU个数\cat/proc/cpuinfo|grep"physicalid"|uniq|wcl2\\uniq命令:删除重复行;wc–l命令:统计行数\\1.2查看CPU核数\cat/proc/cpuinfo|grep"cpucores"|uniqc
Stella981 Stella981
2年前
Electron npm install 常见错误(Linux)
Linux版本Ubuntu12.04(32bit)安装Gitsudoaptgetinstallgit生成sshkey查看有没有sshkeycd~/.ssh生成sshkeygen查询cat~/.ssh/id_rsa.pub
Stella981 Stella981
2年前
Linux系统性能检测常用命令
查看CPU数量总核数物理CPU个数X每颗物理CPU的核数总逻辑CPU数物理CPU个数X每颗物理CPU的核数X超线程数查看物理CPU个数:cat/proc/cpuinfo|grep"physicalid"|sort|uniq|wcl
Wesley13 Wesley13
2年前
Mysql 查看所有线程,被锁的表等
\查看所有MYSQl相关的线程\showfullprocesslist;\杀死线程id为2的线程\kill2\查看服务器状态\showstatuslike'%lock%';\查看服务器配置参数\showvariablesli
Stella981 Stella981
2年前
From表单提交的几种方式
<body<formaction"https://my.oschina.net/u/3285916"method"get"name"formOne"id"formId"name:<inputtype"text"name"name"pwd:<inputtyp
Stella981 Stella981
2年前
SpringBoot之actuator
在springBoot中集成actuator可以很方便的管理和监控应用的状态。暴露的Restful接口有:HTTP方法路径描述鉴权GET/autoconfig查看自动配置的使用情况trueGET/configprops查看配置属性,包括默认配置trueGET/beans查看bean及其关系列表
Wesley13 Wesley13
2年前
MongoDB 分片管理(一)检查集群状态
一、检查集群状态1.1使用sh.status()查看集群摘要信息1、使用sh.status()可以查看分片信息、数据库信息、集合信息sh.status()如果数据块较多时,使用sh.status(true)又是输出会很多,就不会截断,要使用如下查看2、tooman
Easter79 Easter79
2年前
SpringBoot之actuator
在springBoot中集成actuator可以很方便的管理和监控应用的状态。暴露的Restful接口有:HTTP方法路径描述鉴权GET/autoconfig查看自动配置的使用情况trueGET/configprops查看配置属性,包括默认配置trueGET/beans查看bean及其关系列表
Wesley13 Wesley13
2年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_