Reputation: 41
Im trying to add type to index like this:
PUT /catalog/_mapping/product
{
"properties": {
"name": {
"type":"text"
}
}
}
In answer I get an error:
{
"error" : "no handler found for uri [/catalog/_mapping/product?pretty=true] and method [PUT]"
}
The same situation in CURL. How I can fix it?
Upvotes: 4
Views: 34051
Reputation: 356
I assume you use ElasticSearch 8.x version.
From ElasticSearch 8.x version, only _doc is supported and it is just an endpoint name, not a document type. So try with:
PUT /catalog/_doc/product
{
"properties": {
"name": {
"type":"text"
}
}
}
Upvotes: 9
Reputation: 217274
There's no need to specify anything after _mapping
since there can only be a single mapping type in an index mapping.
So simply like this will work:
PUT /catalog/_mapping
{
"properties": {
"name": {
"type":"text"
}
}
}
Upvotes: 1