<commit_before>Template.linkitterList.helpers({
	friends: function() { 
		var userId = Meteor.userId();
		if(userId) {
			var searchVal = Session.get('searchBox');
			if(typeof searchVal==='undefined' || searchVal=="" || searchVal==null) {
				return Profiles.find({ user_id: { $ne: userId } });
			}
			else {
				console.log(searchVal);
				return Profiles.find({ name: { $regex: searchVal, $options: 'i' }, user_id: { $ne: userId } });
			}
		}
	}
});

Template.listSearch.events({
	'submit form': function(evt) {
		/* prevent page reload and put value of textbox in session */<commit_msg>Added surname into regex matching parameter<commit_after>Template.linkitterList.helpers({
	friends: function() { 
		var userId = Meteor.userId();
		if(userId) {
			var searchVal = Session.get('searchBox').replace(/ /g,'');
			if(typeof searchVal==='undefined' || searchVal=="" || searchVal==null) {
				return Profiles.find({ user_id: { $ne: userId } });
			}
			else {
				console.log(searchVal);
				return Profiles.find({ $or: [ { name: { $regex: searchVal, $options: 'i' } }, { surname: { $regex: searchVal, $options: 'i' } } ],user_id: { $ne: userId } });
			}
		}
	}
});

Template.listSearch.events({
	'submit form': function(evt) {
		/* prevent page reload and put value of textbox in session */
{'fraction_non_alphanumeric': 0.18006182380216385, 'fraction_numerical': 0.0, 'mean_word_length': 3.9616858237547894, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1532150', 'n_tokens_mistral': 477, 'n_tokens_neox': 436, 'n_words': 102}