es 创建索引过程

该文详细展示了如何在Elasticsearch中创建一个名为bigxz_local_goods的索引,配置了自定义分析器my_analyzer,设置了别名bigxz_as_goods_local,同时提及了后续的角色和用户创建步骤。
摘要由CSDN通过智能技术生成

一、创建索引

PUT bigxz_local_goods
{
  "settings": {
    "index": {
      "number_of_shards": "3",
      "number_of_replicas": "1"
    },
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "tokenizer": "standard",
          "filter":["my_delimiter","lowercase"]
        }
      },
      "filter": {
        "my_delimiter": {
           "type":"word_delimiter",
            "preserve_original":true
        }
      }
    }
  },
  "mappings":{
    "properties": {
        "update_time": {
          "type": "long"
        },
  		"status": {
            "type": "short"
          },
  		"publish_type": {
            "type": "short"
          },
      "goods_id": {
        "type": "long"
      },
  		"goods_name": {
            "type": "text",
            "analyzer": "my_analyzer"
          },
  		"user_id": {
            "type": "long"
          },
          
  		"goods_addr": {
        "type": "text",
        "analyzer": "my_analyzer"
      },
  		"expire_time": {
  			"type": "long"
          },
  		"is_futures": {
            "type": "short"
          },
  		"is_multiple": {
            "type": "short"
          },
  		"origin_label": {
            "type": "keyword"
          },
  		"goods_title": {
            "type": "text",
            "analyzer": "my_analyzer"
          },
  		"map_type": {
  			"type": "short"
          },
  		"date": {
  			"type": "long"
        },
  		"currency_name": {
  			"type": "keyword"
        },
  		"pay_type": {
  			"type": "short"
        }
      }
  }
}

二、索引设置别名

POST /_aliases
{
  "actions": [
    {
      "add": {
        "alias": "bigxz_as_goods_local",
        "index": "bigxz_local_goods"
      }
    }
  ]
}

三、创建角色

在这里插入图片描述

四、创建用户

在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值