Skip to content Skip to sidebar Skip to footer

Typeahead Not Calling Search Api When Typing

trying to implement the typeahead search in nodejs with mysql, but can't figure out what's wrong in my code. When manually going to http://localhost:5000/search?key=s for example,

Solution 1:

solved the issue with the following :

var Name = new Bloodhound({
        datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
        queryTokenizer: Bloodhound.tokenizers.whitespace,
        remote: {
            url: 'http://localhost:5000/search?key=%QUERY',
            wildcard: '%QUERY'
        }
        });

        $('#remote .typeahead').typeahead(null, {
        name: 'Name',
        displayKey: 'Name',
        source: Name,
        display: function(data) { return data.Name; }
    });

Post a Comment for "Typeahead Not Calling Search Api When Typing"