<commit_before><?php
/** 
 * @file getmodels.php
 * Script for searching models matching the words entered by the user
 */
include 'db_connect.php';
include 'tools.php';

// Get search words
$searchstr = explode(" ", trim($_POST['q']));

// Compare each word to the name, the classification and the description of a model
$whereClause = '';
foreach( $searchstr as $word) {
   $whereClause .= " name LIKE '%".$word."%'
                    OR classification LIKE '%".$word."%'
                    OR description LIKE '%".$word."%' OR";
}

// Remove last 'OR'
$whereClause = substr($whereClause, 0, -2);

$query = $db->query("SELECT * FROM models WHERE" . $whereClause);
$result = $query->fetchAll();

// Create table structure and display it on the page
$html = createTable($result, "model");
echo $html;
?><commit_msg>Search: Exclude description from search query<commit_after><?php
/** 
 * @file getmodels.php
 * Script for searching models matching the words entered by the user
 */
include 'db_connect.php';
include 'tools.php';

// Get search words
$searchstr = explode(" ", trim($_POST['q']));

// Compare each word to the name, the classification and the description of a model
$whereClause = '';
foreach( $searchstr as $word) {
   $whereClause .= " name LIKE '%".$word."%'
                    OR classification LIKE '%".$word."%' OR";
}

// Remove last 'OR'
$whereClause = substr($whereClause, 0, -2);

$query = $db->query("SELECT * FROM models WHERE" . $whereClause);
$result = $query->fetchAll();

// Create table structure and display it on the page
$html = createTable($result, "model");
echo $html;
?>
{'fraction_non_alphanumeric': 0.16253101736972705, 'fraction_numerical': 0.0024813895781637717, 'mean_word_length': 3.661849710982659, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '3704082', 'n_tokens_mistral': 480, 'n_tokens_neox': 477, 'n_words': 171}