Manikandan U
Manikandan U

Reputation: 51

Elasticsearch 7.3.0, Rejecting mapping update to [] as the final mapping would have more than 1 type: [1, 2]

I'm new to elasticsearch, i saw many posts same like this. But i don't know how to figure out. this is my url http://localhost:9200/review/1 My first data posted

{
    "id": 0,
    "country": "Italy",
    "description": "Aromas include tropical fruit, broom, brimstone and dried herb. The palate isn't overly expressive, offering unripened apple, citrus and dried sage alongside brisk acidity.",
    "designation": "Vulkà Bianco",
    "points": 87,
    "price": 0.0,
    "province": "Sicily & Sardinia",
    "region_1": "Etna",
    "region_2": "",
    "taster_name": "Kerin O’Keefe",
    "taster_twitter_handle": "@kerinokeefe",
    "title": "Nicosia 2013 Vulkà Bianco  (Etna)",
    "variety": "White Blend",
    "winery": "Nicosia",
    "active" : true
  }

My response


{
    "_index": "review",
    "_type": "1",
    "_id": "_RsOl3IB2NCkPvBhHoPl",
    "_version": 1,
    "result": "created",
    "_shards": {
        "total": 2,
        "successful": 1,
        "failed": 0
    },
    "_seq_no": 0,
    "_primary_term": 1
}

when i tried to do second data, i got an error

Rejecting mapping update to [review] as the final mapping would have more than 1 type: [1, 2]

I know this error, because of mapping type. I'm using 7.3.0 version. what I have to do

Upvotes: 0

Views: 1678

Answers (1)

Val
Val

Reputation: 217474

You're missing the doc type. You need to do your POST as follows:

                                           this part is missing
                                                     |
                                                     v
First document:  `PUT http://localhost:9200/review/_doc/1`

Second document: `PUT http://localhost:9200/review/_doc/2`
                                                     ^
                                                     |
                                           this part is missing

Upvotes: 1

Related Questions