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

ElasticsearchStatusException[Elasticsearch exception [type=mapper_parsing_exception, reason=failed t

這篇具有很好參考價(jià)值的文章主要介紹了ElasticsearchStatusException[Elasticsearch exception [type=mapper_parsing_exception, reason=failed t。希望對大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

項(xiàng)目場景:

今天在用java寫代碼查ES中數(shù)據(jù)的時(shí)候,出現(xiàn)了下面提示的錯(cuò)誤,我排查了一會(huì)才發(fā)現(xiàn)問題


控制臺(tái)提示

ElasticsearchStatusException[Elasticsearch exception [type=mapper_parsing_exception, reason=failed to parse field [location] of type [geo_point]]
]; nested: ElasticsearchException[Elasticsearch exception [type=parse_exception, reason=unsupported symbol [.] in geohash [30.871729121.81959]]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=unsupported symbol [.] in geohash [30.871729121.81959]]];
	at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:176)
	at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:2011)
	at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:1988)
	at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1745)
	at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1702)
	at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1672)
	at org.elasticsearch.client.RestHighLevelClient.index(RestHighLevelClient.java:1029)
	at com.woniu.EsDemoApplicationTests.insertDoc(EsDemoApplicationTests.java:115)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at 
	at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
	at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
	Suppressed: org.elasticsearch.client.ResponseException: method [PUT], host [http://120.48.46.177:9200], URI [/hotel/_doc/45870?timeout=1m], status line [HTTP/1.1 400 Bad Request]
Warnings: [Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See https://www.elastic.co/guide/en/elasticsearch/reference/7.16/security-minimal-setup.html to enable security.]
{"error":{"root_cause":[{"type":"parse_exception","reason":"unsupported symbol [.] in geohash [30.871729121.81959]"}],"type":"mapper_parsing_exception","reason":"failed to parse field [location] of type [geo_point]","caused_by":{"type":"parse_exception","reason":"unsupported symbol [.] in geohash [30.871729121.81959]","caused_by":{"type":"illegal_argument_exception","reason":"unsupported symbol [.] in geohash [30.871729121.81959]"}}},"status":400}
		at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:326)
		at org.elasticsearch.client.RestClient.performRequest(RestClient.java:296)
		at org.elasticsearch.client.RestClient.performRequest(RestClient.java:270)
		at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2082)
		at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1732)
		... 71 more
Caused by: ElasticsearchException[Elasticsearch exception [type=parse_exception, reason=unsupported symbol [.] in geohash [30.871729121.81959]]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=unsupported symbol [.] in geohash [30.871729121.81959]]];
	at org.elasticsearch.ElasticsearchException.innerFromXContent(ElasticsearchException.java:485)
	at org.elasticsearch.ElasticsearchException.fromXContent(ElasticsearchException.java:396)
	at org.elasticsearch.ElasticsearchException.innerFromXContent(ElasticsearchException.java:426)
	at org.elasticsearch.ElasticsearchException.failureFromXContent(ElasticsearchException.java:592)
	at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:168)
	... 74 more
Caused by: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=unsupported symbol [.] in geohash [30.871729121.81959]]]
	at org.elasticsearch.ElasticsearchException.innerFromXContent(ElasticsearchException.java:485)
	at org.elasticsearch.ElasticsearchException.fromXContent(ElasticsearchException.java:396)
	at org.elasticsearch.ElasticsearchException.innerFromXContent(ElasticsearchException.java:426)

原因分析:

ES中地理坐標(biāo)屬性location的數(shù)據(jù)結(jié)構(gòu)是(緯度,經(jīng)度),而我在進(jìn)行字符串拼接的時(shí)候后了中間的逗號,導(dǎo)致插入數(shù)據(jù)錯(cuò)誤。下面就是上面那一段代碼真正有用的部分。

真正錯(cuò)誤原因:

