diff --git a/README.md b/README.md index 19105ae..ef0e68e 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,11 @@ This repository contains JavaScript sample code used in Azure Cognitive Search q ## Quickstart -This Node.js console app uses the Azure Cognitive Search REST APIs to create an index, load it with documents, and execute a few queries. The index is modeled on a subset of the Hotels dataset, reduced for readability and comprehension. Index definition and documents are included in the code. +This Node.js console app uses Azure Cognitive Search to create an index, load it with documents, and execute a few queries. The index is modeled on a subset of the Hotels dataset, reduced for readability and comprehension. Index definition and documents are included in the code. + +This sample is available in two versions: + ++ **REST** calls Azure Cognitive Search's REST APIs directly ++ **v11** uses the [@azure/search-documents](https://docs.microsoft.com/javascript/api/overview/azure/search-documents-readme?view=azure-node-latest) client libraries and is the recommmended approach + +You can view additional samples for Javascript/Typescript in the [azure-sdk-for-js repo](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/search/search-documents/samples). diff --git a/quickstart/.eslintrc b/quickstart/REST/.eslintrc similarity index 100% rename from quickstart/.eslintrc rename to quickstart/REST/.eslintrc diff --git a/quickstart/.prettierrc b/quickstart/REST/.prettierrc similarity index 100% rename from quickstart/.prettierrc rename to quickstart/REST/.prettierrc diff --git a/quickstart/AzureSearchClient.js b/quickstart/REST/AzureSearchClient.js similarity index 100% rename from quickstart/AzureSearchClient.js rename to quickstart/REST/AzureSearchClient.js diff --git a/quickstart/CONTRIBUTING.md b/quickstart/REST/CONTRIBUTING.md similarity index 100% rename from quickstart/CONTRIBUTING.md rename to quickstart/REST/CONTRIBUTING.md diff --git a/quickstart/LICENSE.md b/quickstart/REST/LICENSE.md similarity index 100% rename from quickstart/LICENSE.md rename to quickstart/REST/LICENSE.md diff --git a/quickstart/README.md b/quickstart/REST/README.md similarity index 93% rename from quickstart/README.md rename to quickstart/REST/README.md index 8d7fe7f..9a3db88 100644 --- a/quickstart/README.md +++ b/quickstart/REST/README.md @@ -1,16 +1,3 @@ ---- -page_type: sample -languages: - - javascript - - nodejs -name: Azure Cognitive Search Quickstart in Node.js -description: "Learn basic steps for creating, loading, and querying an Azure Cognitive Search index using REST APIs and Node.js." -products: - - azure - - azure-cognitive-search -urlFragment: nodejs-quickstart ---- - # Quickstart sample for Azure Cognitive Search with Node.js ![Quickstart sample MIT license badge](https://img.shields.io/badge/license-MIT-green.svg) diff --git a/quickstart/azure_search_config.json b/quickstart/REST/azure_search_config.json similarity index 100% rename from quickstart/azure_search_config.json rename to quickstart/REST/azure_search_config.json diff --git a/quickstart/hotels.json b/quickstart/REST/hotels.json similarity index 100% rename from quickstart/hotels.json rename to quickstart/REST/hotels.json diff --git a/quickstart/hotels_quickstart_index.json b/quickstart/REST/hotels_quickstart_index.json similarity index 100% rename from quickstart/hotels_quickstart_index.json rename to quickstart/REST/hotels_quickstart_index.json diff --git a/quickstart/index.js b/quickstart/REST/index.js similarity index 100% rename from quickstart/index.js rename to quickstart/REST/index.js diff --git a/quickstart/package.json b/quickstart/REST/package.json similarity index 100% rename from quickstart/package.json rename to quickstart/REST/package.json diff --git a/quickstart/v11/CONTRIBUTING.md b/quickstart/v11/CONTRIBUTING.md new file mode 100644 index 0000000..264b88e --- /dev/null +++ b/quickstart/v11/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# Contributing to Azure Cognitive Search samples + +This project welcomes contributions and suggestions. Most contributions require you to agree to a +Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us +the rights to use your contribution. For details, visit https://cla.microsoft.com. + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide +a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions +provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or +contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + + - [Code of Conduct](#coc) + - [Issues and Bugs](#issue) + - [Feature Requests](#feature) + - [Submission Guidelines](#submit) + +## Code of Conduct +Help us keep this project open and inclusive. Please read and follow our [Code of Conduct](https://opensource.microsoft.com/codeofconduct/). + +## Found an Issue? +If you find a bug in the source code or a mistake in the documentation, you can help us by +[submitting an issue](#submit-issue) to the GitHub Repository. Even better, you can +[submit a Pull Request](#submit-pr) with a fix. + +## Want a Feature? +You can *request* a new feature by [submitting an issue](#submit-issue) to the GitHub +Repository. If you would like to *implement* a new feature, please submit an issue with +a proposal for your work first, to be sure that we can use it. + +* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr). + +## Submission Guidelines + +### Submitting an Issue +Before you submit an issue, search the archive, maybe your question was already answered. + +If your issue appears to be a bug, and hasn't been reported, open a new issue. +Help us to maximize the effort we can spend fixing issues and adding new +features, by not reporting duplicate issues. Providing the following information will increase the +chances of your issue being dealt with quickly: + +* **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps +* **Version** - what version is affected (e.g. 0.1.2) +* **Motivation for or Use Case** - explain what are you trying to do and why the current behavior is a bug for you +* **Browsers and Operating System** - is this a problem with all browsers? +* **Reproduce the Error** - provide a live example or a unambiguous set of steps +* **Related Issues** - has a similar issue been reported before? +* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be + causing the problem (line of code or commit) + +You can file new issues by providing the above information at the corresponding repository's issues link: https://github.com/[organization-name]/[repository-name]/issues/new]. + +### Submitting a Pull Request (PR) +Before you submit your Pull Request (PR) consider the following guidelines: + +* Search the repository (https://github.com/[organization-name]/[repository-name]/pulls) for an open or closed PR + that relates to your submission. You don't want to duplicate effort. + +* Make your changes in a new git fork: + +* Commit your changes using a descriptive commit message +* Push your fork to GitHub: +* In GitHub, create a pull request +* If we suggest changes then: + * Make the required updates. + * Rebase your fork and force push to your GitHub repository (this will update your Pull Request): + + ```shell + git rebase master -i + git push -f + ``` + +That's it! Thank you for your contribution! diff --git a/quickstart/v11/LICENSE.md b/quickstart/v11/LICENSE.md new file mode 100644 index 0000000..d1ca00f --- /dev/null +++ b/quickstart/v11/LICENSE.md @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE \ No newline at end of file diff --git a/quickstart/v11/README.md b/quickstart/v11/README.md new file mode 100644 index 0000000..0886ebb --- /dev/null +++ b/quickstart/v11/README.md @@ -0,0 +1,89 @@ +--- +page_type: sample +languages: + - javascript + - nodejs +name: Azure Cognitive Search Quickstart in Javascript +description: "Learn basic steps for creating, loading, and querying an Azure Cognitive Search index using the Azure SDK for Javascipt/Typescript" +products: + - azure + - azure-cognitive-search +urlFragment: javascript-quickstart +--- + +# Quickstart sample for Azure Cognitive Search with Node.js + +![Quickstart sample MIT license badge](https://img.shields.io/badge/license-MIT-green.svg) + +Demonstrates using Javascript and the [Azure SDK for Javascript/Typescript](https://docs.microsoft.com/javascript/api/overview/azure/search-documents-readme?view=azure-node-latest) to create an Azure Cognitive Search index, load it with documents, and execute a few queries. The index is modeled on a subset of the Hotels dataset, reduced for readability and comprehension. Index definition and documents are included in the code. + +This Node.js console application is featured in [Node.js Quickstart: Create, load, and query indexes using Azure Cognitive Search REST APIs](https://docs.microsoft.com/azure/search/search-get-started-nodejs). When you run the program, a console window emits output messages for each step: deleting and then re-creating a hotels-quickstart index, loading documents, running queries. This sample uses the [Azure SDK for Javascript/Typescript](https://docs.microsoft.com/javascript/api/overview/azure/search-documents-readme?view=azure-node-latest) and runs on a search service using connection information that you provide. + +## Contents + +| File/folder | Description | +|-------------|-------------| +| `index.js` | The main program. | +| `hotels_quickstart_index.json` | Specifies the structure of a search index. | +| `hotels.json` | A small amount of sample data to populate the index. | +| `package.json` | The Node project definition file. | +| `package-lock.json` | The version dependencies of the project. | +| `.gitignore` | Define what to ignore at commit time. | +| `CONTRIBUTING.md` | Guidelines for contributing to the sample. | +| `README.md` | This README file. | +| `LICENSE.md` | The license for the sample. | + +## Prerequisites + ++ [Node.js](https://nodejs.org). ++ [NPM](https://www.npmjs.com) should be installed by Node.js. ++ [Create a search service in the portal](search-create-service-portal.md) or [find an existing service](https://ms.portal.azure.com/#blade/HubsExtension/BrowseResourceBlade/resourceType/Microsoft.Search%2FsearchServices) under your current subscription. You can use a free service for this quickstart. ++ [Visual Studio Code](https://code.visualstudio.com) or another IDE. + +## Setup + +1. Clone or download this sample repository. +1. Open the folder in VS Code and navigate to the quickstart/v11 folder: + + ```cmd + cd quickstart/v11 + ``` + +1. Install the dependencies using `npm`: + + ```bash + npm install + ``` + +1. Edit the file `sample.env`, adding the correct credentials to access your Azure Cognitive Search service. +1. Rename the file from `sample.env` to just `.env`. The quickstart will read the `.env` file automatically. + +### Running the quickstart + +1. Run the following command to start the program. + + ```bash + node index.js + ``` + +You should see a series of messages relating to the creation of the search index, adding documents to it, and, finally, results of a series of queries. + +## Key concepts + +The file **hotels_quickstart_index.json** holds the definition of an index for the data in the file **hotels.json**. Review those files to see the fields, which ones are searchable, etc. + +The file **index.js** automatically reads the **.env** file which contains the `SEARCH_API_KEY` and `SEARCH_API_ENDPOINT` needed to create the `SearchIndexCliient`. The `sleep` function is used to pause execution in between major steps such as creating the index, submitting data for indexing, etc. Such pauses are generally only needed in test, demo, and sample code. + +The `run` function : + ++ Checks if the `hotels-quickstart` index exists. ++ If so, the program deletes the existing index. ++ Creates a new `hotels-quickstart` index from the structure in **hotels_quickstart_index.json**. ++ Adds the data from **hotels.json** to the `hotels-quickstart` index. ++ Executes a few basic queries against the search index. + +## Next steps + +You can learn more about Azure Cognitive Search on the [official documentation site](https://docs.microsoft.com/azure/search/). + +You can view additional samples for Javascript/Typescript in the [azure-sdk-for-js repo](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/search/search-documents/samples) or see the [documentation](https://docs.microsoft.com/javascript/api/overview/azure/search-documents-readme?view=azure-node-latest). diff --git a/quickstart/v11/hotels.json b/quickstart/v11/hotels.json new file mode 100644 index 0000000..0240866 --- /dev/null +++ b/quickstart/v11/hotels.json @@ -0,0 +1,72 @@ +{ + "value": [ + { + "HotelId": "1", + "HotelName": "Secret Point Motel", + "Description": "The hotel is ideally located on the main commercial artery of the city in the heart of New York. A few minutes away is Time's Square and the historic centre of the city, as well as other places of interest that make New York one of America's most attractive and cosmopolitan cities.", + "Description_fr": "L'hôtel est idéalement situé sur la principale artère commerciale de la ville en plein cœur de New York. A quelques minutes se trouve la place du temps et le centre historique de la ville, ainsi que d'autres lieux d'intérêt qui font de New York l'une des villes les plus attractives et cosmopolites de l'Amérique.", + "Category": "Boutique", + "Tags": ["pool", "air conditioning", "concierge"], + "ParkingIncluded": false, + "LastRenovationDate": "1970-01-18T00:00:00Z", + "Rating": 3.6, + "Address": { + "StreetAddress": "677 5th Ave", + "City": "New York", + "StateProvince": "NY", + "PostalCode": "10022" + } + }, + { + "HotelId": "2", + "HotelName": "Twin Dome Motel", + "Description": "The hotel is situated in a nineteenth century plaza, which has been expanded and renovated to the highest architectural standards to create a modern, functional and first-class hotel in which art and unique historical elements coexist with the most modern comforts.", + "Description_fr": "L'hôtel est situé dans une place du XIXe siècle, qui a été agrandie et rénovée aux plus hautes normes architecturales pour créer un hôtel moderne, fonctionnel et de première classe dans lequel l'art et les éléments historiques uniques coexistent avec le confort le plus moderne.", + "Category": "Boutique", + "Tags": ["pool", "free wifi", "concierge"], + "ParkingIncluded": "false", + "LastRenovationDate": "1979-02-18T00:00:00Z", + "Rating": 3.6, + "Address": { + "StreetAddress": "140 University Town Center Dr", + "City": "Sarasota", + "StateProvince": "FL", + "PostalCode": "34243" + } + }, + { + "HotelId": "3", + "HotelName": "Triple Landscape Hotel", + "Description": "The Hotel stands out for its gastronomic excellence under the management of William Dough, who advises on and oversees all of the Hotel’s restaurant services.", + "Description_fr": "L'hôtel est situé dans une place du XIXe siècle, qui a été agrandie et rénovée aux plus hautes normes architecturales pour créer un hôtel moderne, fonctionnel et de première classe dans lequel l'art et les éléments historiques uniques coexistent avec le confort le plus moderne.", + "Category": "Resort and Spa", + "Tags": ["air conditioning", "bar", "continental breakfast"], + "ParkingIncluded": "true", + "LastRenovationDate": "2015-09-20T00:00:00Z", + "Rating": 4.8, + "Address": { + "StreetAddress": "3393 Peachtree Rd", + "City": "Atlanta", + "StateProvince": "GA", + "PostalCode": "30326" + } + }, + { + "HotelId": "4", + "HotelName": "Sublime Cliff Hotel", + "Description": "Sublime Cliff Hotel is located in the heart of the historic center of Sublime in an extremely vibrant and lively area within short walking distance to the sites and landmarks of the city and is surrounded by the extraordinary beauty of churches, buildings, shops and monuments. Sublime Cliff is part of a lovingly restored 1800 palace.", + "Description_fr": "Le sublime Cliff Hotel est situé au coeur du centre historique de sublime dans un quartier extrêmement animé et vivant, à courte distance de marche des sites et monuments de la ville et est entouré par l'extraordinaire beauté des églises, des bâtiments, des commerces et Monuments. Sublime Cliff fait partie d'un Palace 1800 restauré avec amour.", + "Category": "Boutique", + "Tags": ["concierge", "view", "24-hour front desk service"], + "ParkingIncluded": true, + "LastRenovationDate": "1960-02-06T00:00:00Z", + "Rating": 4.6, + "Address": { + "StreetAddress": "7400 San Pedro Ave", + "City": "San Antonio", + "StateProvince": "TX", + "PostalCode": "78216" + } + } + ] +} diff --git a/quickstart/v11/hotels_quickstart_index.json b/quickstart/v11/hotels_quickstart_index.json new file mode 100644 index 0000000..82df934 --- /dev/null +++ b/quickstart/v11/hotels_quickstart_index.json @@ -0,0 +1,129 @@ +{ + "name": "hotels-quickstart", + "fields": [ + { + "name": "HotelId", + "type": "Edm.String", + "key": true, + "filterable": true + }, + { + "name": "HotelName", + "type": "Edm.String", + "searchable": true, + "filterable": false, + "sortable": true, + "facetable": false + }, + { + "name": "Description", + "type": "Edm.String", + "searchable": true, + "filterable": false, + "sortable": false, + "facetable": false, + "analyzer": "en.lucene" + }, + { + "name": "Description_fr", + "type": "Edm.String", + "searchable": true, + "filterable": false, + "sortable": false, + "facetable": false, + "analyzer": "fr.lucene" + }, + { + "name": "Category", + "type": "Edm.String", + "searchable": true, + "filterable": true, + "sortable": true, + "facetable": true + }, + { + "name": "Tags", + "type": "Collection(Edm.String)", + "searchable": true, + "filterable": true, + "sortable": false, + "facetable": true + }, + { + "name": "ParkingIncluded", + "type": "Edm.Boolean", + "filterable": true, + "sortable": true, + "facetable": true + }, + { + "name": "LastRenovationDate", + "type": "Edm.DateTimeOffset", + "filterable": true, + "sortable": true, + "facetable": true + }, + { + "name": "Rating", + "type": "Edm.Double", + "filterable": true, + "sortable": true, + "facetable": true + }, + { + "name": "Address", + "type": "Edm.ComplexType", + "fields": [ + { + "name": "StreetAddress", + "type": "Edm.String", + "filterable": false, + "sortable": false, + "facetable": false, + "searchable": true + }, + { + "name": "City", + "type": "Edm.String", + "searchable": true, + "filterable": true, + "sortable": true, + "facetable": true + }, + { + "name": "StateProvince", + "type": "Edm.String", + "searchable": true, + "filterable": true, + "sortable": true, + "facetable": true + }, + { + "name": "PostalCode", + "type": "Edm.String", + "searchable": true, + "filterable": true, + "sortable": true, + "facetable": true + }, + { + "name": "Country", + "type": "Edm.String", + "searchable": true, + "filterable": true, + "sortable": true, + "facetable": true + } + ] + } + ], + "suggesters": [ + { + "name": "sg", + "searchMode": "analyzingInfixMatching", + "sourceFields": [ + "HotelName" + ] + } + ] +} \ No newline at end of file diff --git a/quickstart/v11/index.js b/quickstart/v11/index.js new file mode 100644 index 0000000..2be4edf --- /dev/null +++ b/quickstart/v11/index.js @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +// Importing the @azure/search-documents library +const { SearchIndexClient, SearchClient, AzureKeyCredential, odata } = require("@azure/search-documents"); + +// Importing the index definition and sample data +const hotelData = require('./hotels.json'); +const indexDefinition = require('./hotels_quickstart_index.json'); + +// Load the .env file if it exists +require("dotenv").config(); + +// Getting endpoint and apiKey from .env file +const endpoint = process.env.SEARCH_API_ENDPOINT || ""; +const apiKey = process.env.SEARCH_API_KEY || ""; + +async function main() { + console.log(`Running Azure Cognitive Search Javascript quickstart...`); + if (!endpoint || !apiKey) { + console.log("Make sure to set valid values for endpoint and apiKey with proper authorization."); + return; + } + + // Creating an index client to create the search index + const indexClient = new SearchIndexClient(endpoint, new AzureKeyCredential(apiKey)); + + // Getting the name of the index from the index definition + const indexName = indexDefinition["name"]; + + console.log('Checking if index exists...'); + await deleteIndexIfExists(indexClient, indexName); + + console.log('Creating index...'); + let index = await indexClient.createIndex(indexDefinition); + console.log(`Index named ${index.name} has been created.`); + + // Creating a search client to upload documents and issue queries + const searchClient = indexClient.getSearchClient(indexName); + + console.log('Uploading documents...'); + let indexDocumentsResult = await searchClient.mergeOrUploadDocuments(hotelData['value']); + console.log(`Index operations succeeded: ${JSON.stringify(indexDocumentsResult.results[0].succeeded)} `); + + // waiting one second for indexing to complete (for demo purposes only) + sleep(1000); + + console.log('Querying the index...'); + console.log(); + await sendQueries(searchClient); +} + +async function deleteIndexIfExists(indexClient, indexName) { + try { + await indexClient.deleteIndex(indexName); + console.log('Deleting index...'); + } catch { + console.log('Index does not exist yet.'); + } +} + +async function sendQueries(searchClient) { + // Query 1 + console.log('Query #1 - search everything:'); + let searchOptions = { + includeTotalCount: true, + select: ["HotelId", "HotelName", "Rating"] + }; + + let searchResults = await searchClient.search("*", searchOptions); + for await (const result of searchResults.results) { + console.log(`${JSON.stringify(result.document)}`); + } + console.log(`Result count: ${searchResults.count}`); + console.log(); + + + // Query 2 + console.log('Query #2 - search with filter, orderBy, and select:'); + let state = 'FL'; + searchOptions = { + filter: odata`Address/StateProvince eq ${state}`, + orderBy: ["Rating desc"], + select: ["HotelId", "HotelName", "Rating"] + }; + + searchResults = await searchClient.search("wifi", searchOptions); + for await (const result of searchResults.results) { + console.log(`${JSON.stringify(result.document)}`); + } + console.log(); + + // Query 3 + console.log('Query #3 - limit searchFields:'); + searchOptions = { + select: ["HotelId", "HotelName", "Rating"], + searchFields: ["HotelName"] + }; + + searchResults = await searchClient.search("sublime cliff", searchOptions); + for await (const result of searchResults.results) { + console.log(`${JSON.stringify(result.document)}`); + } + console.log(); + + // Query 4 + console.log('Query #4 - limit searchFields and use facets:'); + searchOptions = { + facets: ["Category"], + select: ["HotelId", "HotelName", "Rating"], + searchFields: ["HotelName"] + }; + + searchResults = await searchClient.search("*", searchOptions); + for await (const result of searchResults.results) { + console.log(`${JSON.stringify(result.document)}`); + } + console.log(); + + // Query 5 + console.log('Query #5 - Lookup document:'); + let documentResult = await searchClient.getDocument(key='3') + console.log(`HotelId: ${documentResult.HotelId}; HotelName: ${documentResult.HotelName}`) + console.log(); +} + +function sleep(ms) { + var d = new Date(); + var d2 = null; + do { + d2 = new Date(); + } while (d2 - d < ms); +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); \ No newline at end of file diff --git a/quickstart/v11/package.json b/quickstart/v11/package.json new file mode 100644 index 0000000..695ed3b --- /dev/null +++ b/quickstart/v11/package.json @@ -0,0 +1,30 @@ +{ + "name": "hotels", + "version": "0.1.0", + "description": "Hotels quickstart", + "main": "index.js", + "engine": { + "node": ">=8.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure-Samples/azure-search-javascript-samples.git" + }, + "keywords": [ + "Azure", + "Cognitive", + "Search", + "Sample", + "Node.js", + "JavaScript" + ], + "author": "Microsoft Corporation", + "bugs": { + "url": "https://github.com/Azure-Samples/azure-search-javascript-samples/issues" + }, + "license": "MIT", + "dependencies": { + "@azure/search-documents": "latest", + "dotenv": "^8.2.0" + } +} diff --git a/quickstart/v11/sample.env b/quickstart/v11/sample.env new file mode 100644 index 0000000..fb34058 --- /dev/null +++ b/quickstart/v11/sample.env @@ -0,0 +1,4 @@ +# Retrieve these values from a Cognitive Search instance in the Azure Portal. + +SEARCH_API_KEY= +SEARCH_API_ENDPOINT=https://.search.windows.net \ No newline at end of file