@azure/search-documents 11.3.0-beta.6 → 11.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +73 -35
  3. package/dist/index.js +839 -2940
  4. package/dist/index.js.map +1 -1
  5. package/dist-esm/src/constants.js +1 -1
  6. package/dist-esm/src/constants.js.map +1 -1
  7. package/dist-esm/src/generated/data/index.js +0 -1
  8. package/dist-esm/src/generated/data/index.js.map +1 -1
  9. package/dist-esm/src/generated/data/models/index.js +1 -202
  10. package/dist-esm/src/generated/data/models/index.js.map +1 -1
  11. package/dist-esm/src/generated/data/models/mappers.js +1 -138
  12. package/dist-esm/src/generated/data/models/mappers.js.map +1 -1
  13. package/dist-esm/src/generated/data/models/parameters.js +13 -72
  14. package/dist-esm/src/generated/data/models/parameters.js.map +1 -1
  15. package/dist-esm/src/generated/data/operations/documents.js +51 -23
  16. package/dist-esm/src/generated/data/operations/documents.js.map +1 -1
  17. package/dist-esm/src/generated/data/searchClient.js +2 -2
  18. package/dist-esm/src/generated/data/searchClient.js.map +1 -1
  19. package/dist-esm/src/generated/data/searchClientContext.js +11 -13
  20. package/dist-esm/src/generated/data/searchClientContext.js.map +1 -1
  21. package/dist-esm/src/generated/service/index.js +0 -1
  22. package/dist-esm/src/generated/service/index.js.map +1 -1
  23. package/dist-esm/src/generated/service/models/index.js +1 -904
  24. package/dist-esm/src/generated/service/models/index.js.map +1 -1
  25. package/dist-esm/src/generated/service/models/mappers.js +11 -674
  26. package/dist-esm/src/generated/service/models/mappers.js.map +1 -1
  27. package/dist-esm/src/generated/service/models/parameters.js +1 -37
  28. package/dist-esm/src/generated/service/models/parameters.js.map +1 -1
  29. package/dist-esm/src/generated/service/operations/dataSources.js +30 -13
  30. package/dist-esm/src/generated/service/operations/dataSources.js.map +1 -1
  31. package/dist-esm/src/generated/service/operations/indexers.js +45 -45
  32. package/dist-esm/src/generated/service/operations/indexers.js.map +1 -1
  33. package/dist-esm/src/generated/service/operations/indexes.js +40 -11
  34. package/dist-esm/src/generated/service/operations/indexes.js.map +1 -1
  35. package/dist-esm/src/generated/service/operations/skillsets.js +30 -43
  36. package/dist-esm/src/generated/service/operations/skillsets.js.map +1 -1
  37. package/dist-esm/src/generated/service/operations/synonymMaps.js +29 -9
  38. package/dist-esm/src/generated/service/operations/synonymMaps.js.map +1 -1
  39. package/dist-esm/src/generated/service/searchServiceClient.js +12 -9
  40. package/dist-esm/src/generated/service/searchServiceClient.js.map +1 -1
  41. package/dist-esm/src/generated/service/searchServiceClientContext.js +11 -13
  42. package/dist-esm/src/generated/service/searchServiceClientContext.js.map +1 -1
  43. package/dist-esm/src/geographyPoint.js +1 -1
  44. package/dist-esm/src/geographyPoint.js.map +1 -1
  45. package/dist-esm/src/index.js +3 -4
  46. package/dist-esm/src/index.js.map +1 -1
  47. package/dist-esm/src/indexDocumentsBatch.js +1 -1
  48. package/dist-esm/src/indexDocumentsBatch.js.map +1 -1
  49. package/dist-esm/src/indexModels.js.map +1 -1
  50. package/dist-esm/src/odataMetadataPolicy.js +15 -7
  51. package/dist-esm/src/odataMetadataPolicy.js.map +1 -1
  52. package/dist-esm/src/searchApiKeyCredentialPolicy.js +21 -8
  53. package/dist-esm/src/searchApiKeyCredentialPolicy.js.map +1 -1
  54. package/dist-esm/src/searchAudience.js +21 -0
  55. package/dist-esm/src/searchAudience.js.map +1 -0
  56. package/dist-esm/src/searchClient.js +56 -77
  57. package/dist-esm/src/searchClient.js.map +1 -1
  58. package/dist-esm/src/searchIndexClient.js +57 -70
  59. package/dist-esm/src/searchIndexClient.js.map +1 -1
  60. package/dist-esm/src/searchIndexerClient.js +65 -119
  61. package/dist-esm/src/searchIndexerClient.js.map +1 -1
  62. package/dist-esm/src/searchIndexingBufferedSender.js +11 -11
  63. package/dist-esm/src/searchIndexingBufferedSender.js.map +1 -1
  64. package/dist-esm/src/serialization.js +5 -5
  65. package/dist-esm/src/serialization.js.map +1 -1
  66. package/dist-esm/src/serviceModels.js.map +1 -1
  67. package/dist-esm/src/serviceUtils.js +31 -69
  68. package/dist-esm/src/serviceUtils.js.map +1 -1
  69. package/dist-esm/src/synonymMapHelper.js +2 -6
  70. package/dist-esm/src/synonymMapHelper.js.map +1 -1
  71. package/dist-esm/src/tracing.js +1 -1
  72. package/dist-esm/src/tracing.js.map +1 -1
  73. package/package.json +38 -38
  74. package/types/search-documents.d.ts +188 -1049
  75. package/dist-esm/src/generated/data/operationsInterfaces/documents.js +0 -9
  76. package/dist-esm/src/generated/data/operationsInterfaces/documents.js.map +0 -1
  77. package/dist-esm/src/generated/data/operationsInterfaces/index.js +0 -9
  78. package/dist-esm/src/generated/data/operationsInterfaces/index.js.map +0 -1
  79. package/dist-esm/src/generated/service/operationsInterfaces/dataSources.js +0 -9
  80. package/dist-esm/src/generated/service/operationsInterfaces/dataSources.js.map +0 -1
  81. package/dist-esm/src/generated/service/operationsInterfaces/index.js +0 -13
  82. package/dist-esm/src/generated/service/operationsInterfaces/index.js.map +0 -1
  83. package/dist-esm/src/generated/service/operationsInterfaces/indexers.js +0 -9
  84. package/dist-esm/src/generated/service/operationsInterfaces/indexers.js.map +0 -1
  85. package/dist-esm/src/generated/service/operationsInterfaces/indexes.js +0 -9
  86. package/dist-esm/src/generated/service/operationsInterfaces/indexes.js.map +0 -1
  87. package/dist-esm/src/generated/service/operationsInterfaces/skillsets.js +0 -9
  88. package/dist-esm/src/generated/service/operationsInterfaces/skillsets.js.map +0 -1
  89. package/dist-esm/src/generated/service/operationsInterfaces/synonymMaps.js +0 -9
  90. package/dist-esm/src/generated/service/operationsInterfaces/synonymMaps.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Release History