{"error":{"root_cause":[{"type":"parse_exception","reason":"unsupported symbol [.] in 
geohash [30.871729121.81959]"}],"type":"mapper_parsing_exception","reason":"failed to parse 
field [location] of type [geo_point]","caused_by":{"type":"parse_exception","reason":"unsupported symbol [.] in geohash 
[30.871729121.81959]","caused_by":
{"type":"illegal_argument_exception","reason":"unsupported symbol [.] in geohash 
[30.871729121.81959]"}}},"status":400}

錯(cuò)誤寫法:

this.location = hotel.getLatitude()+hotel.getLongitude();

正確寫法:?

this.location = hotel.getLatitude()+","+hotel.getLongitude();

解決方案:

字符串拼接前要多檢查,并且(緯度,經(jīng)度)這個(gè)順序不能顛倒,不然可能會(huì)導(dǎo)致地理位置錯(cuò)誤。文章來源地址http://www.zghlxwxcb.cn/news/detail-505185.html

到了這里,關(guān)于ElasticsearchStatusException[Elasticsearch exception [type=mapper_parsing_exception, reason=failed t的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲(chǔ)空間服務(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)文章

  • elasticsearch創(chuàng)建索引報(bào)[type=mapper_parsing_exception, reason=Failed to parse mapping [_doc]......

    elasticsearch創(chuàng)建索引報(bào)[type=mapper_parsing_exception, reason=Failed to parse mapping [_doc]......

    小伙伴們,你們好,我是老寇 經(jīng)過反復(fù)排查,發(fā)現(xiàn)是安裝的pinyin和ik分詞版本不對,只需要修改成與es版本一致即可 es 7.6.2 舉例 1.在windows界面用壓縮軟件打開elasticsearch-analysis-ik-7.6.2.jar 2.將pom.xml拖出到桌面 3.修改版本 4.將pom.xml放回壓縮包( 原路放回 ) 5. elasticsearch-analysis

    2024年02月13日
    瀏覽(27)
  • ElasticSearch創(chuàng)建索引報(bào)錯(cuò):mapper_parsing_exception Root mapping definition has unsupported parameters

    ElasticSearch創(chuàng)建索引報(bào)錯(cuò):mapper_parsing_exception Root mapping definition has unsupported parameters

    ElasticSearch版本號:5.6.14,這個(gè)錯(cuò)誤和ES版本有一定的關(guān)系,還是先交代下版本號,免得有的讀者根據(jù)我的方法操作后無效 錯(cuò)誤翻譯: mapper_parsing_exception :映射解析異常 Root mapping definition has unsupported parameters :根映射定義包含不受支持的參數(shù) 錯(cuò)誤映射語句1: 錯(cuò)誤映射語句

    2024年02月11日
    瀏覽(23)
  • ES內(nèi)存問題 Elasticsearch exception type=circuit_breaking_exception,

    ES內(nèi)存問題 Elasticsearch exception type=circuit_breaking_exception,

    Elasticsearch exception [type=circuit_breaking_exception, reason=[parent] Data too large, data for [http_request] would be [986856200/941.1mb], which is larger than the limit of [986061209/940.3mb], real usage: [986855776/941.1mb], new bytes reserved: [424/424b], usages [request=0/0b, fielddata=2884/2.8kb, in_flight_requests=424/424b, model_inference=0/0b, a

    2023年04月08日
    瀏覽(41)
  • ES排序報(bào)錯(cuò):Elasticsearch exception [type=illegal_argument_exception, reason=Text

    翻譯過來就是: 對于需要每個(gè)文檔字段數(shù)據(jù)(如聚合和排序)的操作,文本字段沒有進(jìn)行優(yōu)化,因此這些操作在默認(rèn)情況下是禁用的。請使用字段代替。或者,在[createTime]上設(shè)置fielddata=true,以便通過反求倒排索引來加載字段數(shù)據(jù)。注意,這可能會(huì)使用有效內(nèi)存。] 更改后

    2024年02月11日
    瀏覽(25)
  • 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)榇笮懖黄ヅ?。如若因?yàn)榇笮懺驅(qū)е?,可以通過@Document注解指定index ?

    2024年02月14日
    瀏覽(23)
  • Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]

    Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]

    Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed] 今天在做項(xiàng)目遇到這個(gè)問題,Es那邊出現(xiàn)了問題,谷粒商城去Es中查數(shù)據(jù)的時(shí)候,根據(jù)品牌id去查詢數(shù)據(jù)報(bào)錯(cuò)。 ? {\\\"error\\\":{\\\"root_cause\\\":[{ \\\"type\\\":\\\"query_shard_exception\\\",\\\"reason\\\":\\\"failed to create query: {n ?\\\"bool\\\" : {n ? ?\\\"fil

    2024年02月02日
    瀏覽(22)
  • 解決Elasticsearch exception [type=circuit_breaking_exception, reason=[parent] Data too large問題

    解決Elasticsearch exception [type=circuit_breaking_exception, reason=[parent] Data too large問題

    一、背景 公司有一批8萬的數(shù)據(jù)存儲(chǔ)在Mysql中,然后我使用多線程的方式調(diào)用Elasticsearch的bulk()方法推送到ES,但是在推送過程中出現(xiàn)了該問題,這屬于插入數(shù)據(jù)時(shí)產(chǎn)生的問題 二、異常 三、解決辦法 加大 -Xms 和 -Xmx 的值,比如 docker-compose.yaml 文件中可以這樣設(shè)置: 四、解釋

    2024年02月03日
    瀏覽(24)
  • Elasticsearch exception [type=cluster_block_exception, reason=blocked by: [FORBIDDEN/12/index r【已解決】

    Elasticsearch exception [type=cluster_block_exception, reason=blocked by: [FORBIDDEN/12/index r【已解決】

    親測 2022/08/16 BJ 集群存儲(chǔ)資源高水位異常,默認(rèn)當(dāng)磁盤空間大于95%時(shí),就會(huì)禁止寫入。 首先讓es節(jié)點(diǎn)騰出足夠的空間、 刪除磁盤數(shù)據(jù) ; 擴(kuò)容。 執(zhí)行恢復(fù)命令 讓es恢復(fù)到可寫入狀態(tài)。問題解決!

    2024年02月12日
    瀏覽(23)
  • Elasticsearch exception [type=parsing_exception, reason=[multi_match] unknown token [START_ARRAY] af

    代碼報(bào)錯(cuò) QueryBuilder queryBuilder = QueryBuilders.multiMatchQuery(deptIdList, “data.deptId”, “modifiedData.deptId”); multiMatchQuery這個(gè)API,第一個(gè)參數(shù)不支持List類型, 雖然傳List沒報(bào)錯(cuò), 但是往ES發(fā)送查詢請求的時(shí)候就會(huì)拋異常出來 傳一個(gè)字段, 如果你想多字段in查詢,就用類似下面這樣寫法就可以了

    2024年02月07日
    瀏覽(49)
  • ARMv8-AArch64 的異常處理模型詳解之異常類型 Exception types

    ARMv8-AArch64 的異常處理模型詳解之異常類型 Exception types

    異常(Exception)通俗點(diǎn)來講,就是系統(tǒng)在正常運(yùn)行的時(shí)候出現(xiàn)的非正常事件,這個(gè)非正常事件會(huì)導(dǎo)致系統(tǒng)狀態(tài)更改或者其他錯(cuò)誤,為了確保系統(tǒng)功能能正常運(yùn)行,需要一些帶有特權(quán)的軟件代碼(exception handler)來采取一些補(bǔ)救措施或者更新系統(tǒng)狀態(tài),這個(gè)過程被稱為異常處理

    2024年01月21日
    瀏覽(24)

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

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

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

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

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包