'+ ''+store[ref].title+''+ '
'+ ' '+ ''+store[ref].excerpt+'
'+ 'var idx = lunr(function () { this.field('title', {boost: 10}) this.field('excerpt') this.field('categories') this.field('tags') this.ref('id') }); idx.add({ title: "git", excerpt: "Git commands\n\n", categories: [], tags: ["Git"], id: 0 }); idx.add({ title: "GGplot2 cheatsheet", excerpt: "In this blog post I will include some useful tips for visualize data with ggplot2\n\n", categories: [], tags: ["ggplot2","R","data_viz"], id: 1 }); idx.add({ title: "Basic scripts", excerpt: "In this blog post I will include basic notes of useful scripts\n\n", categories: [], tags: ["ggplot2","R","data_viz"], id: 2 }); idx.add({ title: "Biol525D unix shell", excerpt: "This is the first of a series of posts about what I am learning in the BIol525D class. I leave...", categories: [], tags: ["shell"], id: 3 }); console.log( jQuery.type(idx) ); var store = [ { "title": "git", "url": "https://mamora.github.io//git/", "excerpt": "Git commands In this blog post will be my first git cheat sheet in order to learn git better. This...", "teaser": "https://mamora.github.io//assets/images/unsplash-gallery-image-3.png" }, { "title": "GGplot2 cheatsheet", "url": "https://mamora.github.io//ggplot2/", "excerpt": "In this blog post I will include some useful tips for visualize data with ggplot2 Commands Add translucid background theme()...", "teaser": "https://mamora.github.io//assets/images/unsplash-gallery-image-3.png" }, { "title": "Basic scripts", "url": "https://mamora.github.io//basic_r/", "excerpt": "In this blog post I will include basic notes of useful scripts Subset columns This next script uses grep to...", "teaser": "https://mamora.github.io//assets/images/unsplash-gallery-image-3.png" }, { "title": "Biol525D unix shell", "url": "https://mamora.github.io//biol525D_unix_shell/", "excerpt": "This is the first of a series of posts about what I am learning in the BIol525D class. I leave...", "teaser": "https://mamora.github.io//assets/images/unsplash-gallery-image-3.png" } ] $(document).ready(function() { $('input#search').on('keyup', function () { var resultdiv = $('#results'); var query = $(this).val(); var result = idx.search(query); resultdiv.empty(); resultdiv.prepend('
'+result.length+' Result(s) found
'); for (var item in result) { var ref = result[item].ref; if(store[ref].teaser){ var searchitem = ''+store[ref].excerpt+'
'+ ''+store[ref].excerpt+'
'+ '