mongo同步至ES数据

启动服务

 

#查看所有记录状态

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"
}
}
}
}
}

posted on   net2817  阅读(770)  评论(0编辑  收藏  举报

编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示