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
@@ -22,7 +22,7 @@ Browser-compiled script and type definitions can be found in a v2 [dist](https:/
22
22
23
23
## Main Features
24
24
25
-
-**Microsoft Dataverse Search API**. Access the full power of its Search, Suggestion and Autocomplete capabilities.
25
+
-**Microsoft Dataverse Search API**. Access the full power of its Search (Query), Suggestion and Autocomplete capabilities.
26
26
-**Batch Requests**. Convert all requests into a Batch operation with two lines of code.
27
27
-**Simplicity and Automation**. Such as automated paging, big file downloading/uploading in chunks of data, automated conversion of requests with long URLs into a Batch Request in the background and more!
28
28
-**CRUD operations**. Including Fetch XML, Actions and Functions in Microsoft Dataverse Web API.
@@ -47,7 +47,8 @@ Also, please check [suggestions and contributions](#contributions) section to le
47
47
48
48
Check out [Dataverse Terminology](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/understand-terminology). Microsoft has done some changes in the namings of the objects and components of D365 and since DynamicsWebApi has been developing for many years there may be _conflicting_ naming, such as: `createEntity` - which _right now_ means "Create a Table Definition". Dataverse SDK terminology is what the library has been based on. I have no plans on changing that (except in documentation), mainly because Microsoft may change the namings again in the future which will lead to naming issues ...again.
49
49
50
-
**Please note!** "Dynamics 365" in this readme refers to Microsoft Dataverse (formerly known as Microsoft Common Data Service) / Microsoft Dynamics 365 Customer Engagement / Micorosft Dynamics CRM. **NOT** Microsoft Dynamics 365 Finance and Operations.
50
+
> [!NOTE]
51
+
> "Dynamics 365" in this readme refers to Microsoft Dataverse (formerly known as Microsoft Common Data Service) / Microsoft Dynamics 365 Customer Engagement / Micorosft Dynamics CRM. **NOT** Microsoft Dynamics 365 Finance and Operations.
DynamicsWebApi can be used to call Dataverse Search API and utilize its powerful Query, Suggest and Autocomplete capabilities. Before using, I highly recommend to get familiar with it by reading an [official documentation](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/search/overview?tabs=webapi).
2165
2166
2166
-
**Important!** This documentation is based on the Dataverse Search API v2.0. If you would like to find documentation about v1.0, please check [here](https://github.com/AleksandrRogov/DynamicsWebApi/blob/v2.2.1/.github/README.md#work-with-dataverse-search-api). But keep in mind, that some properties in the request and response objects are marked as deprecated to encourage usage of the v2.0 properties. Deprecated properties will be removed in the next major version.
2167
+
**Important!** This documentation is based on the Dataverse Search API v2.0 (added in `v2.3.0`). If you would like to find documentation for v1.0, please check [here](https://github.com/AleksandrRogov/DynamicsWebApi/blob/v2.2.1/.github/README.md#work-with-dataverse-search-api). Just keep in mind, that some properties in the request and response objects are marked as deprecated to encourage usage of the v2.0 properties. Deprecated properties and requests will be removed in the next major version.
2167
2168
2168
2169
To set a Search API version use: `newDynamicsWebApi({ searchApi: { version: "2.0" }})`.
2169
2170
@@ -2225,36 +2226,58 @@ result = await dynamicsWebApi.query("<search term>");
2225
2226
```
2226
2227
2227
2228
```ts
2228
-
//more complex example (from Microsoft's documentation)
2229
+
//more complex example (from Microsoft's official documentation)
2229
2230
2230
2231
const result =awaitdynamicsWebApi.query({
2231
-
search: "Contoso",
2232
-
skip: 0,
2233
-
top: 7,
2234
-
entities: [{
2235
-
name: "account",
2236
-
selectColumns: ["name", "createdon"],
2237
-
searchColumns: ["name"],
2238
-
filter: "statecode eq 0"
2239
-
}, {
2240
-
name: "contact",
2241
-
selectColumns: ["fullname", "createdon"],
2242
-
searchColumns: ["fullname"],
2243
-
filter: "statecode eq 0"
2244
-
}],
2245
-
orderBy: ["createdon desc"],
2246
-
filter: "createdon gt 2022-08-15",
2247
-
count: true
2232
+
query: {
2233
+
search: "Contoso",
2234
+
skip: 0,
2235
+
top: 7,
2236
+
entities: [{
2237
+
name: "account",
2238
+
selectColumns: ["name", "createdon"],
2239
+
searchColumns: ["name"],
2240
+
filter: "statecode eq 0"
2241
+
}, {
2242
+
name: "contact",
2243
+
selectColumns: ["fullname", "createdon"],
2244
+
searchColumns: ["fullname"],
2245
+
filter: "statecode eq 0"
2246
+
}],
2247
+
orderBy: ["createdon desc"],
2248
+
filter: "createdon gt 2022-08-15",
2249
+
count: true
2250
+
}
2248
2251
});
2249
2252
2250
-
//result:
2251
-
const error =result.Error;
2252
-
const value =result.Value;
2253
+
//all data for v2 is returned inside the "response" property
As you can see all objects are automatically converted and encoded as per official documentation, simplifying developer's
2279
+
work to construct the request and to process the response.
2280
+
2258
2281
### Suggest
2259
2282
2260
2283
The following table describes all parameters for a `suggest` request:
@@ -2265,46 +2288,77 @@ search | `string` | **Required**. The text to search with. Search term must be a
2265
2288
entities | `string`, `string[]` or `SearchEntity[]` | Limits the scope of search to a subset of tables. The default set is configured by your administrator when Dataverse search is enabled.
2266
2289
filter | `string` | Limits the scope of the search results returned.
2267
2290
fuzzy | `boolean` | Use fuzzy search to aid with misspellings. The default is false.
2268
-
options | `string` or `SuggestionOptions` | Options are settings configured to search a search term.
2291
+
options | `string` or `SuggestOptions` | Options are settings configured to search a search term.
2269
2292
orderBy | `string[]` | A list of comma-separated clauses where each clause consists of a column name followed by 'asc' (ascending, which is the default) or 'desc' (descending). This list specifies how to order the results in order of precedence.
2270
2293
top | `number` | Number of suggestions to retrieve. The default is **5**.
2271
2294
2272
-
**SuggestionOptions**
2295
+
**SuggestOptions**
2296
+
2273
2297
Options are settings configured to search a search term.
2274
2298
2275
2299
Property Name | Type | Description
2276
2300
------------ | ------------- | -------------
2277
-
advancedSuggestEnabled | `boolean` | Enables advanced suggestions for the search query. The default is false.
2301
+
advancedSuggestEnabled | `boolean` | Enables advanced suggestions for the search query. The default is false. _Tbh, I
2302
+
don't know what this option does, the official documentation does not provide any info, so lmk if you know what it is._
2278
2303
2279
2304
**Examples:**
2280
2305
2281
2306
```ts
2282
2307
let result =awaitdynamicsWebApi.suggest({
2283
2308
query: {
2284
-
search: "mar"
2309
+
search: "Con"
2285
2310
}
2286
2311
});
2287
2312
2288
-
//the same as:
2289
-
result=awaitdynamicsWebApi.suggest("mar");
2313
+
//same as:
2314
+
result=awaitdynamicsWebApi.suggest("Con");
2290
2315
2291
-
const firstText =result.Value[0].Text;
2292
-
const firstDocument =result.Value[0].Document;
2293
-
const error =result.Error;
2316
+
//all data for v2 is returned inside the "response" property
> Something is wrong with this Search API endpoint. Does not matter what requests are done, I always get an error:
2355
+
>
2356
+
> `Invalidexpression: Unsupportedfunction call: search.ismatchscoring. This function is only supported in the Search API. Parameter name: $filter.`
2357
+
>
2358
+
This looks like and ootb issue, they are using an unsupported operator `search.ismatchscoring` in a [Search Service's Autocomplete query](https://learn.microsoft.com/en-us/azure/search/search-query-odata-full-text-search-functions) function. Let me know if this gets resolved, I will remove the warning.
Copy file name to clipboardExpand all lines: README.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
@@ -12,7 +12,7 @@ As well as Microsoft Dynamics 365 CE (online), Microsoft Dynamics 365 CE (on-pre
12
12
13
13
## Main Features
14
14
15
-
-**Microsoft Dataverse Search API**. Access the full power of its Search, Suggestion and Autocomplete capabilities.
15
+
-**Microsoft Dataverse Search API**. Access the full power of its Search (Query), Suggestion and Autocomplete capabilities.
16
16
-**Batch Requests**. Convert all requests into a Batch operation with two lines of code.
17
17
-**Simplicity and Automation**. Automated paging, big file downloading/uploading in chunks of data, automated conversion of requests with long URLs into a Batch Request and more!
18
18
-**CRUD operations**. Including Fetch XML, Actions and Functions in Microsoft Dataverse Web API.
0 commit comments