<commit_before><?php

$addon = rex_addon::get('search_it');
$form = rex_config_form::factory($addon->name);


$field = $form->addTextAreaField('text', 'blacklist', ["class" => "form-control"]);
$field->setLabel($this->i18n('search_it_settings_exclude_blacklist'));

$field = $form->addLinklistField('exclude_article_ids');
// legt die Strukturkategorie fest
$field->setLabel($this->i18n('search_it_settings_exclude_articles'));

$field = $form->addLinklistField('exclude_category_ids');
// legt die Strukturkategorie fest
$field->setLabel($this->i18n('search_it_settings_exclude_categories'));

$fragment = new rex_fragment();
$fragment->setVar('class', 'edit', false);
$fragment->setVar('title', $addon->i18n('search_it_settings'), false);
$fragment->setVar('body', $form->get(), false);
echo $fragment->parse('core/page/section.php');

$form_name = $form->getName();
if (rex_post($form_name.'_save')) {
    rex_view::info($this->i18n('search_it_settings_saved'));
}<commit_msg>optimize category selection<commit_after><?php

$addon = rex_addon::get('search_it');
$form = rex_config_form::factory($addon->name);


$field = $form->addTextAreaField('text', 'blacklist', ["class" => "form-control"]);
$field->setLabel($this->i18n('search_it_settings_exclude_blacklist'));

$field = $form->addLinklistField('exclude_article_ids');
// legt die Strukturkategorie fest
$field->setLabel($this->i18n('search_it_settings_exclude_articles'));

$cats = rex_sql::factory()->getArray("select id, catname, path from rex_article where startarticle = 1 GROUP BY id ORDER BY path DESC");


$field = $form->addSelectField('exclude_category_ids', $value = null, ['class'=>'form-control selectpicker']);
$field->setAttribute('multiple', 'multiple');
$field->setLabel($this->i18n('search_it_settings_exclude_categories'));
$select = $field->getSelect();

foreach ($cats as $cat) {
    $select->addOption($cat['path'] ." ". $cat['catname'], $cat['id']);
}

$fragment = new rex_fragment();
$fragment->setVar('class', 'edit', false);
$fragment->setVar('title', $addon->i18n('search_it_settings'), false);
$fragment->setVar('body', $form->get(), false);
echo $fragment->parse('core/page/section.php');

$form_name = $form->getName();
if (rex_post($form_name.'_save')) {
    rex_view::info($this->i18n('search_it_settings_saved'));
}
{'fraction_non_alphanumeric': 0.2071954919809276, 'fraction_numerical': 0.009102730819245773, 'mean_word_length': 8.779661016949152, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 46, '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': '5189346', 'n_tokens_mistral': 815, 'n_tokens_neox': 782, 'n_words': 118}