//= require jquery-2.1.4.min

DomElements = {
  matchingTerm: 'table.matching-term'
};

function clearAndHideResultTable() {
  var header = $('table.matching-term .header');
  $(DomElements.matchingTerm).html(header);
  $(DomElements.matchingTerm).hide();
}

function hideNoResults() {
  $('.no-results').hide();
}

function showNoResults(searchTerm) {
  $('.no-results').html('No results match "' + searchTerm + '"').show();
}

function showResultTable() {
  hideNoResults();
  $(DomElements.matchingTerm).show();
}

function searchResults(query) {
  clearAndHideResultTable();
  var terms = query.split(' ');
  var parents = [];

  $.each(terms, function(index, el) {
    if (parents.length == 0) {
      parents = $('[data-search*=' + el).parent('tr');
    }
    else if(el.length > 0) {
      $.each(parents, function(index, parent) {
        if($(parent).find($('[data-search*=' + el)).length == 0) {
          parents[index] = null;
        }
      });
    }
  });

  return parents
}

function highlight(element, term) {
  var existing = $(element).html();
  var bolded = existing.replace(new RegExp("(" + term + ")", "i"), "<span class='highlighted'>$1</span>");
  $(element).html(bolded)
}

function addToResultTable(result, searchTerm){
  showResultTable();
  var table = $('.matching-term');
  var lastChild = table.find('tr:last');

  $.each(result.children(), function(index, element) {
    highlight(element, searchTerm);
  });

  if(lastChild.length == 0) {
    table.html(result);
  }
  else {
    lastChild.after(result);
  }
}

$(document).on('ready', function(){
  $('input[name=search]').keyup(function(event){
    var searchTerm = event.target.value;
    if(searchTerm.length > 0) {
      hideNoResults();
      var results = searchResults(searchTerm.toLowerCase());
      if (results.length > 0) {
        $.each(results, function(index, value){
          addToResultTable($(value).clone(), searchTerm);
        });
      }
      else {
        showNoResults(searchTerm);
      }
    }
    else {
      hideNoResults();
      clearAndHideResultTable();
    }
  });
});

@@ -733,16 +733,22 @@
 *=' + el
+ + '%5D'
 ).parent
@@ -887,16 +887,22 @@
 *=' + el
+ + '%5D'
 )).lengt
@@ -983,230 +983,62 @@
 %0A%0A  
-return parents%0A%7D%0A%0Afunction highlight(element, term) %7B%0A  var existing = $(element).html();%0A  var bolded = existing.replace(new RegExp(%22(%22 + term + %22)%22, %22i%22), %22%3Cspan class='highlighted'%3E$1%3C/span%3E%22);%0A  $(element).html(bolded)
+if (query == 'users a') %7B debugger %7D%0A%0A  return parents
 %0A%7D%0A%0A
@@ -1081,16 +1081,17 @@
 archTerm
+s
 )%7B%0A  sho
@@ -1187,106 +1187,8 @@
 );%0A%0A
-  $.each(result.children(), function(index, element) %7B%0A    highlight(element, searchTerm);%0A  %7D);%0A%0A
   if

Remove highlighting functionality