Working on Typeahead

Today, I am working on typeahead with Azure Search.

I am reading,

Before you proceed, you need to make sure you have your suggester fieldset.  Per index, you can have only one suggester field.

On your page use this javascript

This code above uses the jQuery UI Autocomplete library. ( , see the API here you can go to and find CDN version to simply copy paste to the page.

Now, let’s look at HomeController.cs (or any controller that you set to be called from the javascript)  and related classes to return the suggestions.

/home/suggest?highlihts=false&fuzzy=false needs to return Jason format result.

I actually keep my Azure Search management services in different classes, where I have a method to return a list of suggestions in strings like below.

Then, I have home controller calling this method and return Json as below.

This is it, it works beautifully.