<?xml version="1.0"?>
<component name="org.nuxeo.elasticsearch.core.bulk.contrib.override">

  <require>org.nuxeo.elasticsearch.core.bulk.contrib</require>

  <extension point="streamProcessor" target="org.nuxeo.runtime.stream.service">
    <streamProcessor class="org.nuxeo.elasticsearch.bulk.IndexAction" defaultConcurrency="2" defaultPartitions="4" enabled="true" name="indexAction">
      <policy continueOnFailure="false" delay="1s" maxDelay="60s" maxRetries="20" name="default"/>
      <!-- fetch content and build indexing requests -->
      <computation concurrency="4" name="bulk/index"/>
      <stream name="bulk/index" partitions="12"/>
      <!-- submit requests to elastic -->
      <computation concurrency="2" name="bulk/bulkIndex"/>
      <stream name="bulk/bulkIndex" partitions="8">
        <filter class="org.nuxeo.ecm.core.transientstore.computation.TransientStoreOverflowRecordFilter" name="overflow">
          <option name="storeName">default</option>
          <option name="prefix">index</option>
          <option name="thresholdSize">990000</option>
        </filter>
      </stream>
      <computation concurrency="1" name="bulk/indexCompletion"/>
      <!-- optimal size of the elasticsearch bulk request -->
      <option name="esBulkSizeBytes">5242880</option>
      <!-- max number of actions in the elasticsearch bulk request -->
      <option name="esBulkActions">1000</option>
      <!-- flush elasticsearch bulk request interval -->
      <option name="flushIntervalSeconds">5</option>
    </streamProcessor>

  </extension>

</component>
