$(document).ready(function() { let queryEngine = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), queryTokenizer: Bloodhound.tokenizers.whitespace, remote: { url: process.env.MIX_API_SEARCH + '/%QUERY', wildcard: '%QUERY' } }); $('.search-form .search-form-input').typeahead(null, { name: 'search', display: 'value', source: queryEngine, limit: 40, templates: { empty: [ '
'+data.value+'
' + ''+data.count+' posts
' + ''+data.name+'
' + ''+data.value+'
' + ''+data.name+'
' + ''+data.value+'
' + '