<commit_before>OC.search.catagorizeResults=function(results){
	var types={};
	for(var i=0;i<results.length;i++){
		var type=results[i].type;
		if(!types[type]){
			types[type]=[];
		}
		types[type].push(results[i]);
	}
	return types;
}
OC.search.hide=function(){
	$('#searchresults').hide();
	if($('#searchbox').val().length>2){
		$('#searchbox').val('');
	};
}
OC.search.showResults=function(results){
	if(!OC.search.showResults.loaded){
		var parent=$('<div/>');
		$('body').append(parent);
		parent.load(OC.filePath('search','templates','part.results.php'),function(){
			OC.search.showResults.loaded=true;
			$('#searchresults').click(function(event){
				event.stopPropagation();
			});
			$(window).click(function(event){
				OC.search.hide();
			});
			OC.search.showResults(results);
		});
	}else{
		var types=OC.search.catagorizeResults(results);
		$('#searchresults').show();
		$('#searchresults tr.result').remove();
		for(var name in types){
			var type=types[name];
			if(type.length>0){
				var row=$('#searchresults tr.template').clone();
				row.removeClass('template');
				row.addClass('result');
				row.children('td.type').text(name);
				row.find('td.result a').attr('href',type[0].link);
				row.find('td.result div.name').text(type[0].name);
				row.find('td.result div.text').text(type[0].text);
				if(OC.search.customResults[name]){//give plugins the ability to customize the entries in here<commit_msg>dont hide the results if a new search yield no results<commit_after>OC.search.catagorizeResults=function(results){
	var types={};
	for(var i=0;i<results.length;i++){
		var type=results[i].type;
		if(!types[type]){
			types[type]=[];
		}
		types[type].push(results[i]);
	}
	return types;
}
OC.search.hide=function(){
	$('#searchresults').hide();
	if($('#searchbox').val().length>2){
		$('#searchbox').val('');
	};
}
OC.search.showResults=function(results){
	if(results.length==0){
		return;
	}
	if(!OC.search.showResults.loaded){
		var parent=$('<div/>');
		$('body').append(parent);
		parent.load(OC.filePath('search','templates','part.results.php'),function(){
			OC.search.showResults.loaded=true;
			$('#searchresults').click(function(event){
				event.stopPropagation();
			});
			$(window).click(function(event){
				OC.search.hide();
			});
			OC.search.showResults(results);
		});
	}else{
		var types=OC.search.catagorizeResults(results);
		$('#searchresults').show();
		$('#searchresults tr.result').remove();
		for(var name in types){
			var type=types[name];
			if(type.length>0){
				var row=$('#searchresults tr.template').clone();
				row.removeClass('template');
				row.addClass('result');
				row.children('td.type').text(name);
				row.find('td.result a').attr('href',type[0].link);
				row.find('td.result div.name').text(type[0].name);
				row.find('td.result div.text').text(type[0].text);
				if(OC.search.customResults[name]){//give plugins the ability to customize the entries in here
{'fraction_non_alphanumeric': 0.22275204359673023, 'fraction_numerical': 0.0044277929155313355, 'mean_word_length': 5.006134969325154, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3994869', 'n_tokens_mistral': 1120, 'n_tokens_neox': 1008, 'n_words': 137}