国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

es elasticsearch 九 索引index 定制分詞器 type結(jié)構(gòu)后期棄用原因 定制動態(tài)映射 動態(tài)映射模板 零停機(jī)重建索引

這篇具有很好參考價值的文章主要介紹了es elasticsearch 九 索引index 定制分詞器 type結(jié)構(gòu)后期棄用原因 定制動態(tài)映射 動態(tài)映射模板 零停機(jī)重建索引。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報違法"按鈕提交疑問。

目錄

索引index

定制分詞器

Type底層結(jié)構(gòu)及棄用原因

定制 dynamic mapping

定制dynamic mapping template 動態(tài)映射模板

零停機(jī)重建索引

生產(chǎn)環(huán)境應(yīng)該度別名數(shù)據(jù)


索引index

Put /index

Stings 分片

Mapping 映射

Aliases 別名

增加

Put my_index2

{

?????? "settings":{

?????? ?? "number_of_shards":3,

?????? ?? "number_of_replicas":1

? },

? "mappings":{

??? "properties":{

????? "name":{"type":"text"}

??? }

? },

? "aliases":{

??? "default_index":{}

???

? }

}

Default_index 別名 也可以用來查詢

Get default_index/_doc/1

獲取索引信息

Get myindex

修改索引

es elasticsearch 九 索引index 定制分詞器 type結(jié)構(gòu)后期棄用原因 定制動態(tài)映射 動態(tài)映射模板 零停機(jī)重建索引

?

刪除必須設(shè)置索引名 防止 delete /_all 刪除全部索引

es elasticsearch 九 索引index 定制分詞器 type結(jié)構(gòu)后期棄用原因 定制動態(tài)映射 動態(tài)映射模板 零停機(jī)重建索引

?

定制分詞器

delete my_inde

#定制分詞器

put /my_index

{

? "settings":{

??? "analysis":{

????? "analyzer":{

??????? "es_std":{

????????? "type":"standard",

????????? "stopwords":"_english_"

??????? }

????? }

??? }

? }

}

#測試標(biāo)準(zhǔn)分詞器

get /my_index/_analyze

{

? "analyzer":"standard",

? "text":"a dog is in the house helloword"

}

#測試自定義分詞器

get /my_index/_analyze

{

? "analyzer":"es_std",

? "text":"a dog is in the house helloword"

}

delete /my_index

#定制分詞器詳細(xì)過程

#char_filter 預(yù)處理階段 & 轉(zhuǎn)and 分詞器

#filter 停用詞策略 the a 取消分詞

#analyzer 定制分詞器

# "char_filter":["html_strip","&_to_and"],? 標(biāo)簽 分詞器

put /my_index

{

? "settings":{

??? "analysis":{

????? "char_filter":{

??????? "&_to_and":{

????????? "type":"mapping",

????????? "mappings":["&=> and"]

??????? }

????? },

????? "filter":{

??????? "my_stopwords":{

????????? "type":"stop",

????????? "stopwords":["the","a"]

??????? }

????? },

????? "analyzer":{

??????? "my_analyzer":{

????????? "type":"custom",

????????? "char_filter":["html_strip","&_to_and"],

????????? "tokenizer":"standard",

????????? "filter":["lowercase","my_stopwords"]

??????? }

????? }

??? }

? }

}

#測試

#& 變成 and? the 消失? 測試成功

get /my_index/_analyze

{

? "analyzer":"my_analyzer",

? "text":"a dog is & in the house helloword"

}

Type底層結(jié)構(gòu)及棄用原因

預(yù)計Es 9 后徹底刪除

Type 是索引中區(qū)分?jǐn)?shù)據(jù)類型的

Es 存儲type不同機(jī)制

es elasticsearch 九 索引index 定制分詞器 type結(jié)構(gòu)后期棄用原因 定制動態(tài)映射 動態(tài)映射模板 零停機(jī)重建索引

?

對應(yīng)倆種數(shù)據(jù)類型 存儲方式

