api: validate document before indexing
Validate the documents for ES inconsistencies / wrong or characters before indexing. This will allow to fail gracefully and tell the user there is (and maybe where) and error in his/her query. Otherwise the error will be produced at Elasticsearch cluster level which might produce undesired effects.
Invenio-Indexer users the client that comes from Invenio-Search/ext/current_search_client. This latter one is a proxy to the Elasticsearch client. Its
index (code) function does not perform any validation, whilst
save from Elasticsearch-dsl (code) does.