<commit_before>$(document).ready(function() {
	// this is for custom formating of results
   $.extend( $.ui.autocomplete.prototype, {
 
    _renderItem: function( ul, item) {
      var list = "<li></li>";
      if (item['class']) {
        list = "<li class=\""+item['class']+"\"></li>";
      }
			// temp until the service actually returns us a type
			else{
				list = "<li class=\"guide\"></li>";
			}
      return $( list )
        .data( "item.autocomplete", item )
        .append( $( "<a href='"+item['url']+"'></a>" ).html( item.html || item.label ) )
        .appendTo( ul );
    }
  });
	
  $("#site-search-text").autocomplete({ 
    delay: 300,
    width: 300, 
    source: function(req, add){  
      $.ajax({
        url: "/autocomplete?q="+req.term,
        dataType: "json",
        cache: true,
        success: function(data) {
          var results = $.map(data, function(e) {
            return { 'label': e.title, 'url': "/"+e.slug, 'class': e.format };
          });
          add(results)<commit_msg>Swap slug for link<commit_after>$(document).ready(function() {
	// this is for custom formating of results
   $.extend( $.ui.autocomplete.prototype, {
 
    _renderItem: function( ul, item) {
      var list = "<li></li>";
      if (item['class']) {
        list = "<li class=\""+item['class']+"\"></li>";
      }
			// temp until the service actually returns us a type
			else{
				list = "<li class=\"guide\"></li>";
			}
      return $( list )
        .data( "item.autocomplete", item )
        .append( $( "<a href='"+item['url']+"'></a>" ).html( item.html || item.label ) )
        .appendTo( ul );
    }
  });
	
  $("#site-search-text").autocomplete({ 
    delay: 300,
    width: 300, 
    source: function(req, add){  
      $.ajax({
        url: "/autocomplete?q="+req.term,
        dataType: "json",
        cache: true,
        success: function(data) {
          var results = $.map(data, function(e) {
            return { 'label': e.title, 'url': "/"+e.link, 'class': e.format };
          });
          add(results)
{'fraction_non_alphanumeric': 0.20477815699658702, 'fraction_numerical': 0.005850804485616773, 'mean_word_length': 2.1569230769230767, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '6173660', 'n_tokens_mistral': 698, 'n_tokens_neox': 648, 'n_words': 156}