<commit_before><?php

namespace WBB\CloudSearchBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class IndexCommand extends ContainerAwareCommand
{

    public function configure()
    {
        $this->setName('cloudsearch:index:all');
    }

    public function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('Updating the AWS CloudSearch index...');

        $indexer = $this->getContainer()->get('cloudsearch.indexer');
        $repos = array('bar.repository', 'bestof.repository');

        foreach ($repos as $repo) {
            $entities = $this->getContainer()->get($repo)->findAll();

            foreach ($entities as $entity) {
                $indexer->index($entity);
            }
        }
    }

}<commit_msg>[Search] fixed the indexing command<commit_after><?php

namespace WBB\CloudSearchBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class IndexCommand extends ContainerAwareCommand
{

    public function configure()
    {
        $this->setName('cloudsearch:index:all');
    }

    public function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('Updating the AWS CloudSearch index...');

        $indexer = $this->getContainer()->get('cloudsearch.indexer');
        $repos = array('bar.repository', 'bestof.repository');

        foreach ($repos as $repo) {
            $entities = $this->getContainer()->get($repo)->findAll();

            foreach ($entities as $entity) {
                if ($entity instanceof Bar) {
                    if ($entity->getStatus() == Bar::BAR_STATUS_ENABLED_VALUE) {
                        $indexer->index($entity);
                    }
                } else {
                    $indexer->index($entity);
                }
            }
        }
    }

}
{'fraction_non_alphanumeric': 0.12945139557266602, 'fraction_numerical': 0.0, 'mean_word_length': 2.6282722513089007, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6809916', 'n_tokens_mistral': 560, 'n_tokens_neox': 541, 'n_words': 101}