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: .github/NEW_IN_V2.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ DynamicsWebApi v2 has been fully rewritten in TypeScript. The process of rewriti
4
4
5
5
### Microsoft Dataverse Search API
6
6
v2 brings the power of Search, Suggest and Autocomplete capabilities of Microsoft Dataverse Search API.
7
+
`v2.3+` brings support for Dataverse Search API v2.0.
7
8
8
9
### `AbortController` and `AbortSignal` support (for Node.js 15+ and Browser)
9
10
Each request can now be aborted when it's no longer need to be completed via the `AbortController`.
@@ -20,6 +21,9 @@ Retrieve the org's CSDL $metadata document with a single call of `retrieveCsdlMe
20
21
### `v2.1+` Microsoft Power Pages Support
21
22
DynamicsWebApi now can be used in Micorosoft Power Pages website.
22
23
24
+
### `v2.3+` Background Operations Support
25
+
DynamicsWebApi supports enabling of background operations for custom actions.
26
+
23
27
### NPM Package contents
24
28
NPM package now includes a pre-bundled code of DynamicsWebApi to simplify a compilation process of the projects that depend on it. There are 4 separate bundles:
25
29
-`dist/dynamics-web-api.js` - a Browser ready version (to use as a Dynamics 365 web resource) + it's minified version `.min.js`[IIFE].
**Important!** Currently only Search API 1.0 is supported. Search API 2.0 is coming with `v.2.3.0`.
2165
-
If you must use 2.0, you could [use corresponding Actions](#execute-web-api-actions) for now. [more info](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/search/overview?tabs=sdk)
2164
+
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).
2166
2165
2167
-
DynamicsWebApi can be used to call Dataverse Search API and utilize its powerful Search, 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/legacy).
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.
2168
2167
2169
-
To set Search API version use: `newDynamicsWebApi({ searchApi: { version: "1.0" }})`.
2168
+
To set a Search API version use: `newDynamicsWebApi({ searchApi: { version: "2.0" }})`.
2170
2169
2171
-
Search, Suggest and Autocomplete requests have a common property `query`. This is the main property that configures a relevance search request.
2170
+
All functions: Query, Suggest and Autocomplete, - can be called with a single `string` parameter "a search term". But to utilize the full power of the relevance search use a common property `query`that is available in all 3 requests.
2172
2171
2173
-
All functions can also be called with a single parameter `term` which is of type `string`.
2172
+
_Examples below follow Microsoft's official documenation._
2174
2173
2175
-
Examples below follow Microsoft official documenation.
2174
+
**Note!** All request properties are `camelCase`, even though in Dataverse Search API v2.0 they are lowercase.
2176
2175
2177
-
### Search
2176
+
### Query
2178
2177
2179
-
The following table describes all parameters for a `search` request:
2178
+
The following table describes all parameters for a `query` request:
2180
2179
2181
2180
Property Name | Type | Description
2182
2181
------------ | ------------- | -------------
2183
2182
search | `string` | **Required**. The search parameter value contains the term to be searched for and has a 100-character limit.
2184
-
entities | `string[]` | The default table list searches across all Dataverse search–configured tables and columns. The default list is configured by your administrator when Dataverse search is enabled.
2183
+
count | `boolean` | Specify true to return the total record count; otherwise false. The default is **false**.
2184
+
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.
2185
2185
facets | `string[]` | Facets support the ability to drill down into data results after they've been retrieved.
2186
-
filter | `string` | Filters are applied while searching data and are specified in standard OData syntax.
2187
-
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.
2188
-
returnTotalRecordCount | `boolean` | Specify true to return the total record count; otherwise false. The default is **false**.
2189
-
searchMode | `string` | Specifies whether **any** or **all** the search terms must be matched to count the document as a match. The default is '**any**'.
2190
-
searchType | `string` | The search type specifies the syntax of a search query. Using '**simple**' selects simple query syntax and '**full**' selects Lucene query syntax. The default is '**simple**'.
2186
+
filter | `string` | Limits the scope of the search results returned.
2187
+
options | `string` or `SearchOptions` | Options are settings configured to search a search term.
2188
+
orderBy | `string[]` | Specifies how to order the results in order of precedence.
2191
2189
skip | `number` | Specifies the number of search results to skip.
2192
2190
top | `number` | Specifies the number of search results to retrieve. The default is **50**, and the maximum value is **100**.
2193
2191
2192
+
**SearchEntity**
2193
+
2194
+
Use this type to compose the array of tables to pass to the entities parameter.
2195
+
2196
+
Property Name | Type | Description
2197
+
------------ | ------------- | -------------
2198
+
name | `string` | **Required**. Logical name of the table. Specifies scope of the query.
2199
+
selectColumns | `string[]` | Optional. List of columns that needs to be projected when table documents are returned in response. If empty, only the table primary name is returned.
2200
+
searchColumns | `string[]` | Optional. List of columns to scope the query on. If empty, only the table primary name is searched on.
2201
+
filter | `string` | Optional. Filters applied on the entity.
2202
+
2203
+
**SearchOptions**
2204
+
2205
+
Options are settings configured to search a search term.
2206
+
2207
+
Property Name | Type | Description
2208
+
------------ | ------------- | -------------
2209
+
bestEffortSearchEnabled | `boolean` | Enables intelligent query workflow to return probable set of results if no good matches are found for the search request terms.
2210
+
groupRankingEnabled | `boolean` | When specified as all the search terms must be matched in order to consider the document as a match. Setting its value to any defaults to matching any word in the search term.
2211
+
queryType | `string` | Query Type. Values can be 'simple' or 'lucene'.
2212
+
searchMode | `string` | Enable ranking of results in the response optimized for display in search results pages where results are grouped by table. Values can be 'any' or 'all'.
@@ -2255,12 +2261,20 @@ The following table describes all parameters for a `suggest` request:
2255
2261
2256
2262
Property Name | Type | Description
2257
2263
------------ | ------------- | -------------
2258
-
search | `string` | **Required**. The search parameter value contains the term to be searched for and has a 3-character min limit and max 100-character limit.
2259
-
entities | `string[]` | The default table list searches across all Dataverse search–configured tables and columns. The default list is configured by your administrator when Dataverse search is enabled.
2264
+
search | `string` | **Required**. The text to search with. Search term must be at least three characters long and has a 100 character limit.
2265
+
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
+
filter | `string` | Limits the scope of the search results returned.
2267
+
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.
2260
2269
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.
2261
-
filter | `string` | Filters are applied while searching data and are specified in standard OData syntax.
2262
2270
top | `number` | Number of suggestions to retrieve. The default is **5**.
2263
-
useFuzzy | `boolean` | Use fuzzy search to aid with misspellings. The default is false.
2271
+
2272
+
**SuggestionOptions**
2273
+
Options are settings configured to search a search term.
2274
+
2275
+
Property Name | Type | Description
2276
+
------------ | ------------- | -------------
2277
+
advancedSuggestEnabled | `boolean` | Enables advanced suggestions for the search query. The default is false.
2264
2278
2265
2279
**Examples:**
2266
2280
@@ -2274,8 +2288,9 @@ let result = await dynamicsWebApi.suggest({
2274
2288
//the same as:
2275
2289
result=awaitdynamicsWebApi.suggest("mar");
2276
2290
2277
-
const firstText =result.value[0].text;
2278
-
const firstDocument =result.value[0].document;
2291
+
const firstText =result.Value[0].Text;
2292
+
const firstDocument =result.Value[0].Document;
2293
+
const error =result.Error;
2279
2294
```
2280
2295
2281
2296
```ts
@@ -2294,10 +2309,10 @@ The following table describes all parameters for an `autocomplete` request:
2294
2309
2295
2310
Property Name | Type | Description
2296
2311
------------ | ------------- | -------------
2297
-
search | `string` | **Required**. The search parameter value contains the term to be searched for and has a 100-character limit.
2298
-
entities | `string[]`| The default table list searches across all Dataverse search–configured tables and columns. The default list is configured by your administrator when Dataverse search is enabled.
2299
-
filter | `string` | Filters are applied while searching data and are specified in standard OData syntax.
2300
-
useFuzzy | `boolean` | Use fuzzy search to aid with misspellings. The default is false.
2312
+
search | `string` | **Required**. Search term must be at least one character long and has a 100character limit.
2313
+
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.
2314
+
filter | `string` | Limits the scope of the search results returned.
2315
+
fuzzy | `boolean` | Use fuzzy search to aid with misspellings. The default is false.
2301
2316
2302
2317
**Examples:**
2303
2318
@@ -2311,7 +2326,8 @@ let result = await dynamicsWebApi.autocomplete({
0 commit comments