您好,登錄后才能下訂單哦!
這篇文章給大家介紹Elasticsearch中怎么添加新字段,內容非常詳細,感興趣的小伙伴們可以參考借鑒,希望對大家能有所幫助。
1、添加字段,并設置是否索引
PUT http://xxx.xxx.xxx.xxx:9200/goods_info/_mapping
{ "properties": { "content": { "type":"text", "index":false } } }
2、獲取字段mapping
GET http://xxx.xxx.xxx.xxx:9200/goods_info/_mapping
{ "goods_info": { "mappings": { "properties": { "browseLevels": { "type": "long" }, "categoryIds": { "type": "long" }, "content": { "type": "text", "index": false }, "dataType": { "type": "long" }, "endTimeMs": { "type": "long" }, "esId": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256 } } }, "esxSellOut": { "type": "boolean" }, "extTypes": { "type": "long" }, "goodsCode": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256 } } }, "goodsId": { "type": "long" }, "groupIds": { "type": "long" }, "hasOption": { "type": "long" }, "isBuyNumLimit": { "type": "boolean" }, "isDiscount": { "type": "long" }, "isJoinMemberPrice": { "type": "long" }, "joinMemberDiscount": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256 } } }, "labelIds": { "type": "long" }, "levelCredit1": { "type": "long" }, "levelCredit2": { "type": "long" }, "levelCredit3": { "type": "long" }, "levelPrice1": { "type": "float" }, "levelPrice2": { "type": "float" }, "levelPrice3": { "type": "float" }, "levelSalesCount1": { "type": "long" }, "levelSalesCount2": { "type": "long" }, "levelSalesCount3": { "type": "long" }, "maxBuyTotal": { "type": "long" }, "maxPrice": { "type": "float" }, "minPrice": { "type": "float" }, "originalPrice": { "type": "float" }, "price": { "type": "float" }, "putawayTime": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256 } } }, "putawayTimeMs": { "type": "long" }, "salesCount": { "type": "long" }, "salesHide": { "type": "long" }, "shopId": { "type": "long" }, "shortTitle": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256 } } }, "startTimeMs": { "type": "long" }, "status": { "type": "long" }, "stock": { "type": "long" }, "stockHide": { "type": "long" }, "subTitle": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256 } } }, "thumb": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256 } } }, "title": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256 } } }, "type": { "type": "long" }, "unit": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256 } } }, "video": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256 } } }, "virtualCardId": { "type": "long" }, "zeroCashLevel": { "type": "long" } } } } }
關于Elasticsearch中怎么添加新字段就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。