Is it possible to exclude empty values at the index settings?

Sometimes, I receive data to be indexed where some fields can be empty.

I would like to exclude those properties at index time rather than process them myself before sending the request to index it. Is it possible to configure the index to exclude those properties or do I need to do it manually?

For example. Consider the following document :

{
  "name": "Sophie",
  "lastname": "Dean",
  "email": ""
}

I would like to index only :

{
  "name": "Sophie",
  "lastname": "Dean",
}

This is something to do before indexing effectively the document.

Better to do it on your side but you can have a look at ingest feature and you can may be write a painless script to alter the source.

1 Like

Could you please clarify if there is any performance burden at search time if I store documents with empty values?

As the source is a bit bigger, fetching the _source will take may be more time.

1 Like

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