Object mapping cant be changed from nested to Non nested

Hi

my sample file

{
"@graph" : [ {
"@id" : "http://www.abc.com/1234567890",
"PageId" : "1234567890",
"PostDetails" : "http://www.abc.com/1234567890_542839079235084",
"PostId" : "http://www.abc.com/1234567890_542839079235084"
}, {
"@id" : "http://www.abc.com/1234567890_542839079235084",
"Language" : "http://www.xyz.com/ontology/Language/English "
} ]
}

My mapping file

curl -XPUT localhost:9200/testmap -d '{
"mappings": {
"blogpost": {
"properties": {
"@graph": {
"type": "nested",
"properties": {
"@id": { "type": "string" },
"PageId": { "type": "string" },
"PostDetails": { "type": "string" },
"PostId": { "type": "string" },
"Language": { "type": "string" }
}
}
}
}
}
}'

But , here I face an issue stating {"error":{"root_cause":[{"type":"remote_transport_exception","reason":"[Lianda][127.0.0.1:9300][indices:data/write/index[p]]"}],"type":"illegal_argument_exception","reason":"object mapping [@graph] can't be changed from nested to non-nested"},"status":400}

Can you please tell me what I was doing wrong and give a perfect solution

Thanks in advance

Regards
Sindhuja.M

This error is unexpected. Can you provide a full recreation of the problem?

Hi

MyMapping

curl -XPUT localhost:9200/testmap -d '{
"mappings": {
"blogpost": {
"properties": {
"@graph": {
"type": "nested",
"properties": {
"@id": { "type": "string" },
"PageId": { "type": "string" },
"PostDetails": { "type": "string" },
"PostId": { "type": "string" },
"Language": { "type": "string" }
}
}
}
}
}
}'
My Indexing file
{
"@graph" : [ {
"@id" : "http://www.abc.com/1234567890",
"PageId" : "1234567890",
"PostDetails" : "http://www.abc.com/1234567890_542839079235084",
"PostId" : "http://www.abc.com/1234567890_542839079235084"
}, {
"@id" : "http://www.abc.com/1234567890_542839079235084",
"Language" : "http://www.xyz.com/ontology/Language/English "
} ]
}

Kindly please provide me a query for aggregation

Thanks in advance

Regards
SIndhuja.M

Sorry but I really need a full recreation in order to look into int including index creation and the order in which you perform actions.

Can you also provide your elasticsearch version?