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


(Yeikel) #1

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",
}

(David Pilato) #2

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.


(Yeikel) #3

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


(David Pilato) #4

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


(system) #5

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