es elasticsearch 九 索引index 定制分詞器 type結(jié)構(gòu)后期棄用原因 定制動態(tài)映射 動態(tài)映射模板 零停機(jī)重建索引

?

Es 底層存儲結(jié)構(gòu)

es elasticsearch 九 索引index 定制分詞器 type結(jié)構(gòu)后期棄用原因 定制動態(tài)映射 動態(tài)映射模板 零停機(jī)重建索引

?

每條信息需要記錄,浪費(fèi)很多存儲空間,統(tǒng)一索引下 有很多type沒有值導(dǎo)致大量空值導(dǎo)致浪費(fèi)空間

所以預(yù)計在es9后徹底刪除這個字段

定制 dynamic mapping

定制 dynamic策略

#動態(tài)mapping映射狀態(tài) false 未設(shè)置字段不進(jìn)入倒排索引

#沒有定義的false 字段不會進(jìn)入倒排索引

#有定義的按照定義的 會進(jìn)入倒排索引

#可以插入新字段但是不會進(jìn)入倒排索引,定義的會進(jìn)入倒排索引

put myindex

{

? "mappings":{

??? "dynamic":false,

??? "properties":{

??????? "title":{"type":"text"},

??????? "address":{

????????? "type":"object",

????????? "dynamic":true

??????? }

??? }

???

? }

}

沒有動態(tài)映射的,通過中間詞是無法查詢的需要全文檢索才可以

#必須標(biāo)準(zhǔn)字段,多余字段會報錯無法存入

?"dynamic":strict,

#關(guān)閉日期探測,自動變成text類型“date_detection”:false

Put /myindex

{

“mappings”:{

?????? “date_detection”:false

}

}

Get /myindex/_maping

自定義日期格式

Put myindex

{

?????? "mappings":{

????????????? "dynamic_date_formats":["yyyy-MM-dd"]

}

}

傳來string 轉(zhuǎn)換long 或float"numeric_detection":true

delete myindex

Put myindex

{

?????? "mappings" :{

????????????? "numeric_detection":true

}

}

Put /myindex/_doc/1

{

"my_float":"1.0",

"my_long":"1"

}

get myindex/_doc/1

get /myindex/_mapping

es elasticsearch 九 索引index 定制分詞器 type結(jié)構(gòu)后期棄用原因 定制動態(tài)映射 動態(tài)映射模板 零停機(jī)重建索引

?

定制dynamic mapping template 動態(tài)映射模板

delete myindex

#創(chuàng)建動態(tài)映射模板如果命中規(guī)則,使用此模板英文分詞器

#*_en 結(jié)尾的使用text 存 英文分詞器

put /myindex

{

? "mappings":{

??? "dynamic_templates":[{

????? "en":{

??????? "match":"*_en",

??????? "match_mapping_type":"string",

??????? "mapping":{

????????? "type":"text"

????????? ,"analyzer":"english"

??????? }

????? }

??? }]

? }

}

put /myindex/_doc/1

{"te":"this is my xx_en"}

put /myindex/_doc/4

{"tccsssse":"this is 中文my? "}

get myindex/_mapping

匹配規(guī)則

Match 屬于什么

Unmatch 不屬于什么

Match_mapping_type 屬于什么類型

Path_match? 路徑匹配 *.xx?

Path_unmatch 路徑不匹配

es elasticsearch 九 索引index 定制分詞器 type結(jié)構(gòu)后期棄用原因 定制動態(tài)映射 動態(tài)映射模板 零停機(jī)重建索引

?

Norms false 指標(biāo)評分因素

es elasticsearch 九 索引index 定制分詞器 type結(jié)構(gòu)后期棄用原因 定制動態(tài)映射 動態(tài)映射模板 零停機(jī)重建索引

?

零停機(jī)重建索引

es elasticsearch 九 索引index 定制分詞器 type結(jié)構(gòu)后期棄用原因 定制動態(tài)映射 動態(tài)映射模板 零停機(jī)重建索引

