Fielddata is disabled on text fields by default

So consider the following:

Fielddata is disabled on text fields by default. Set fielddata=true on
[your_field_name] in order to load fielddata in memory by uninverting the
inverted index. Note that this can however use significant memory.

reading https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html#fielddata tells me there's some alterations that need to be made to the fielddata(text) in order for the documents to be searchable on a specific term.

Issue i can't get my head around is, if i have multiple indexes and multiple " Fielddata is disabled on text fields by default" issues on a variety of fields, how can i get this resolved going forward?

Do i have to use something like this:

PUT your_index/_mapping/your_type
{
"your_type": {
"properties": {
"publisher": {
"type": "text",
"fielddata": true
}
}
}
}

on every affected field? in every index in every mapping?

is there not a way of affecting this change wholesale? i mean, if it means i have to wipe out my indexes and start again make the change and going forward the issue is resolved, thats fine, or can i make a change and make it effective on existing indexes ?

and how will this affect heap usage, i read that switching this on to get around this error uses a lot of heap space, so making this change seems counter to efficient use.

You should use the keyword data type instead.

is that something i can use wholesale like

PUT o365beat*/_mapping/your_type
{
"your_type": {
"properties": {
"publisher": {
"type": "data",
"fielddata": true
}
}
}
}

and what value would your_type be ?

ahhhh ok.. i don't have a dedicated template for this data... does this mean i could affect a change by using a dedicated template for this index type ? my o365beat input, i could use a template to make these multiple field types from text to data?

Yes. You will have to drop the index and reindex though.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.