2
2
 
3
+ ## 11.3.0 (2022-09-06)
4
+
5
+ ### Features Added
6
+
7
+ - Enabled national cloud support for Azure Search SDK. Please refer [#22887](https://github.com/Azure/azure-sdk-for-js/pull/22887) for further details.
8
+ - Support for TokenCredential has been added. With this addition, the Search SDK supports authentication via AAD.
9
+
10
+ ### Bugs Fixed
11
+
12
+ - Converted the complex fields correctly within the Search Fields. Please refer [#16489](https://github.com/Azure/azure-sdk-for-js/issues/16489) for more details.
13
+ - Fixed the typos `anayzerName` to `analyzerName` in `convertFieldsToPublic` method of `serviceUtils.ts`.
14
+ - Fixed the issue with the presence of recursive structure while uploading documents. Please refer [#15656](https://github.com/Azure/azure-sdk-for-js/issues/15656) for further details.
15
+
16
+ ### Note
17
+
18
+ - This GA release includes AAD with multi-cloud support and all the bug fixes since the last [11.2.0](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/search-documents/CHANGELOG.md#1120-2021-06-08) GA release. Other preview features and breaking changes from the [11.3.0-beta.1](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/search-documents/CHANGELOG.md#1130-beta1-2021-07-07) to [11.3.0-beta.8](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/search-documents/CHANGELOG.md#1130-beta8-unreleased) releases are not included in this GA release.
19
+
20
+ ## 11.3.0-beta.8 (2022-09-06)
21
+
22
+ - Added `core-http-compat` dependency
23
+ - Enabled national cloud support for Azure Search SDK. Please refer [#22887](https://github.com/Azure/azure-sdk-for-js/pull/22887) for further details.
24
+
25
+ ## 11.3.0-beta.7 (2022-03-08)
26
+
27
+ ### Features Added
28
+
29
+ - Added new APIs `createAlias`, `createOrUpdateAlias`, `deleteAlias`, `getAlias` & `listAliases` operations to the `SearchIndexClient`.
30
+
3
31
  ## 11.3.0-beta.6 (2022-02-08)
4
32
 
5
33
  ### Features Added
package/README.md CHANGED
@@ -19,13 +19,12 @@ Use the @azure/search-documents client library to:
19
19
  - Create and manage analyzers for advanced text analysis or multi-lingual content.
20
20
  - Optimize results through scoring profiles to factor in business logic or freshness.
21
21
 
22
- Key links:
23
- - [Source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/search-documents/)
24
- - [Package (NPM)](https://www.npmjs.com/package/@azure/search-documents)
25
- - [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/search-documents)
26
- - [REST API documentation](https://docs.microsoft.com/rest/api/searchservice/)
27
- - [Product documentation](https://docs.microsoft.com/azure/search/)
28
- - [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/search/search-documents/samples)
22
+ [Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/search/search-documents/) |
23
+ [Package (NPM)](https://www.npmjs.com/package/@azure/search-documents) |
24
+ [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/search-documents) |
25
+ [REST API documentation](https://docs.microsoft.com/rest/api/searchservice/) |
26
+ [Product documentation](https://docs.microsoft.com/azure/search/) |
27
+ [Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/search/search-documents/samples)
29
28
 
30
29
  ## Getting started
31
30
 
@@ -67,9 +66,9 @@ az search admin-key show --resource-group <your-resource-group-name> --service-n
67
66
 
68
67
  Alternatively, you can get the endpoint and Admin Key from the resource information in the [Azure Portal][azure_portal].
69
68
 
70
- There are two types of keys used to access your search service: **admin** *(read-write)* and **query** *(read-only)* keys. Restricting access and operations in client apps is essential to safeguarding the search assets on your service. Always use a query key rather than an admin key for any query originating from a client app.
69
+ There are two types of keys used to access your search service: **admin** _(read-write)_ and **query** _(read-only)_ keys. Restricting access and operations in client apps is essential to safeguarding the search assets on your service. Always use a query key rather than an admin key for any query originating from a client app.
71
70
 
72
- *Note: The example Azure CLI snippet above retrieves an admin key so it's easier to get started exploring APIs, but it should be managed carefully.*
71
+ _Note: The example Azure CLI snippet above retrieves an admin key so it's easier to get started exploring APIs, but it should be managed carefully._
73
72
 
74
73
  Once you have an api-key, you can use it as follows:
75
74
 
@@ -95,25 +94,63 @@ const indexClient = new SearchIndexClient("<endpoint>", new AzureKeyCredential("
95
94
  const indexerClient = new SearchIndexerClient("<endpoint>", new AzureKeyCredential("<apiKey>"));
96
95
  ```
97
96
 
97
+ ### Authenticate in a National Cloud
98
+
99
+ To authenticate in a [National Cloud](https://docs.microsoft.com/azure/active-directory/develop/authentication-national-cloud), you will need to make the following additions to your client configuration:
100
+
101
+ - Set the `Audience` in `SearchClientOptions`
102
+
103
+ ```js
104
+ const {
105
+ SearchClient,
106
+ SearchIndexClient,
107
+ SearchIndexerClient,
108
+ AzureKeyCredential,
109
+ KnownSearchAudience,
110
+ } = require("@azure/search-documents");
111
+
112
+ // To query and manipulate documents
113
+ const searchClient = new SearchClient(
114
+ "<endpoint>",
115
+ "<indexName>",
116
+ new AzureKeyCredential("<apiKey>"),
117
+ {
118
+ audience: KnownSearchAudience.AzureChina,
119
+ }
120
+ );
121
+
122
+ // To manage indexes and synonymmaps
123
+ const indexClient = new SearchIndexClient("<endpoint>", new AzureKeyCredential("<apiKey>"), {
124
+ audience: KnownSearchAudience.AzureChina,
125
+ });
126
+
127
+ // To manage indexers, datasources and skillsets
128
+ const indexerClient = new SearchIndexerClient("<endpoint>", new AzureKeyCredential("<apiKey>"), {
129
+ audience: KnownSearchAudience.AzureChina,
130
+ });
131
+ ```
132
+
98
133
  ## Key concepts
99
- An Azure Cognitive Search service contains one or more indexes that provide persistent storage of searchable data in the form of JSON documents. _(If you're brand new to search, you can make a very rough analogy between indexes and database tables.)_ The @azure/search-documents client library
134
+
135
+ An Azure Cognitive Search service contains one or more indexes that provide persistent storage of searchable data in the form of JSON documents. _(If you're brand new to search, you can make a very rough analogy between indexes and database tables.)_ The @azure/search-documents client library
100
136
  exposes operations on these resources through three main client types.
101
137
 
102
- * `SearchClient` helps with:
103
- * [Searching](https://docs.microsoft.com/azure/search/search-lucene-query-architecture) your indexed documents using [rich queries](https://docs.microsoft.com/azure/search/search-query-overview) and [powerful data shaping](https://docs.microsoft.com/azure/search/search-filters)
104
- * [Autocompleting](https://docs.microsoft.com/rest/api/searchservice/autocomplete) partially typed search terms based on documents in the index
105
- * [Suggesting](https://docs.microsoft.com/rest/api/searchservice/suggestions) the most likely matching text in documents as a user types
106
- * [Adding, Updating or Deleting Documents](https://docs.microsoft.com/rest/api/searchservice/addupdate-or-delete-documents) documents from an index
107
- * `SearchIndexClient` allows you to:
108
- * [Create, delete, update, or configure a search index](https://docs.microsoft.com/rest/api/searchservice/index-operations)
109
- * [Declare custom synonym maps to expand or rewrite queries](https://docs.microsoft.com/rest/api/searchservice/synonym-map-operations)
110
- * `SearchIndexerClient` allows you to:
111
- * [Start indexers to automatically crawl data sources](https://docs.microsoft.com/rest/api/searchservice/indexer-operations)
112
- * [Define AI powered Skillsets to transform and enrich your data](https://docs.microsoft.com/rest/api/searchservice/skillset-operations)
138
+ - `SearchClient` helps with:
139
+ - [Searching](https://docs.microsoft.com/azure/search/search-lucene-query-architecture) your indexed documents using [rich queries](https://docs.microsoft.com/azure/search/search-query-overview) and [powerful data shaping](https://docs.microsoft.com/azure/search/search-filters)
140
+ - [Autocompleting](https://docs.microsoft.com/rest/api/searchservice/autocomplete) partially typed search terms based on documents in the index
141
+ - [Suggesting](https://docs.microsoft.com/rest/api/searchservice/suggestions) the most likely matching text in documents as a user types
142
+ - [Adding, Updating or Deleting Documents](https://docs.microsoft.com/rest/api/searchservice/addupdate-or-delete-documents) documents from an index
143
+ - `SearchIndexClient` allows you to:
144
+ - [Create, delete, update, or configure a search index](https://docs.microsoft.com/rest/api/searchservice/index-operations)
145
+ - [Declare custom synonym maps to expand or rewrite queries](https://docs.microsoft.com/rest/api/searchservice/synonym-map-operations)
146
+ - `SearchIndexerClient` allows you to:
147
+ - [Start indexers to automatically crawl data sources](https://docs.microsoft.com/rest/api/searchservice/indexer-operations)
148
+ - [Define AI powered Skillsets to transform and enrich your data](https://docs.microsoft.com/rest/api/searchservice/skillset-operations)
113
149
 
114
150
  **Note**: These clients cannot function in the browser because the APIs it calls do not have support for Cross-Origin Resource Sharing (CORS).
115
151
 
116
152
  ## TypeScript/JavaScript specific concepts
153
+
117
154
  ### Documents
118
155
 
119
156
  An item stored inside a search index. The shape of this document is described in the index using `Field`s. Each Field has a name, a datatype, and additional metadata such as if it is searchable or filterable.
@@ -134,15 +171,15 @@ Typically you will only wish to [show a subset of search results](https://docs.m
134
171
 
135
172
  ## Examples
136
173
 
137
- The following examples demonstrate the basics - please [check out our samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/search/search-documents/samples) for much more.
174
+ The following examples demonstrate the basics - please [check out our samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/search/search-documents/samples) for much more.
138
175
 
139
- * [Creating an index](#create-an-index)
140
- * [Retrieving a specific document from your index](#retrieve-a-specific-document-from-an-index)
141
- * [Adding documents to your index](#adding-documents-into-an-index)
142
- * [Perform a search on documents](#perform-a-search-on-documents)
143
- * [Querying with TypeScript](#querying-with-typescript)
144
- * [Querying with OData filters](#querying-with-odata-filters)
145
- * [Querying with facets](#querying-with-facets)
176
+ - [Creating an index](#create-an-index)
177
+ - [Retrieving a specific document from your index](#retrieve-a-specific-document-from-an-index)
178
+ - [Adding documents to your index](#adding-documents-into-an-index)
179
+ - [Perform a search on documents](#perform-a-search-on-documents)
180
+ - [Querying with TypeScript](#querying-with-typescript)
181
+ - [Querying with OData filters](#querying-with-odata-filters)
182
+ - [Querying with facets](#querying-with-facets)
146
183
 
147
184
  ### Create an Index
148
185
 
@@ -414,18 +451,19 @@ import { setLogLevel } from "@azure/logger";
414
451
  setLogLevel("info");
415
452
  ```
416
453
 
417
- For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
454
+ For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).
418
455
 
419
456
  ## Next steps
420
- * [Go further with search-documents and our samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/search/search-documents/samples)
421
- * [Watch a demo or deep dive video](https://azure.microsoft.com/resources/videos/index/?services=search)
422
- * [Read more about the Azure Cognitive Search service](https://docs.microsoft.com/azure/search/search-what-is-azure-search)
457
+
458
+ - [Go further with search-documents and our samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/search/search-documents/samples)
459
+ - [Watch a demo or deep dive video](https://azure.microsoft.com/resources/videos/index/?services=search)
460
+ - [Read more about the Azure Cognitive Search service](https://docs.microsoft.com/azure/search/search-what-is-azure-search)
423
461
 
424
462
  ## Contributing
425
463
 
426
- If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
464
+ If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.
427
465
 
428
- This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [cla.microsoft.com][cla].
466
+ This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [cla.microsoft.com][cla].
429
467
 
430
468
  This project has adopted the [Microsoft Open Source Code of Conduct][coc].For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments.
431
469