zoukankan      html  css  js  c++  java
  • 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"
    }
    }
    }
    }
    }

  • 相关阅读:
    使用::befor和::after伪元素在网站中添加图标
    使用LESS对CSS进行预处理
    window.innerWidth和document.body.clientWidth的区别
    javascript原型链继承
    javascript中的类型检测
    ASP.NET网站报Service Unavailable错误的解决办法
    在ASP.NET MVC中使用UEditor无法提交的解决办法
    EasyUI DataGrid设置列宽为百分比导致表头和内容错位的解决方法
    使用JS读取本地文本文件(兼容各种浏览器)
    美化上传文件按钮
  • 原文地址:https://www.cnblogs.com/net2817/p/11236030.html
Copyright © 2011-2022 走看看