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/README.md
+23-3Lines changed: 23 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -342,7 +342,7 @@ Both `dataApi` and `searchApi` can be omitted from a configuration. Their defaul
342
342
| Property Name | Type | Description |
343
343
|--------|--------|--------|
344
344
| escapeSpecialCharacters |`boolean`|`v2.3.0+`**Works only with Search API 2.0**. Optional. Escapes special characters in the search string. |
345
-
|disableResponseCompatibility|`boolean`|`v2.3.0+`. Disables forced compatibility of the responses between v1 and v2. It's highly recommended to enable this option, because all response properties are duplicated by default for compatibility reasons. |
345
+
|enableResponseCompatibility|`boolean`|`v2.3.0+`. Enables compatibility of the responses between v1 and v2. Only enable this option temporarily, because it will force all response properties to be duplicated to achieve a full compatibility. |
346
346
347
347
## Request Examples
348
348
@@ -2196,12 +2196,32 @@ All functions: Query, Suggest and Autocomplete, - can be called with a single `s
2196
2196
2197
2197
_Examples below follow Microsoft's official documenation._
2198
2198
2199
-
> [!NOTE]
2199
+
> [!IMPORTANT]
2200
2200
> All request properties are `camelCase`, even though in Dataverse Search API v2.0 they are lowercase.
2201
2201
2202
-
> [!TIP]
2202
+
> [!NOTE]
2203
2203
> All objects in requests and responses are automatically converted and encoded as necessary (per official documentation), simplifying developer's work to construct the request and process the response.
2204
2204
2205
+
> [!TIP]
2206
+
> To enable a full compatibility between Search API v1 and v2 responses, you can temporarily set `enableResponseCompatibility` to `true` (in a `searchApi` config, see the code snippet below). The downside is that this will force all properties in the responses to be duplicated which will consume more memory (and cpu), thus it is not enabled by default.
2207
+
>
2208
+
> This option can be useful to test if your search api v1.0 queries are compatible with v2.0 before rewriting your code. The main compatibility issue could be a `filter` value because its syntax has been changed by Microsoft.
2209
+
>
2210
+
> Another use-case could be if you would like to rewrite your code to be fully compatible with v2.0 without switching to v2.0 queries (by keeping `version: "1.0"`) and having to deal with exceptions because of the `filter` incompatibility.
2211
+
2212
+
To turn on the response compatibility:
2213
+
2214
+
```ts
2215
+
const webApi =newDynamicsWebApi({
2216
+
searchApi: {
2217
+
// version: "2.0",
2218
+
options: {
2219
+
enableResponseCompatibility: true
2220
+
}
2221
+
}
2222
+
})
2223
+
```
2224
+
2205
2225
### Query
2206
2226
2207
2227
The following table describes all parameters for a `query` request:
0 commit comments