這篇文章給大家介紹Elasticsearch中怎么添加新字段,內容非常詳細,感興趣的小伙伴們可以參考借鑒,希望對大家能有所幫助。
創(chuàng)新互聯建站服務項目包括黃驊網站建設、黃驊網站制作、黃驊網頁制作以及黃驊網絡營銷策劃等。多年來,我們專注于互聯網行業(yè),利用自身積累的技術優(yōu)勢、行業(yè)經驗、深度合作伙伴關系等,向廣大中小型企業(yè)、政府機構等提供互聯網行業(yè)的解決方案,黃驊網站推廣取得了明顯的社會效益與經濟效益。目前,我們服務的客戶以成都為中心已經輻射到黃驊省份的部分城市,未來相信會繼續(xù)擴大服務區(qū)域并繼續(xù)獲得客戶的支持與信任!
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中怎么添加新字段就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。