본문 바로가기
ElasticSearch

ElasticSearch put 에러

by Rainbound-IT 2022. 11. 2.
반응형

{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters:  [docs : {properties={title={type=text}, content={type=keyword}}}]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping: Root mapping definition has unsupported parameters:  [docs : {properties={title={type=text}, content={type=keyword}}}]","caused_by":{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters:  [docs : {properties={title={type=text}, content={type=keyword}}}]"}},"status":400}

 

에러 발생

 

 

7.X 위로 버전업되면서 형식이 바뀜

 

curl -X PUT "localhost:9200/docs" -H 'Content-Type:application/json' -d'
{
 "mappings": {
  "docs": {
   "properties": {
    "title": {"type": "text"},
    "content": {"type": "keyword"}
   }
  }
 }
}
'

docs를 빼줘야함

 

curl -X PUT "localhost:9200/docs" -H 'Content-Type:application/json' -d'
{
 "mappings": {
   "properties": {
    "title": {"type": "text"},
    "content": {"type": "keyword"}
   }
  }
 
}
'

 

 

 

Reference

https://stackoverflow.com/questions/39288997/elasticsearch-root-mapping-definition-has-unsupported-parameters-index-not-a

 

Elasticsearch : Root mapping definition has unsupported parameters index : not_analyzed

Hi all I am trying to create schema Test. PUT /test { "mappings": { "field1": { "type": "integer" }, "field2": { "type": "integer" },...

stackoverflow.com

 

반응형

댓글