Hi ! :)
Version: 15.2.0
I'm trying to use this option: https://www.elastic.co/guide/en/elasticsearch/reference/current/enabled.html
But I got an error from mapper parsing: [mapper_parsing_exception] Mapping definition for [seo_description] has unsupported parameters: [enabled : false]
putMapping:
res = await elasticClient.indices.putMapping({
index: 'cm',
type; 'product',
body: {
properties: mapping,
},
})
The mapping definition:
{
"id": {
"type": "keyword"
},
"category_id": {
"type": "text"
},
"category_label": {
"type": "text",
"copy_to": "feature_search"
},
"sibling_id": {
"type": "text"
},
"seo_description": {
"type": "text",
"enabled": false
}
}
I am seeing this as well with Elasticsearch version 6.3.2
Hi ! :)
Version: 15.2.0
I'm trying to use this option: https://www.elastic.co/guide/en/elasticsearch/reference/current/enabled.html
But I got an error from mapper parsing:
[mapper_parsing_exception] Mapping definition for [seo_description] has unsupported parameters: [enabled : false]putMapping:
res = await elasticClient.indices.putMapping({ index: 'cm', type; 'product', body: { properties: mapping, }, })The mapping definition:
{ "id": { "type": "keyword" }, "category_id": { "type": "text" }, "category_label": { "type": "text", "copy_to": "feature_search" }, "sibling_id": { "type": "text" }, "seo_description": { "type": "text", "enabled": false } }
@simon-tannai You don't need to add type fields when you let enabled to false.
You don't need to add
typefields when you letenabledtofalse.
@michaelzhng You may not need to, but I don't think you should get an error if you do.
@shusson This section says the enabled setting can be applied only to the mapping type and to object fields. If I send the request below:
PUT /test
{
"mappings": {
"doc": {
"properties" : {
"name": {
"enalbed": false,
"type": "keyword"
}
}
}
}
}
, I will get the error response:
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Mapping definition for [name] has unsupported parameters: [enalbed : false]"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [doc]: Mapping definition for [name] has unsupported parameters: [enalbed : false]",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "Mapping definition for [name] has unsupported parameters: [enalbed : false]"
}
},
"status": 400
}
But if I send this:
PUT /test
{
"mappings": {
"doc": {
"properties" : {
"name": {
"enalbed": false,
}
}
}
}
}
, there will be no error in the response and the name field will be recognized as an object field.
{
"test": {
"aliases": {},
"mappings": {
"doc": {
"properties": {
"name": {
"type": "object",
"enabled": false
}
}
}
},
"settings": {
"index": {
"creation_date": "1550023053448",
"number_of_shards": "5",
"number_of_replicas": "1",
"uuid": "BXtcmoUaSJuDS4qpbdEGCQ",
"version": {
"created": "6050499"
},
"provided_name": "test"
}
}
}
}
enabledsetting can be applied only to the mapping type and to object fields
@michaelzhng I don't see how this indicates that you cannot have a type parameter.
@shusson I can. But there is no need to set it because it will be set to an object field automatically.
But there is no need to set it
@michaelzhng /shrug I don't see the harm in being able to set type. It would help us parse data from ES since we use the mapping as a schema for our APIs.
also I just realised this issue is in the wrong repo...
@shusson Oh, I see. It will be much easier and reasonable if we can just use enabled to set whether a field should be indexed or not no matter what the field's type is.
We understand that this might be important for you, but this issue has been automatically marked as stale because it has not had recent activity either from our end or yours.
It will be closed if no further activity occurs, please write a comment if you would like to keep this going.
Note: in the past months we have built a new client, that has just landed in master. If you want to open an issue or a pr for the legacy client, you should do that in https://github.com/elastic/elasticsearch-js-legacy
I am using elastic 7.3.1 and I have the same issue. But when I remove the "type" property, everything is OK.
I think the parameter name has changed from 'enabled' to 'index', so now use {"index": false}
Most helpful comment
@simon-tannai You don't need to add
typefields when you letenabledtofalse.