ES已存在的索引下添加映射
解釋如下:給ticketing_order_info的索引,增加映射字段verificationCodeState,字段類型為integer
實現(xiàn):
PUT /ticketing_order_info/_mapping/
{
????"properties": {
????????"verificationCodeState": {
????????????"type": "integer"
????????}
????}
}
PUT /ticketing_order_info/_mapping/
{
????"properties": {
????????"isTouristGroupName": {
????????????"type": "keyword",
??????????????"ignore_above": 256
????????}
????}
}
解釋如下:給ticketing_order_info的索引,增加映射字段payTypeName,字段類型為String,并設置為關鍵字
PUT /ticketing_order_info/_mapping/
{
????"properties": {
????????"payTypeName": {
????????????"type": "keyword",
??????????????"ignore_above": 256
????????}
????}
}
PUT /ticketing_order_details/_mapping/
{
? ? "properties": {
? ? ? ? "delFlag": {
? ? ? ? ? ? "type": "integer"
? ? ? ? }
? ? }
}
解釋如下:給ticketing_order_details的索引,增加映射字段touristGroupId,字段類型為long
PUT /ticketing_order_details/_mapping/
{
? ? "properties": {
? ? ? ? "touristGroupId": {
? ? ? ? ? ? "type": "long"
? ? ? ? }
? ? }
}
PUT /ticketing_order_details/_mapping/
{
? ? "properties": {
? ? ? ? "seatNumber": {
? ? ? ? ? ? "type": "keyword",
? ? ? ? ? ? "ignore_above": 256
? ? ? ? }
? ? }
}
PUT /ticketing_order_details/_mapping/
{
? ? "properties": {
? ? ? ? "createBy": {
? ? ? ? ? ? "type": "keyword",
? ? ? ? ? ? "ignore_above": 256
? ? ? ? }
? ? }
}
PUT /ticketing_order_details/_mapping/
{
? ? "properties": {
? ? ? ? "updateBy": {
? ? ? ? ? ? "type": "keyword",
? ? ? ? ? ? "ignore_above": 256
? ? ? ? }
? ? }
}
PUT /ticketing_order_details/_mapping/
{
? ? "properties": {
? ? ? ? "remarks": {
? ? ? ? ? ? "type": "keyword",
? ? ? ? ? ? "ignore_above": 256
? ? ? ? }
? ? }
}
解釋如下:給ticketing_order_details的索引,增加映射字段showTime,字段類型為date,并設置自定義時間格式
PUT /ticketing_order_details/_mapping/
{
? ? "properties": {
? ? ? ? "showTime": {
? ? ? ? ? ? ? ? "type": "date",
? ? ? ? ? ? ? ? "format": "yyyy-MM-dd HH:mm:ss || yyyy-MM-dd'T'HH:mm:ss'+08:00' || strict_date_optional_time || epoch_millis"
? ? ? ? ? ? }
? ? }
}
PUT /ticketing_order_details/_mapping/
{
? ? "properties": {
? ? ? ? "createTime": {
? ? ? ? ? ? ? ? "type": "date",
? ? ? ? ? ? ? ? "format": "yyyy-MM-dd HH:mm:ss || yyyy-MM-dd'T'HH:mm:ss'+08:00' || strict_date_optional_time || epoch_millis"
? ? ? ? ? ? }
? ? }
}
PUT /ticketing_order_details/_mapping/
{
? ? "properties": {
? ? ? ? "updateTime": {
? ? ? ? ? ? ? ? "type": "date",
? ? ? ? ? ? ? ? "format": "yyyy-MM-dd HH:mm:ss || yyyy-MM-dd'T'HH:mm:ss'+08:00' || strict_date_optional_time || epoch_millis"
? ? ? ? ? ? }
? ? }
}
PUT /ticketing_order_details/_mapping/
{
? ? "properties": {
? ? ? ? "businessCode": {
? ? ? ? ? ? "type": "integer"
? ? ? ? }
? ? }
}文章來源:http://www.zghlxwxcb.cn/news/detail-599133.html
PUT /ticketing_order_details/_mapping/
{
? ? "properties": {
? ? ? ? "businessKindId": {
? ? ? ? ? ? "type": "long"
? ? ? ? }
? ? }
}文章來源地址http://www.zghlxwxcb.cn/news/detail-599133.html
到了這里,關于ES映射操作 已創(chuàng)建的ES索引 增加映射字段(類似DB庫增加給表增加字段)一樣的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!