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

ElasticSearch 錯誤 Fielddata is disabled on text fields by default. Set fielddata=true 解決辦法

這篇具有很好參考價(jià)值的文章主要介紹了ElasticSearch 錯誤 Fielddata is disabled on text fields by default. Set fielddata=true 解決辦法。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

情況:
頁面查詢ES數(shù)據(jù),Java查詢報(bào)這個錯誤,但是,通過打印的語句,構(gòu)建curl
查詢時候又是正常的,這就讓我很費(fèi)解。

報(bào)錯信息:

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [aaa] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory."
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": "aaa_bbb_info_2022-09-27",
        "node": "CqKuZyFxSYqCsgaXM7jX2A",
        "reason": {
          "type": "illegal_argument_exception",
          "reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [aaa] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory."
        }
      }
    ],
    "caused_by": {
      "type": "illegal_argument_exception",
      "reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [aaa] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory."
    }
  },
  "status": 400
}

網(wǎng)上的解決辦法:
https://blog.csdn.net/qq_16417621/article/details/105859887

這個解決辦法其實(shí)是正確的,但是,有個前提條件,我們已經(jīng)導(dǎo)入過模板,所以,可以直接修改模板
而且,這個帖子中的語句,是基于 ES7 的。我所在環(huán)境是ES5的,所以,加fielddata=true配置時,還報(bào)錯。

具體解決辦法:
我直接重新創(chuàng)建模板,然后,重新刷一次數(shù)據(jù),解決問題。

導(dǎo)入模板語句:

curl -X PUT -u elastic:123456  "http://127.0.0.1:9200/_template/aaa_bbb_info_temple" -H 'Content-Type: application/json' -d'{"template":"aaa_bbb_*","settings":{"index":{"mapping":{"ignore_malformed":"true"},"refresh_interval":"20s","number_of_shards":"5","translog":{"flush_threshold_size":"512mb","sync_interval":"60s","durability":"async"},"number_of_replicas":"1"}},"mappings":{"default":{"properties":{"aaa":{"store":true,"type":"keyword"}}}}}'

查詢導(dǎo)入是否成功:文章來源地址http://www.zghlxwxcb.cn/news/detail-599220.html

curl -H "Content-Type:application/json" -XGET -u elastic:123456 '192.168.92.82:9222/_template/aaa_bbb_info_temple' > aaa_bbb_info_temple.txt

到了這里,關(guān)于ElasticSearch 錯誤 Fielddata is disabled on text fields by default. Set fielddata=true 解決辦法的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(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)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

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

相關(guān)文章

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

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

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

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

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包