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/includes/quickstarts/full-text-javascript.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -544,7 +544,7 @@ AzureKeyCredential credential = new AzureKeyCredential("<Your search service adm
544
544
545
545
### Create index
546
546
547
-
The *hotels_quickstart_index.json* file defines how Azure AI Search works with the documents you'll be loading in the next step. Each field will be identified by a `name` and have a specified `type`. Each field also has a series of index attributes that specify whether Azure AI Search can search, filter, sort, and facet upon the field. Most of the fields are simple data types, but some, like `AddressType` are complex types that allow you to create rich data structures in your index. You can read more about [supported data types](/rest/api/searchservice/supported-data-types) and index attributes described in [Create Index (REST)](/rest/api/searchservice/indexes/create).
547
+
The *hotels_quickstart_index.json* file defines how Azure AI Search works with the documents you load in the next step. Each field is identified by a `name` and have a specified `type`. Each field also has a series of index attributes that specify whether Azure AI Search can search, filter, sort, and facet upon the field. Most of the fields are simple data types, but some, like `AddressType` are complex types that allow you to create rich data structures in your index. You can read more about [supported data types](/rest/api/searchservice/supported-data-types) and index attributes described in [Create Index (REST)](/rest/api/searchservice/indexes/create).
548
548
549
549
With our index definition in place, we want to import *hotels_quickstart_index.json* at the top of *index.js* so the main function can access the index definition.
Copy file name to clipboardExpand all lines: articles/search/includes/quickstarts/full-text-python.md
+18-47Lines changed: 18 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ ms.date: 2/22/2025
16
16
17
17
- An active Azure subscription - <ahref="https://azure.microsoft.com/free/cognitive-services"target="_blank">Create one for free</a>
18
18
- An Azure AI Search service. [Create a service](../../search-create-service-portal.md) if you don't have one. You can use a free tier for this quickstart.
19
-
-[Visual Studio Code with the Python extension](https://code.visualstudio.com/docs/languages/python), or an equivalent IDE, with Python 3.10 or later. If you don't have a suitable version of Python installed, you can follow the instructions in the [VS Code Python Tutorial](https://code.visualstudio.com/docs/python/python-tutorial#_install-a-python-interpreter) for the easiest way of installing Python on your operating system.
19
+
-[Visual Studio Code with the Python extension](https://code.visualstudio.com/docs/languages/python), or an equivalent IDE, with Python 3.10 or later. If you don't have a suitable version of Python installed, you can follow the instructions in the [VS Code Python Tutorial](https://code.visualstudio.com/docs/python/python-tutorial#_install-a-python-interpreter).
20
20
21
21
## Microsoft Entra ID prerequisites
22
22
@@ -77,13 +77,13 @@ You run the sample code in a Jupyter notebook. So, you need to set up your envir
77
77
1. Select the notebook kernel.
78
78
79
79
1. In the top right corner of the notebook, select **Select Kernel**.
80
-
1. If you see **.venv** in the list, select it. If you don't see it, select**Select Another Kernel**>**Python environments**>**.venv**.
80
+
1. If you see `.venv` in the list, select it. If you don't see it, select**Select Another Kernel**>**Python environments**>`.venv`.
81
81
82
82
## Create, load, and query a search index
83
83
84
84
In this section, you add code to create a search index, load it with documents, and run queries. You run the program to see the results in the console. For a detailed explanation of the code, see the [explaining the code](#explaining-the-code) section.
85
85
86
-
1. Make sure the notebook is open in the **.venv** kernel as described in the previous section.
86
+
1. Make sure the notebook is open in the `.venv` kernel as described in the previous section.
87
87
1. Run the first code cell to install the required packages, including [azure-search-documents](/python/api/azure-search-documents).
88
88
89
89
```python
@@ -137,58 +137,29 @@ In this section, you add code to create a search index, load it with documents,
137
137
138
138
### Create an index
139
139
140
+
`SearchIndexClient` is used to create and manage indexes for Azure AI Search. Each field is identified by a `name` and has a specified `type`.
140
141
142
+
Each field also has a series of index attributes that specify whether Azure AI Search can search, filter, sort, and facet upon the field. Most of the fields are simple data types, but some, like `AddressType` are complex types that allow you to create rich data structures in your index. You can read more about [supported data types](/rest/api/searchservice/supported-data-types) and index attributes described in [Create Index (REST)](/rest/api/searchservice/indexes/create).
141
143
142
-
### Create a documents payload
144
+
### Create a documents payload and upload documents
143
145
144
146
Use an [index action](/python/api/azure-search-documents/azure.search.documents.models.indexaction) for the operation type, such as upload or merge-and-upload. Documents originate from the [HotelsData](https://github.com/Azure-Samples/azure-search-sample-data/blob/main/hotels/HotelsData_toAzureSearch.JSON) sample on GitHub.
145
147
148
+
### Search an index
146
149
147
-
### Upload documents
148
-
149
-
Upload documents to the index
150
-
151
-
152
-
### Run your first query
150
+
You can get query results as soon as the first document is indexed, but actual testing of your index should waituntil all documents are indexed.
153
151
154
152
Use the *search* method of the [search.client class](/python/api/azure-search-documents/azure.search.documents.searchclient).
155
153
156
-
This example executes an empty search (`search=*`), returning an unranked list (search score = 1.0) of arbitrary documents. Because there are no criteria, all documents are included in results.
157
-
158
-
159
-
### Run a term query
160
-
161
-
The next query adds whole terms to the search expression ("wifi"). This query specifies that results contain only those fields in the `select` statement. Limiting the fields that come back minimizes the amount of data sent back over the wire and reduces search latency.
162
-
163
-
164
-
### Add a filter
165
-
166
-
Add a filter expression, returning only those hotels with a rating greater than four, sorted in descending order.
167
-
168
-
169
-
### Add field scoping
170
-
171
-
Add `search_fields` to scope query execution to specific fields.
172
-
173
-
174
-
### Add facets
175
-
176
-
Facets are generated forpositive matches foundin search results. There are no zero matches. If search results don't include the term *wifi*, then *wifi* doesn't appear in the faceted navigation structure.
177
-
178
-
179
-
### Look up a document
180
-
181
-
Return a document based on its key. This operation is useful if you want to provide drill through when a user selects an item in a search result.
182
-
183
-
184
-
### Add autocomplete
185
-
186
-
Autocomplete can provide potential matches as the user types into the search box.
187
-
188
-
Autocomplete uses a suggester (`sg`) to know which fields contain potential matches to suggester requests. In this quickstart, those fields are `Tags`, `Address/City`, `Address/Country`.
189
-
190
-
To simulate autocomplete, pass in the letters *sa* as a partial string. The autocomplete method of [SearchClient](/python/api/azure-search-documents/azure.search.documents.searchclient) sends back potential term matches.
154
+
The sample queries in the notebook are:
155
+
- Basic query: Executes an empty search (`search=*`), returning an unranked list (search score = 1.0) of arbitrary documents. Because there are no criteria, all documents are included in results.
156
+
- Term query: Adds whole terms to the search expression ("wifi"). This query specifies that results contain only those fields in the `select` statement. Limiting the fields that come back minimizes the amount of data sent back over the wire and reduces search latency.
157
+
- Filtered query: Add a filter expression, returning only those hotels with a rating greater than four, sorted in descending order.
158
+
- Fielded scoping: Add `search_fields` to scope query execution to specific fields.
159
+
- Facets: Generate facets forpositive matches foundin search results. There are no zero matches. If search results don't include the term *wifi*, then *wifi* doesn't appear in the faceted navigation structure.
160
+
- Look up a document: Return a document based on its key. This operation is useful if you want to provide drill through when a user selects an item in a search result.
161
+
- Autocomplete: Provide potential matches as the user types into the search box. Autocomplete uses a suggester (`sg`) to know which fields contain potential matches to suggester requests. In this quickstart, those fields are `Tags`, `Address/City`, `Address/Country`. To simulate autocomplete, pass in the letters *sa* as a partial string. The autocomplete method of [SearchClient](/python/api/azure-search-documents/azure.search.documents.searchclient) sends back potential term matches.
191
162
192
-
## Remove the index
163
+
### Remove the index
193
164
194
-
If you are finished with this index, you can delete it by running the **Clean up** code cell. Deleting unnecessary indexes frees up space for stepping through more quickstarts and tutorials.
165
+
If you're finished with this index, you can delete it by running the **Clean up** code cell. Deleting unnecessary indexes frees up space for stepping through more quickstarts and tutorials.
Copy file name to clipboardExpand all lines: articles/search/includes/quickstarts/full-text-typescript.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -472,7 +472,7 @@ const credential = new AzureKeyCredential(apiKey);
472
472
473
473
### Create index
474
474
475
-
Create a file *hotels_quickstart_index.json*. This file defines how Azure AI Search works with the documents you'll be loading in the next step. Each field will be identified by a `name` and have a specified `type`. Each field also has a series of index attributes that specify whether Azure AI Search can search, filter, sort, and facet upon the field. Most of the fields are simple data types, but some, like `AddressType` are complex types that allow you to create rich data structures in your index. You can read more about [supported data types](/rest/api/searchservice/supported-data-types) and index attributes described in [Create Index (REST)](/rest/api/searchservice/indexes/create).
475
+
Create a file *hotels_quickstart_index.json*. This file defines how Azure AI Search works with the documents you load in the next step. Each field is identified by a `name` and have a specified `type`. Each field also has a series of index attributes that specify whether Azure AI Search can search, filter, sort, and facet upon the field. Most of the fields are simple data types, but some, like `AddressType` are complex types that allow you to create rich data structures in your index. You can read more about [supported data types](/rest/api/searchservice/supported-data-types) and index attributes described in [Create Index (REST)](/rest/api/searchservice/indexes/create).
476
476
477
477
We want to import *hotels_quickstart_index.json* so the main function can access the index definition.
0 commit comments