Skip to content

Instantly share code, notes, and snippets.

Created September 13, 2017 20:31
What would you like to do?
sample jquery for dynamic display of lunr query results (for jekyll CI post)
$(document).ready(function() {
$('input#search').on('keyup', function () {
var resultdiv = $('#results');
// Get query
var query = $(this).val();
// Search for it
var result =;
// Show results
for (var item in result) {
var ref = result[item].ref;
var searchitem = '<div class="result"><a href="'+store[ref].link+'">'+store[ref].title+'</a></div>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment