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
Create the indexer by giving it a name and referencing the data source and target index:
106
+
Indexer configuration specifies the inputs, parameters, and properties controlling run time behaviors.
107
107
108
-
```http
109
-
POST https://myservice.search.windows.net/indexers?api-version=2020-06-30
110
-
Content-Type: application/json
111
-
api-key: admin-key
108
+
1. [Create or update an indexer](/rest/api/searchservice/create-indexer) by giving it a name and referencing the data source and target index.
112
109
110
+
```http
111
+
POST https://[service name].search.windows.net/indexers?api-version=2020-06-30
112
+
Content-Type: application/json
113
+
api-key: [search service admin key]
113
114
{
114
-
"name" : "myindexer",
115
-
"dataSourceName" : "myazuresqldatasource",
116
-
"targetIndexName" : "target index name"
115
+
"name" : "[my-sqldb-indexer]",
116
+
"dataSourceName" : "[my-sqldb-ds]",
117
+
"targetIndexName" : "[my-search-index]",
118
+
"disabled": null,
119
+
"schedule": null,
120
+
"parameters": {
121
+
"batchSize": null,
122
+
"maxFailedItems": 0,
123
+
"maxFailedItemsPerBatch": 0,
124
+
"base64EncodeKeys": false,
125
+
"configuration": {}
126
+
},
127
+
"fieldMappings": [],
128
+
"encryptionKey": null
117
129
}
118
-
```
130
+
```
119
131
120
-
An indexer created in this way doesn’t have a schedule. It automatically runs once when it’s created. You can run it again at any time using a **run indexer** request:
132
+
1. [Specify field mappings](search-indexer-field-mappings.md) if there are differences in field name or type, or if you need multiple versions of a source field in the search index.
121
133
122
-
```http
123
-
POST https://myservice.search.windows.net/indexers/myindexer/run?api-version=2020-06-30
124
-
api-key: admin-key
125
-
```
134
+
1. See [Create an indexer](search-howto-create-indexers.md) for more information about other properties.
126
135
127
-
You can customize several aspects of indexer behavior, such as batch size and how many documents can be skipped before an indexer execution fails. For more information, see [Create Indexer API](/rest/api/searchservice/Create-Indexer).
136
+
An indexer runs automatically when it's created. You can prevent this by setting "disabled" to true. To control indexer execution, [run an indexer on demand](search-howto-run-reset-indexers.md) or [put it on a schedule](search-howto-schedule-indexers.md).
128
137
129
-
You may need to allow Azure services to connect to your database. See [Connecting From Azure](../azure-sql/database/firewall-configure.md) for instructions on how to do that.
138
+
## Check indexer status
130
139
131
140
To monitor the indexer status and execution history (number of items indexed, failures, etc.), use an **indexer status** request:
132
141
@@ -173,26 +182,6 @@ The response should look similar to the following:
173
182
Execution history contains up to 50 of the most recently completed executions, which are sorted in the reverse chronological order (so that the latest execution comes first in the response).
174
183
Additional information about the response can be found in [Get Indexer Status](/rest/api/searchservice/get-indexer-status)
175
184
176
-
## Run indexers on a schedule
177
-
178
-
You can also arrange the indexer to run periodically on a schedule. To do this, add the **schedule** property when creating or updating the indexer. The example below shows a PUT request to update the indexer:
179
-
180
-
```http
181
-
PUT https://myservice.search.windows.net/indexers/myindexer?api-version=2020-06-30
The **interval** parameter is required. The interval refers to the time between the start of two consecutive indexer executions. The smallest allowed interval is 5 minutes; the longest is one day. It must be formatted as an XSD "dayTimeDuration" value (a restricted subset of an [ISO 8601 duration](https://www.w3.org/TR/xmlschema11-2/#dayTimeDuration) value). The pattern for this is: `P(nD)(T(nH)(nM))`. Examples: `PT15M` for every 15 minutes, `PT2H` for every 2 hours.
193
-
194
-
For more information about defining indexer schedules see [How to schedule indexers for Azure Cognitive Search](search-howto-schedule-indexers.md).
Copy file name to clipboardExpand all lines: articles/search/search-howto-index-cosmosdb.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -203,7 +203,7 @@ In a [search index](search-what-is-an-index.md), add fields to accept the source
203
203
204
204
Indexer configuration specifies the inputs, parameters, and properties controlling run time behaviors.
205
205
206
-
1. [Create or update an indexer](/rest/api/searchservice/create-indexer) to use the predefined data source and search index.
206
+
1. [Create or update an indexer](/rest/api/searchservice/create-indexer) by giving it a name and referencing the data source and target index.
207
207
208
208
```http
209
209
POST https://[service name].search.windows.net/indexers?api-version=2020-06-30
@@ -231,6 +231,8 @@ Indexer configuration specifies the inputs, parameters, and properties controlli
231
231
232
232
1. See [Create an indexer](search-howto-create-indexers.md) for more information about other properties.
233
233
234
+
An indexer runs automatically when it's created. You can prevent this by setting "disabled" to true. To control indexer execution, [run an indexer on demand](search-howto-run-reset-indexers.md) or [put it on a schedule](search-howto-schedule-indexers.md).
0 commit comments