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
Copy file name to clipboardExpand all lines: articles/search/search-get-started-python.md
+12-9Lines changed: 12 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ ms.author: heidist
8
8
ms.service: cognitive-search
9
9
ms.devlang: python
10
10
ms.topic: quickstart
11
-
ms.date: 08/29/2022
11
+
ms.date: 08/31/2022
12
12
ms.custom: devx-track-python, mode-api
13
13
---
14
14
@@ -52,11 +52,14 @@ All requests require an api-key on every request sent to your service. Having a
52
52
53
53
In this task, start Jupyter Notebook and verify that you can connect to Azure Cognitive Search. You'll do this step by requesting a list of indexes from your service.
54
54
55
-
1. Create a new Python3 notebook.
55
+
1. Create a new Python3 notebook in Visual Studio Code:
56
+
57
+
1. Press F1 and search for "Python Select Interpreter" and choose a version of Python 3.7 or later.
58
+
1. Press F1 again and search for "Create: New Jupyter Notebook". You should have an empty, untitled .ipynb file open in the editor ready for the first entry.
56
59
57
60
1. In the first cell, load the libraries from the Azure SDK for Python, including [azure-search-documents](/python/api/azure-search-documents).
58
61
59
-
```python
62
+
```python
60
63
%pip install azure-search-documents --pre
61
64
%pip show azure-search-documents
62
65
@@ -73,11 +76,11 @@ In this task, start Jupyter Notebook and verify that you can connect to Azure Co
73
76
SimpleField,
74
77
SearchableField
75
78
)
76
-
```
79
+
```
77
80
78
-
1.In the second cell, input the request elements that will be constants on every request. Provide your search service name, admin API key, and query API key, copied in a previous step. This cell also sets up the clients you'll use for specific operations: [SearchIndexClient](/python/api/azure-search-documents/azure.search.documents.indexes.searchindexclient) to create an index, and [SearchClient](/python/api/azure-search-documents/azure.search.documents.searchclient) to query an index.
81
+
1. Add a second celland paste in theinput the request elements that will be constants on every request. Provide your search service name, admin API key, and query API key, copied in a previous step. This cell also sets up the clients you'll use for specific operations: [SearchIndexClient](/python/api/azure-search-documents/azure.search.documents.indexes.searchindexclient) to create an index, and [SearchClient](/python/api/azure-search-documents/azure.search.documents.searchclient) to query an index.
79
82
80
-
```python
83
+
```python
81
84
service_name ="YOUR-SEARCH-SERVICE-NAME"
82
85
admin_key ="YOUR-SEARCH-SERVICE-ADMIN-API-KEY"
83
86
@@ -92,17 +95,17 @@ In this task, start Jupyter Notebook and verify that you can connect to Azure Co
92
95
search_client = SearchClient(endpoint=endpoint,
93
96
index_name=index_name,
94
97
credential=AzureKeyCredential(admin_key))
95
-
```
98
+
```
96
99
97
100
1. In the third cell, run a delete_index operation to clear your service of any existing *hotels-quickstart* indexes. Deleting the index allows you to create another *hotels-quickstart* index of the same name.
0 commit comments