|
22 | 22 | "metadata": {}, |
23 | 23 | "outputs": [], |
24 | 24 | "source": [ |
25 | | - "# Uncomment the next line if you need to install the azure-search-documents client library:\n", |
26 | | - "%pip install azure-search-documents --pre\n", |
| 25 | + "# Import the libraries needed to create a search index, upload documents, and query the index\n", |
| 26 | + "%pip install azure-search-documents\n", |
27 | 27 | "%pip show azure-search-documents\n", |
28 | 28 | "%pip install python-dotenv\n", |
29 | 29 | "\n", |
|
33 | 33 | "from azure.search.documents import SearchClient\n", |
34 | 34 | "from azure.search.documents.indexes.models import ( \n", |
35 | 35 | " SearchIndex, \n", |
36 | | - " SearchField, \n", |
37 | 36 | " SearchFieldDataType, \n", |
38 | 37 | " SimpleField, \n", |
39 | 38 | " SearchableField,\n", |
|
83 | 82 | "cell_type": "markdown", |
84 | 83 | "metadata": {}, |
85 | 84 | "source": [ |
86 | | - "In the third cell, the index \"hotels-quickstart\" will be deleted if it previously existed." |
| 85 | + "In the next cell, the index \"hotels-quickstart\" will be deleted if it previously existed. This step allows you to reuse the index name." |
87 | 86 | ] |
88 | 87 | }, |
89 | 88 | { |
|
156 | 155 | "cell_type": "markdown", |
157 | 156 | "metadata": {}, |
158 | 157 | "source": [ |
159 | | - "Formulate the create_index request. This request targets the indexes collection of your search service and creates an index based on the index schema you provided in the previous cell." |
| 158 | + "Formulate the create_index request. This request targets the indexes collection of your search service and creates an index using the index schema from the previous cell." |
160 | 159 | ] |
161 | 160 | }, |
162 | 161 | { |
|
184 | 183 | "cell_type": "markdown", |
185 | 184 | "metadata": {}, |
186 | 185 | "source": [ |
187 | | - "Next, provide four documents that conform to the index schema. Specify an upload action for each document." |
| 186 | + "Next, set up documents to include four hotel documents conforming to the schema." |
188 | 187 | ] |
189 | 188 | }, |
190 | 189 | { |
|
278 | 277 | "cell_type": "markdown", |
279 | 278 | "metadata": {}, |
280 | 279 | "source": [ |
281 | | - "Formulate the request. This upload_documents request targets the docs collection of the hotels-quickstart index and pushes the documents provided in the previous step into the search index." |
| 280 | + "Formulate the request. This upload_documents request targets the docs collection of the hotels-quickstart index and pushes the documents from the previous step into the search index." |
282 | 281 | ] |
283 | 282 | }, |
284 | 283 | { |
|
299 | 298 | "cell_type": "markdown", |
300 | 299 | "metadata": {}, |
301 | 300 | "source": [ |
302 | | - "You are now ready to run some queries. For this operation, use search_client. \n", |
| 301 | + "You're now ready to run some queries. For this operation, use search_client. \n", |
303 | 302 | "\n", |
304 | 303 | "### Empty query with unscored results\n", |
305 | 304 | "\n", |
|
366 | 365 | "metadata": {}, |
367 | 366 | "outputs": [], |
368 | 367 | "source": [ |
369 | | - "results = search_client.search(query_type='semantic', query_language='en-us', semantic_configuration_name='my-semantic-config',\n", |
| 368 | + "results = search_client.search(query_type='semantic', semantic_configuration_name='my-semantic-config',\n", |
370 | 369 | " search_text=\"what hotel has a good restaurant on site\", \n", |
371 | 370 | " select='HotelName,Description,Category', query_caption='extractive')\n", |
372 | 371 | "\n", |
|
400 | 399 | "metadata": {}, |
401 | 400 | "outputs": [], |
402 | 401 | "source": [ |
403 | | - "results = search_client.search(query_type='semantic', query_language='en-us', semantic_configuration_name='my-semantic-config',\n", |
| 402 | + "results = search_client.search(query_type='semantic', semantic_configuration_name='my-semantic-config',\n", |
404 | 403 | " search_text=\"what hotel stands out for its gastronomic excellence\", \n", |
405 | 404 | " select='HotelName,Description,Category', query_caption='extractive', query_answer=\"extractive\",)\n", |
406 | 405 | "\n", |
|
439 | 438 | "cell_type": "markdown", |
440 | 439 | "metadata": {}, |
441 | 440 | "source": [ |
442 | | - "If you are finished with this index, you can delete it by running the following lines. Deleting unnecessary indexes frees up space for stepping through more quickstarts and tutorials." |
| 441 | + "If you're finished with this index, you can delete it by running the following lines. Deleting unnecessary indexes frees up space for stepping through more quickstarts and tutorials." |
443 | 442 | ] |
444 | 443 | }, |
445 | 444 | { |
|
0 commit comments