How to get a non-indexed field in _field_names?

I want to have a field stored in _source and available through _all and be able to find the documents that has this particular field.

The mapping I'm trying to use is:

"fieldname" : {
"type" : "keyword",
"index" : false,
"doc_values" : false,
"include_in_all" : true
}

According to https://www.elastic.co/guide/en/elasticsearch/reference/5.4/mapping-field-names-field.html, _field_names should have every field that has non-null data. But it appears that I also need "index: true". That, unfortunately, adds memory overhead for the field.

Is there a way to get _field_names to have the field name in it without actually indexing the data in the field? I tried "index: true" and "index_options: docs" but the value was still indexed. I tried adding "ignore_above: 0" to prevent indexing of the value but then it stopped indexing the field name.

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