Skip to content

Commit 62e4b32

Browse files
authored
Merge pull request #79 from HeidiSteen/main
Tested quickstart notebook
2 parents dce1283 + 2fac495 commit 62e4b32

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

Quickstart/v11/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,15 @@ This sample is a Jupyter Python3 .ipynb file to perform the actions against the
2828
## Set up the sample
2929

3030
1. Clone or download this sample repository.
31-
2. Extract contents if the download is a zip file. Make sure the files are read-write.
31+
32+
1. Extract contents if the download is a zip file. Make sure the files are read-write.
3233

3334
## Run the sample
3435

3536
1. Open the azure-search-quickstart.ipynb file in Visual Studio Code.
3637

38+
1. Open an integrated terminal and run `pip install azure-search-documents`.
39+
3740
1. Set the service endpoint and API key for your search service:
3841

3942
* service_name = "YOUR-SEARCH-SERVICE-NAME"

Quickstart/v11/azure-search-quickstart.ipynb

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
22
"cells": [
33
{
4+
"attachments": {},
45
"cell_type": "markdown",
56
"metadata": {},
67
"source": [
7-
"# Create a search index using the Azure Cognitive Search Python SDK"
8+
"# Create a search index in Azure Cognitive Search using the Azure SDK for Python"
89
]
910
},
1011
{
12+
"attachments": {},
1113
"cell_type": "markdown",
1214
"metadata": {},
1315
"source": [
14-
"This sample uses Jupyter Notebook to demonstrate index creation, data ingestion, and queries of an Azure Cognitive Search index by calling the azure-search-documents library in the Azure SDK for Python. This notebook is a companion document to this [Python quickstart](https://docs.microsoft.com/azure/search/search-get-started-python). \n",
15-
"\n",
16-
"To get started, load the libraries from the SDK. If you don't already have the SDK, uncomment the first install command and run that first."
16+
"This Jupyter Notebook steps through creating, loading, and querying an index in Azure Cognitive Search index by calling the azure-search-documents library in the Azure SDK for Python. "
1717
]
1818
},
1919
{
@@ -22,10 +22,10 @@
2222
"metadata": {},
2323
"outputs": [],
2424
"source": [
25-
"# If you have not already installed the Python SDK, execute:\n",
25+
"# Uncomment the next line if you need to install the azure-search-documents client library:\n",
2626
"# !pip install azure-search-documents --pre\n",
2727
"\n",
28-
"# This sample uses version: 11.1.0b3\n",
28+
"# This sample uses version: 11.1.0\n",
2929
"!pip show azure-search-documents\n",
3030
"\n",
3131
"import os\n",
@@ -44,10 +44,11 @@
4444
]
4545
},
4646
{
47+
"attachments": {},
4748
"cell_type": "markdown",
4849
"metadata": {},
4950
"source": [
50-
"In the first cell, initialize the administrative and search query clients used to make each request. Replace the search service_name, admin_key and query_key with valid values. If you get ConnectionError \"Failed to establish a new connection\", verify that the api-key is a primary or secondary admin key, and not a query key."
51+
"In this step, initialize the search client used to make each request. Provide the name and admin API key of your search service. If you get ConnectionError \"Failed to establish a new connection\", verify that the api-key is a primary or secondary admin key, and not a query key."
5152
]
5253
},
5354
{
@@ -58,7 +59,7 @@
5859
"source": [
5960
"# Set the service endpoint and API key from the environment\n",
6061
"\n",
61-
"service_name = \"YOUR-SEARCH-SERIVCE-NAME\"\n",
62+
"service_name = \"YOUR-SEARCH-SERVICE-NAME\"\n",
6263
"admin_key = \"YOUR-SEARCH-SERVICE-ADMIN-API-KEY\"\n",
6364
"\n",
6465
"index_name = \"hotels-quickstart\"\n",
@@ -342,7 +343,7 @@
342343
"cell_type": "markdown",
343344
"metadata": {},
344345
"source": [
345-
"In the next query, add search_fields (an array) to scope query matching to a single field. "
346+
"In the next query, add search_fields to scope query matching to a single field. If you're using a newer version of the client library, search_fields is an array. Add brackets around 'HotelName' if you get an error."
346347
]
347348
},
348349
{
@@ -351,7 +352,7 @@
351352
"metadata": {},
352353
"outputs": [],
353354
"source": [
354-
"results = search_client.search(search_text=\"sublime\", search_fields=['HotelName'], select='HotelId,HotelName')\n",
355+
"results = search_client.search(search_text=\"sublime\", search_fields='HotelName', select='HotelId,HotelName')\n",
355356
"\n",
356357
"for result in results:\n",
357358
" print(\"{}: {}\".format(result[\"HotelId\"], result[\"HotelName\"]))"
@@ -479,7 +480,12 @@
479480
"name": "python",
480481
"nbconvert_exporter": "python",
481482
"pygments_lexer": "ipython3",
482-
"version": "3.7.3"
483+
"version": "3.9.5"
484+
},
485+
"vscode": {
486+
"interpreter": {
487+
"hash": "9ff083f0c83558f9261023d47a77b9b3eb892c62cdbe066d046abcad1a5edb5c"
488+
}
483489
}
484490
},
485491
"nbformat": 4,

0 commit comments

Comments
 (0)