?

在線上運(yùn)行的項(xiàng)目,發(fā)現(xiàn)不滿足要求,創(chuàng)建新索引把舊數(shù)據(jù)放到新索引中去,從而實(shí)現(xiàn)重建索引

拷貝索引數(shù)據(jù)時間,則是停機(jī)不太好

//愿索引 date

Put /my_index

{

“mappings”:{

?????? “name”:{

????????????? “type:”date”

}

}

}

//設(shè)置讀取位置

Put /my_index/_alias/prod_index

//新索引

Put /my_index_new

{

“mappings”:{

?????? “name”:{

????????????? “type:”text”

}

}

}

//切換別名值 程序讀取別名

Post /_aliases

{

?????? “actions”:[

????????????? {“remove”:{“index:”my_index”,”alias”:”prod_index”}}

{“add”:{“index:”my_index_new”,”alias”:”prod_index”}}

]

}

生產(chǎn)環(huán)境應(yīng)該度別名數(shù)據(jù)

es elasticsearch 九 索引index 定制分詞器 type結(jié)構(gòu)后期棄用原因 定制動態(tài)映射 動態(tài)映射模板 零停機(jī)重建索引

?

ok

持續(xù)更新文章來源地址http://www.zghlxwxcb.cn/news/detail-460524.html

