<?php /** * Alter Solr documents before they are sent to Solr for indexing. * * @param array $documents * An array of SearchApiSolrDocument objects ready to be indexed, generated * from $items array. * @param SearchApiIndex $index * The search index for which items are being indexed. * @param array $items * An array of items being indexed. */ function hook_search_api_solr_documents_alter(array &$documents, SearchApiIndex $index, array $items) { // Adds a "foo" field with value "bar" to all documents. foreach ($documents as $document) { $document->setField('foo', 'bar'); } } ?>
Original issue: https://www.drupal.org/node/2531674
Is there any hook to Document Alter in Elasticsearch?
something similar to Search Api Solr Document Alter?