Fix incorrect provider configuration

This commit is contained in:
Tim Nagel 2014-06-17 10:41:11 +10:00
parent 94568d9554
commit b49437529c
4 changed files with 10 additions and 6 deletions

View file

@ -30,14 +30,18 @@ class Provider extends AbstractProvider
$objects = $queryClass::create()
->limit($batchSize)
->offset($offset)
->find();
->find()
->getArrayCopy();
if ($loggerClosure) {
$stepNbObjects = count($objects);
}
$objects = array_filter($objects, array($this, 'isObjectIndexable'));
$this->objectPersister->insertMany($objects->getArrayCopy());
$this->objectPersister->insertMany($objects);
usleep($sleep);
if ($loggerClosure) {
$stepNbObjects = count($objects);
$stepCount = $stepNbObjects + $offset;
$percentComplete = 100 * $stepCount / $nbObjects;
$objectsPerSecond = $stepNbObjects / (microtime(true) - $stepStartTime);

View file

@ -23,7 +23,7 @@
<service id="fos_elastica.elastica_to_model_transformer.prototype.mongodb" class="FOS\ElasticaBundle\Doctrine\MongoDB\ElasticaToModelTransformer" public="false">
<argument type="service" id="doctrine_mongodb" />
<argument /> <!-- model -->
<argument type="service" id="fos_elastica.indexable" />
<argument type="collection" /> <!-- options -->
<call method="setPropertyAccessor">
<argument type="service" id="fos_elastica.property_accessor" />

View file

@ -23,7 +23,7 @@
<service id="fos_elastica.elastica_to_model_transformer.prototype.orm" class="FOS\ElasticaBundle\Doctrine\ORM\ElasticaToModelTransformer" public="false">
<argument type="service" id="doctrine" />
<argument /> <!-- model -->
<argument type="service" id="fos_elastica.indexable" />
<argument type="collection" /> <!-- options -->
<call method="setPropertyAccessor">
<argument type="service" id="fos_elastica.property_accessor" />

View file

@ -7,7 +7,7 @@
<service id="fos_elastica.provider.prototype.propel" class="FOS\ElasticaBundle\Propel\Provider" public="true" abstract="true">
<argument /> <!-- object persister -->
<argument /> <!-- model -->
<argument type="service" id="fos_elastica.indexable" />
<argument type="collection" /> <!-- options -->
</service>