mirror of https://github.com/onweru/compose.git

weru
21.02.2020 0f02f8b33641398217d794d3b18fc2eb0ef4ed25
assets/js/search.js
@@ -58,7 +58,6 @@
      if(searchTerm.length >= 3) {
        let rawResults = idx.search(`+${searchTerm}`);
        console.log(rawResults, searchTerm);
        if(rawResults.length) {
@@ -79,14 +78,10 @@
            return (parseFloat(score) * 50).toFixed(0);
          });
          console.log(scores, 'scores is');
          let matchedDocuments = simpleIndex.filter(function(doc){
            return ids.includes(doc.id);
          });
          console.log('matches are', matchedDocuments);
          matchedDocuments.length >= 1 ? searchResults(matchedDocuments, scores,searchTerm) : false;
        } else {
          searchResults();
@@ -100,7 +95,6 @@
}
let alltext = doc.innerHTML;
console.log(typeof alltext);
// doc.innerHTML = alltext.replaceAll('is', '<span class="is">is</span>');