到了這里,關(guān)于es elasticsearch 九 索引index 定制分詞器 type結(jié)構(gòu)后期棄用原因 定制動態(tài)映射 動態(tài)映射模板 零停機(jī)重建索引的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • ES查詢索引字段的分詞結(jié)果

    一、_termvectors? 1、查看文檔中某一個字段的分詞結(jié)果 GET /{index}/{type}/{_id}/_termvectors?fields=[field] 2、樣例: text的值為:https://www.b4d99.com/html/202204/45672.html 得到的結(jié)果: 二、_analyze 1、語法 2、樣例: text的值為:https://www.b4d99.com/html/202204/45672.html 得到的結(jié)果:

    2024年02月11日
    瀏覽(84)
  • ES-index索引配置

    ??index索引配置項(xiàng)使用。 index_options ??Index 有4中配置,可以控制倒排索引的內(nèi)容。 ??Text類型默認(rèn)記錄positions,其他默認(rèn)docs。記錄的內(nèi)容越多,所占用的空間越大。 ??Index 有4中配置如下: docs ??記錄 doc id 。 freqs ??記錄 doc id 和 term frequencies 。 positions ??記錄

    2023年04月08日
    瀏覽(16)
  • elasticsearch index sorting ,索引排序

    es默認(rèn)的搜索排序是_score,通過評分排序,但是對于大數(shù)據(jù)量,評分一致的情況下也還是會亂序,官方說可以使用_doc,但是這個索引插入順序是按照分片存的,也就是為2 的順序可能多個分片都存在。所以實(shí)測并不好用。博主在做大數(shù)據(jù)量的排序時候,使用 datatime字段排序 ,解

    2024年02月04日
    瀏覽(16)
  • es在索引中自定義簡單的分詞器 Analyzer 擴(kuò)展

    es在索引中自定義簡單的分詞器 Analyzer 擴(kuò)展

    es在索引中自定義簡單的分詞器 Analyzer 擴(kuò)展 PUT index1 { ? \\\"settings\\\": { ? ? \\\"analysis\\\": { ? ? ? \\\"analyzer\\\": { ? ? ? ? \\\"ik_max_word_expand\\\": { ? ? ? ? ? \\\"type\\\": \\\"custom\\\", ? ? ? ? ? \\\"char_filter\\\": \\\"html_strip\\\", ? ? ? ? ? \\\"tokenizer\\\": \\\"ik_max_word\\\" ? ? ? ? } ? ? ? } ? ? } ? } } ? 在索引中自定義簡單的分

    2024年02月15日
    瀏覽(46)
  • Elasticsearch Index Monitoring(索引監(jiān)控)之Index Stats API詳解

    Elasticsearch Index Monitoring(索引監(jiān)控)之Index Stats API詳解

    index_current 當(dāng)前正在執(zhí)行索引操作的個數(shù)。 index_failed 失敗的索引操作次數(shù)。 delete_total 執(zhí)行刪除索引操作的次數(shù)。 delete_time_in_millis 刪除索引操作總耗時。 delete_current 當(dāng)前正在執(zhí)行刪除索引操作的個數(shù)。 noop_update_total 空更新總次數(shù)(檢測到空更新的次數(shù))。 is_throttled 索引是

    2024年04月09日
    瀏覽(16)
  • Elasticsearch中倒排索引、分詞器、DSL語法使用介紹

    Elasticsearch中倒排索引、分詞器、DSL語法使用介紹

    ?? 簡介:java系列技術(shù)分享(??持續(xù)更新中…??) ?? 初衷:一起學(xué)習(xí)、一起進(jìn)步、堅持不懈 ?? 如果文章內(nèi)容有誤與您的想法不一致,歡迎大家在評論區(qū)指正?? ?? 希望這篇文章對你有所幫助,歡迎點(diǎn)贊 ?? 收藏 ?留言 ?? ?? 更多文章請點(diǎn)擊 簡介及安裝請查看這篇 :Elasticsea

    2024年02月11日
    瀏覽(27)
  • Elasticsearch exception [type=index_not_found_exception, reason=no such index [**]]

    Elasticsearch exception [type=index_not_found_exception, reason=no such index [**]]

    ?1.代碼運(yùn)行出現(xiàn)找不到Index,先排除index是否存在。 ? 2.springboot和ES映射,默認(rèn)是把對象類型映射為index,class對象默認(rèn)是大寫開頭,所以要看是都是因?yàn)榇笮懖黄ヅ洹H缛粢驗(yàn)榇笮懺驅(qū)е?,可以通過@Document注解指定index ?

    2024年02月14日
    瀏覽(23)
  • ElasticSearch 中的中文分詞器以及索引基本操作詳解

    ElasticSearch 中的中文分詞器以及索引基本操作詳解

    配置完成后,重啟 es ,即可生效。 熱更新,主要是響應(yīng)頭的 Last-Modified 或者 ETag 字段發(fā)生變化,ik 就會自動重新加載遠(yuǎn)程擴(kuò)展辭典。 視頻筆記,在公眾號 江南一點(diǎn)雨 后臺回復(fù) elasticsearch04 獲取下載鏈接。 2. ElasticSearch 索引管理 微信公眾號 江南一點(diǎn)雨 后臺回復(fù) elasticsearch

    2024年04月25日
    瀏覽(19)
  • ES之API系列--index template(索引模板)的用法(有實(shí)例)

    ES之API系列--index template(索引模板)的用法(有實(shí)例)

    原文網(wǎng)址:ES之API系列--index template(索引模板)的用法(有實(shí)例)_IT利刃出鞘的博客-CSDN博客 說明 本文介紹ElasticSearch的index template(索引模板)的用法(有實(shí)例)。 官網(wǎng)網(wǎng)址 https://www.elastic.co/guide/en/elasticsearch/reference/8.0/index-templates.html 作用概述 ????????在 新建 索引時,如果索引名

    2024年04月09日
    瀏覽(37)
  • elasticsearch使用腳本 滾動關(guān)閉索引,更新index setting

    elasticsearch使用腳本 滾動關(guān)閉索引,更新index setting

    ? ? ?在舊的索引中更新mapping時,新增了分詞器(分詞器已經(jīng)在模板中添加),但是在更新mapping時報錯: 查看elasticsearch官網(wǎng),發(fā)現(xiàn)不允許在已經(jīng)存在的索引中動態(tài)更新分詞器,只能先將索引close,更新分詞器,然后再打開 Update index settings API | Elasticsearch Guide [8.3] | Elastic 2.1 由

    2024年02月08日
    瀏覽(20)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包