<commit_before><?php

namespace Opendi\Solr\Client\Console\Commands;

use Opendi\Solr\Client\Console\AbstractCommand;

use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;

class DeleteCommand extends AbstractCommand
{
    protected function configure()
    {
        parent::configure();

        $this
            ->setName('delete')
            ->setDescription("Deletes all entries from a core.")
            ->addArgument(
                'core',
                InputArgument::REQUIRED,
                'Name of the core to delete from.'
            );
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $core = $input->getArgument('core');

        $client = $this->getClient($input, $output);

        $count = $client->core($core)->count();

        if ($count === 0) {
            $output->writeln("<comment>Core \"$core\" is empty. Nothing to delete.</comment>");
            return;
        }

        $output->writeln("Found <comment>$count</comment> entries in <info>$core</info>.");

        $helper = $this->getHelperSet()->get('question');
        $question = new ConfirmationQuestion('Are you sure you want to delete [yN]? ', false);

        if (!$helper->ask($input, $output, $question)) {
            return;
        }

        $output->writeln("Deleting <comment>$count</comment> entries...");

        $client->core($core)->delete();

        $output->writeln("<info>Done.</info>");
    }
}<commit_msg>Fixed bug in delete command<commit_after><?php

namespace Opendi\Solr\Client\Console\Commands;

use Opendi\Solr\Client\Console\AbstractCommand;

use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;

class DeleteCommand extends AbstractCommand
{
    protected function configure()
    {
        parent::configure();

        $this
            ->setName('delete')
            ->setDescription("Deletes all entries from a core.")
            ->addArgument(
                'core',
                InputArgument::REQUIRED,
                'Name of the core to delete from.'
            );
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $core = $input->getArgument('core');

        $client = $this->getClient($input, $output);

        $count = $client->core($core)->count();

        if ($count === 0) {
            $output->writeln("<comment>Core \"$core\" is empty. Nothing to delete.</comment>");
            return;
        }

        $output->writeln("Found <comment>$count</comment> entries in <info>$core</info>.");

        $helper = $this->getHelperSet()->get('question');
        $question = new ConfirmationQuestion('Are you sure you want to delete [yN]? ', false);

        if (!$helper->ask($input, $output, $question)) {
            return;
        }

        $output->writeln("Deleting <comment>$count</comment> entries...");

        $client->core($core)->deleteAll();

        $output->writeln("<info>Done.</info>");
    }
}
{'fraction_non_alphanumeric': 0.14913056292366636, 'fraction_numerical': 0.0005894488653109342, 'mean_word_length': 2.6612729234088457, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 55, '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': '5380885', 'n_tokens_mistral': 944, 'n_tokens_neox': 904, 'n_words': 190}