且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在弹性搜索索引时如何做映射

更新时间:2023-02-08 19:22:49

删除现有索引

curl -XDELETE "http://hostname:9200/index/type"

删除现有的河流配置索引

curl -XDELETE "http://hostname:9200/_river"

创建映射索引

curl -XPUT "http://hostname:9200/index/type/_mapping" -d'
{
"allnews": {
    "properties": {
        "category": {
            "type": "string"
        },
        "description": {
            "type": "string"
        },
        "link": {
            "type": "string"
        },
        "state": {
            "type": "string",
            "index" : "not_analyzed"
        },
        "title": {
            "type": "string"
        }
    }
}
}'

河插件配置同步mongodb到弹性搜索。

After these steps put the river plugin config sync mongodb to elasticsearch.

HOpe它有帮助..!

HOpe it helps..!