Skip to content

Commit

Permalink
[Search] Merge samples and changelog for 2024-07 GA release (#30514)
Browse files Browse the repository at this point in the history
### Packages impacted by this PR

@azure/search-documents

### Describe the problem that is addressed by this PR

Adds sample and changelog changes from the GA branch for 2024-07 release
#30494

### Checklists
- [x] Added impacted package name to the issue description
  • Loading branch information
dgetu authored Jul 24, 2024
1 parent 3a68e45 commit 8ab8eda
Show file tree
Hide file tree
Showing 32 changed files with 595 additions and 334 deletions.
117 changes: 117 additions & 0 deletions sdk/search/search-documents/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Release History

## 12.1.0 (2024-07-24)

### Features Added

- Added support for text queries against vector fields [#30494](https://github.com/Azure/azure-sdk-for-js/pull/29597)
- Create text queries against vector fields with the `VectorizedTextQuery` variant of `VectorQuery`. Such queries are supported by configuring the corresponding index field with a `VectorSearchVectorizer`. This configuration describes a delegate, which the service uses to generate vector embeddings for the query text.
- Added `AzureOpenAIEmbeddingSkill` to allow for `SearchIndexer`s to populate embedding fields at index-time.
- Added index configuration for vector quantization through `VectorSearchCompression`

### Bugs Fixed

- Improved serialization performance on large payloads [#29597](https://github.com/Azure/azure-sdk-for-js/pull/29597)

### Note

- This GA release introduces bug fixes, convenience improvements, and select features from prior beta releases. Except for the features listed in these release notes, no preview features are being pulled into this release.

## 12.1.0-beta.2 (2024-05-20)

### Breaking Changes
Expand Down Expand Up @@ -114,6 +131,61 @@
- Add non-persistent vector usage through `SimpleField.stored` [#28772](https://github.com/Azure/azure-sdk-for-js/pull/28772)
- Expose the internal HTTP pipeline to allow users to send raw requests with it

## 12.0.0 (2023-11-13)

### Features Added

- Added support for vector search
- Added support for semantic search and reranking
- New `SearchIndexerSkill`s
- `EntityLinkingSkill`
- `EntityRecognitionSkillV3`
- `PIIDetectionSkill`
- `SentimentSkillV3`

### Breaking Changes

- Minor type changes
- All nullable optional properties can no longer be assigned `null`. Use `undefined` instead.
- Updated specific property types for enhanced precision, replacing `any` with more defined types.
- Narrowed some enum property types to the respective string literal union
- `BlobIndexerDataToExtract`
- `BlobIndexerImageAction`
- `BlobIndexerParsingMode`
- `BlobIndexerPDFTextRotationAlgorithm`
- `CustomEntityLookupSkillLanguage`
- `EntityCategory`
- `EntityRecognitionSkillLanguage`
- `ImageAnalysisSkillLanguage`
- `ImageDetail`
- `IndexerExecutionEnvironment`
- `KeyPhraseExtractionSkillLanguage`
- `OcrSkillLanguage`
- `RegexFlags`
- `SearchIndexerDataSourceType`
- `SentimentSkillLanguage`
- `SplitSkillLanguage`
- `TextSplitMode`
- `TextTranslationSkillLanguage`
- `VisualFeature`
- Removed `KnownLexicalAnalyzerName` as a duplicate of `KnownAnalyzerNames`
- Removed `KnownCharFilterName` as a duplicate of `KnownCharFilterNames`
- Removed `KnownTokenFilterName` as a duplicate of `KnownTokenFilterNames`
- Removed `SearchRequest` as a duplicate of `SearchRequestOptions`
- Added type narrowing for response types based on `select`ed fields
- For types that are generic on a model type, the model type is now constrained to extend `object`

### Other Changes

- Deprecated `apiVersion` in favor of `serviceVersion` in clients:
- `SearchClient`
- `SearchIndexClient`
- `SearchIndexerClient`

### Note

- This GA release introduces bug fixes, convenience improvements, and select features from prior beta releases. Except for the features listed in these release notes, no preview features are being pulled into this release.

## 12.0.0-beta.4 (2023-10-11)

### Features Added
Expand All @@ -130,6 +202,12 @@
- `SearchField.vectorSearchConfiguration` has been abstracted into `SearchField.vectorSearchProfile` [#27338](https://github.com/Azure/azure-sdk-for-js/pull/27338)
- `VectorSearch.algorithmConfiguration` has been renamed to `VectorSearch.algorithms` [#27338](https://github.com/Azure/azure-sdk-for-js/pull/27338)

## 11.3.3 (2023-09-27)

### Bugs Fixed

- Fix some `SearchIndex` fields being improperly serialized.[#27238](https://github.com/Azure/azure-sdk-for-js/pull/27238)

## 12.0.0-beta.3 (2023-08-10)

### Features Added
Expand All @@ -153,6 +231,20 @@
- Fix all clients adding one or more duplicate user agents. [#26298](https://github.com/Azure/azure-sdk-for-js/pull/26298)
- Fix serializerOptions and onResponse options for SearchClient methods. [#26327](https://github.com/Azure/azure-sdk-for-js/pull/26327)

## 11.3.2 (2023-06-06)

### Bugs Fixed

- Fix ISO8601 deserialization. [#25802](https://github.com/Azure/azure-sdk-for-js/pull/25802)
- Fix all clients adding one or more duplicate user agents. [#26298](https://github.com/Azure/azure-sdk-for-js/pull/26298)
- Fix `serializerOptions` and `onResponse` options for SearchClient methods. [#26327](https://github.com/Azure/azure-sdk-for-js/pull/26327)
- Fix discarded user-defined `onResponse` callback. [#24479](https://github.com/Azure/azure-sdk-for-js/pull/24479)
- Fix type error on `select` statement with nested fields. [#26407](https://github.com/Azure/azure-sdk-for-js/pull/26407)

### Other Changes

- Add deprecation warning to `EntityRecognitionSkill` and `SentimentSkill` [#25686](https://github.com/Azure/azure-sdk-for-js/pull/25686)

## 12.0.0-beta.1 (2023-05-09)

### Features Added
Expand Down Expand Up @@ -201,6 +293,31 @@

- Add deprecation warning to `EntityRecognitionSkill` and `SentimentSkill` [#25686](https://github.com/Azure/azure-sdk-for-js/pull/25686)

## 11.3.1 (2022-11-18)

### Bugs Fixed

- Addressed an issue where `similarity` settings on indexes wouldn't populate correctly. See [#23811](https://github.com/Azure/azure-sdk-for-js/issues/23811)

## 11.3.0 (2022-09-06)

### Features Added

- Enabled national cloud support for Azure Search SDK. Please refer [#22887](https://github.com/Azure/azure-sdk-for-js/pull/22887) for further details.
- Support for TokenCredential has been added. With this addition, the Search SDK supports authentication via AAD.

### Bugs Fixed

- 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.
- Fixed the typos `anayzerName` to `analyzerName` in `convertFieldsToPublic` method of `serviceUtils.ts`.
- 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.

### Note

- 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.

- Add deprecation warning to `EntityRecognitionSkill` and `SentimentSkill` [#25686](https://github.com/Azure/azure-sdk-for-js/pull/25686)

## 11.3.0-beta.8 (2022-09-06)

- Added `core-http-compat` dependency
Expand Down
28 changes: 15 additions & 13 deletions sdk/search/search-documents/samples/v12/javascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ urlFragment: search-documents-javascript

These sample programs show how to use the JavaScript client libraries for Azure Search Documents in some common scenarios.

| **File Name** | **Description** |
| ------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| [bufferedSenderAutoFlushSize.js][bufferedsenderautoflushsize] | Demonstrates the SearchIndexingBufferedSender with Autoflush based on size. |
| [bufferedSenderAutoFlushTimer.js][bufferedsenderautoflushtimer] | Demonstrates the SearchIndexingBufferedSender with Autoflush based on timer. |
| [bufferedSenderManualFlush.js][bufferedsendermanualflush] | Demonstrates the SearchIndexingBufferedSender with Manual Flush. |
| [dataSourceConnectionOperations.js][datasourceconnectionoperations] | Demonstrates the DataSource Connection Operations. |
| [indexOperations.js][indexoperations] | Demonstrates the Index Operations. |
| [indexerOperations.js][indexeroperations] | Demonstrates the Indexer Operations. |
| [searchClientOperations.js][searchclientoperations] | Demonstrates the SearchClient. |
| [skillSetOperations.js][skillsetoperations] | Demonstrates the Skillset Operations. |
| [synonymMapOperations.js][synonymmapoperations] | Demonstrates the SynonymMap Operations. |
| [vectorSearch.js][vectorsearch] | Demonstrates vector search |
| **File Name** | **Description** |
| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| [bufferedSenderAutoFlushSize.js][bufferedsenderautoflushsize] | Demonstrates the SearchIndexingBufferedSender with Autoflush based on size. |
| [bufferedSenderAutoFlushTimer.js][bufferedsenderautoflushtimer] | Demonstrates the SearchIndexingBufferedSender with Autoflush based on timer. |
| [bufferedSenderManualFlush.js][bufferedsendermanualflush] | Demonstrates the SearchIndexingBufferedSender with Manual Flush. |
| [dataSourceConnectionOperations.js][datasourceconnectionoperations] | Demonstrates the DataSource Connection Operations. |
| [indexOperations.js][indexoperations] | Demonstrates the Index Operations. |
| [indexerOperations.js][indexeroperations] | Demonstrates the Indexer Operations. |
| [searchClientOperations.js][searchclientoperations] | Demonstrates the SearchClient. |
| [skillSetOperations.js][skillsetoperations] | Demonstrates the Skillset Operations. |
| [stickySession.js][stickysession] | Demonstrates user sticky sessions, a way to reduce inconsistent behavior by targeting a single replica. |
| [synonymMapOperations.js][synonymmapoperations] | Demonstrates the SynonymMap Operations. |
| [vectorSearch.js][vectorsearch] | Demonstrates vector search |

## Prerequisites

Expand Down Expand Up @@ -59,7 +60,7 @@ node bufferedSenderAutoFlushSize.js
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):

```bash
npx cross-env ENDPOINT="<endpoint>" SEARCH_API_ADMIN_KEY="<search api admin key>" node bufferedSenderAutoFlushSize.js
npx cross-env ENDPOINT="<endpoint>" node bufferedSenderAutoFlushSize.js
```

## Next Steps
Expand All @@ -74,6 +75,7 @@ Take a look at our [API Documentation][apiref] for more information about the AP
[indexeroperations]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/search-documents/samples/v12/javascript/indexerOperations.js
[searchclientoperations]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/search-documents/samples/v12/javascript/searchClientOperations.js
[skillsetoperations]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/search-documents/samples/v12/javascript/skillSetOperations.js
[stickysession]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/search-documents/samples/v12/javascript/stickySession.js
[synonymmapoperations]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/search-documents/samples/v12/javascript/synonymMapOperations.js
[vectorsearch]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/search/search-documents/samples/v12/javascript/vectorSearch.js
[apiref]: https://docs.microsoft.com/javascript/api/@azure/search-documents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
* @summary Demonstrates the SearchIndexingBufferedSender with Autoflush based on size.
*/

const { DefaultAzureCredential } = require("@azure/identity");
const {
SearchIndexingBufferedSender,
AzureKeyCredential,
SearchClient,
GeographyPoint,
SearchClient,
SearchIndexClient,
SearchIndexingBufferedSender,
} = require("@azure/search-documents");
const { createIndex, documentKeyRetriever, WAIT_TIME, delay } = require("./setup");
const { createIndex, delay, documentKeyRetriever, WAIT_TIME } = require("./setup");

require("dotenv").config();

Expand All @@ -24,7 +24,6 @@ require("dotenv").config();
* by default.
*/
const endpoint = process.env.ENDPOINT || "";
const apiKey = process.env.SEARCH_API_ADMIN_KEY || "";
const TEST_INDEX_NAME = "example-index-sample-4";

function getDocumentsArray(size) {
Expand Down Expand Up @@ -57,14 +56,14 @@ function getDocumentsArray(size) {
}

async function main() {
if (!endpoint || !apiKey) {
console.log("Make sure to set valid values for endpoint and apiKey with proper authorization.");
if (!endpoint) {
console.log("Be sure to set a valid endpoint with proper authorization.");
return;
}

console.log(`Running SearchIndexingBufferedSender-uploadDocuments-With Auto Flush Sizes Sample`);

const credential = new AzureKeyCredential(apiKey);
const credential = new DefaultAzureCredential();
const searchClient = new SearchClient(endpoint, TEST_INDEX_NAME, credential);
const indexClient = new SearchIndexClient(endpoint, credential);

Expand Down Expand Up @@ -95,7 +94,7 @@ async function main() {
});

const documents = getDocumentsArray(1001);
bufferedClient.uploadDocuments(documents);
await bufferedClient.uploadDocuments(documents);

await delay(WAIT_TIME);

Expand All @@ -112,7 +111,6 @@ async function main() {
} finally {
await indexClient.deleteIndex(TEST_INDEX_NAME);
}
await delay(WAIT_TIME);
}

main();
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
* @summary Demonstrates the SearchIndexingBufferedSender with Autoflush based on timer.
*/

const { DefaultAzureCredential } = require("@azure/identity");
const {
SearchIndexingBufferedSender,
AzureKeyCredential,
SearchClient,
DEFAULT_FLUSH_WINDOW,
GeographyPoint,
SearchClient,
SearchIndexClient,
DEFAULT_FLUSH_WINDOW,
SearchIndexingBufferedSender,
} = require("@azure/search-documents");
const { createIndex, documentKeyRetriever, WAIT_TIME, delay } = require("./setup");
const { createIndex, delay, documentKeyRetriever, WAIT_TIME } = require("./setup");

require("dotenv").config();

Expand All @@ -25,18 +25,17 @@ require("dotenv").config();
* by default.
*/
const endpoint = process.env.ENDPOINT || "";
const apiKey = process.env.SEARCH_API_ADMIN_KEY || "";
const TEST_INDEX_NAME = "example-index-sample-5";

async function main() {
if (!endpoint || !apiKey) {
console.log("Make sure to set valid values for endpoint and apiKey with proper authorization.");
if (!endpoint) {
console.log("Be sure to set a valid endpoint with proper authorization.");
return;
}

console.log(`Running SearchIndexingBufferedSender-uploadDocuments-With Auto Flush Timer Sample`);

const credential = new AzureKeyCredential(apiKey);
const credential = new DefaultAzureCredential();
const searchClient = new SearchClient(endpoint, TEST_INDEX_NAME, credential);
const indexClient = new SearchIndexClient(endpoint, credential);

Expand Down Expand Up @@ -66,7 +65,7 @@ async function main() {
console.log(response);
});

bufferedClient.uploadDocuments([
await bufferedClient.uploadDocuments([
{
hotelId: "1",
description:
Expand Down Expand Up @@ -102,7 +101,6 @@ async function main() {
} finally {
await indexClient.deleteIndex(TEST_INDEX_NAME);
}
await delay(WAIT_TIME);
}

main();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
* @summary Demonstrates the SearchIndexingBufferedSender with Manual Flush.
*/

const { DefaultAzureCredential } = require("@azure/identity");
const {
SearchIndexingBufferedSender,
AzureKeyCredential,
SearchClient,
GeographyPoint,
SearchClient,
SearchIndexClient,
SearchIndexingBufferedSender,
} = require("@azure/search-documents");
const { createIndex, documentKeyRetriever, WAIT_TIME, delay } = require("./setup");
const { createIndex, delay, documentKeyRetriever, WAIT_TIME } = require("./setup");

require("dotenv").config();

Expand All @@ -22,18 +22,17 @@ require("dotenv").config();
* wants to call the flush manually.
*/
const endpoint = process.env.ENDPOINT || "";
const apiKey = process.env.SEARCH_API_ADMIN_KEY || "";
const TEST_INDEX_NAME = "example-index-sample-6";

async function main() {
if (!endpoint || !apiKey) {
console.log("Make sure to set valid values for endpoint and apiKey with proper authorization.");
if (!endpoint) {
console.log("Be sure to set a valid endpoint with proper authorization.");
return;
}

console.log(`Running SearchIndexingBufferedSender-uploadDocuments-Without AutoFlush Sample`);

const credential = new AzureKeyCredential(apiKey);
const credential = new DefaultAzureCredential();
const searchClient = new SearchClient(endpoint, TEST_INDEX_NAME, credential);
const indexClient = new SearchIndexClient(endpoint, credential);

Expand Down
Loading

0 comments on commit 8ab8eda

Please sign in to comment.