You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create an Azure function that specifies queries using JavaScript
description
Creates an Azure function that formulates queries, document lookup, and suggestions for typeahead queries.
products
azure
azure-cognitive-search
azure-functions
urlFragment
javascript-azure-function-search
Create an Azure function that specifies queries using JavaScript
This sample provides an Azure function that formulates queries, document lookup, and suggestions for typeahead queries against an Azure AI Search index.
What's in this sample
File
Description
package.json
Project file that defines dependencies
host.json
Azure Functions host configuration
local.settings.sample.json
Template for local settings configuration
src/functions/search.js
Function that executes search queries
src/functions/lookup.js
Function that retrieves a document by ID
src/functions/suggest.js
Function that provides typeahead suggestions
src/functions/status.js
Function that returns service status
src/lib/config.js
Configuration helper for search service connection
src/lib/azure-cognitive-search.js
Search client wrapper
Documentation
This sample is the JavaScript version of the api content used in Tutorial: Add search to web apps. You can substitute this code to create a JavaScript version of the sample app.