You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
POST /_cache/clear
DELETE testfd
POST testfd/type/1
{
"test":"test"
}
GET testfd/_search
{
"size": 0,
"aggs": {
"NAME": {
"terms": {
"field": "_type",
"size": 10
}
}
}
}
GET /_cat/fielddata?v
Testing on ES 1.7 and ES 2.0, the above loads the same amount of fielddata into the fd cache.
On ES 1.7, put mapping api's change of _type to use doc_values or disable fd options do not throw an error, but they are not honored.
On ES 2.0, we explicitly throw an error when someone tries to modify the _type. However, it also appears that we do not use doc_values for _type by default in ES 2.0.
If this is the expected behavior, it will be nice to document accordingly. We do have use cases in the field where users are aggregating against the _type field. Workaround is to tag each document with a custom "type" field and educate users to aggregate against this field instead of _type, though it will be helpful to provide a way to disable fielddata loading for _type as well.
The text was updated successfully, but these errors were encountered:
A workaround to this problem is to not use _type at all. Have a single _type and add another field that represents the "type" of a document, then work against it. This has the added benefit that it simplifies the mapping.
rjernst
added a commit
to rjernst/elasticsearch
that referenced
this issue
Nov 16, 2015
_type should have got doc values with the change to default doc values.
However, due to how metadata fields have separate builders and special
constructors, it was not picking it up. This change updates the field
type for _type to have doc values.
closeselastic#14781
Testing on ES 1.7 and ES 2.0, the above loads the same amount of fielddata into the fd cache.
On ES 1.7, put mapping api's change of _type to use doc_values or disable fd options do not throw an error, but they are not honored.
On ES 2.0, we explicitly throw an error when someone tries to modify the _type. However, it also appears that we do not use doc_values for _type by default in ES 2.0.
If this is the expected behavior, it will be nice to document accordingly. We do have use cases in the field where users are aggregating against the _type field. Workaround is to tag each document with a custom "type" field and educate users to aggregate against this field instead of _type, though it will be helpful to provide a way to disable fielddata loading for _type as well.
The text was updated successfully, but these errors were encountered: