Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

November Release Changes #18530

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/search/perf-tests/search-documents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "ISC",
"dependencies": {
"@azure/identity": "^2.0.1",
"@azure/search-documents": "11.3.0-beta.4",
"@azure/search-documents": "11.3.0-beta.5",
"@azure/test-utils-perf": "^1.0.0",
"dotenv": "^8.2.0"
},
Expand Down
12 changes: 11 additions & 1 deletion sdk/search/search-documents/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Release History

## 11.3.0-beta.4 (2021-10-05)
## 11.3.0-beta.5 (2021-11-09)

### Breaking Changes

- Renamed `IndexerCurrentState` property to `IndexerState` property.
- Renamed `AllDocsInitialChangeTrackingState` property to `AllDocumentsInitialChangeTrackingState` property.
- Renamed `AllDocsFinalChangeTrackingState` property to `AllDocumentsFinalChangeTrackingState` property.
- Renamed `ResetDocsInitialChangeTrackingState` property to `ResetDocumentsInitialChangeTrackingState` property.
- Renamed `ResetDocsFinalChangeTrackingState` property to `ResetDocumentsFinalChangeTrackingState` property.
- Renamed `SkillNames` property to `ResetSkillsOptions` (with a `SkillNames` property)
- Renamed `ResetDocs` method to `ResetDocuments` in the SDK client.

### Features Added

Expand Down
2 changes: 1 addition & 1 deletion sdk/search/search-documents/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure/search-documents",
"version": "11.3.0-beta.4",
"version": "11.3.0-beta.5",
"description": "Azure client library to use Cognitive Search for node.js and browser.",
"sdk-type": "client",
"main": "dist/index.js",
Expand Down
34 changes: 18 additions & 16 deletions sdk/search/search-documents/review/search-documents.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -629,23 +629,12 @@ export interface IndexDocumentsResult {
readonly results: IndexingResult[];
}

// @public
export interface IndexerCurrentState {
readonly allDocsFinalChangeTrackingState?: string;
readonly allDocsInitialChangeTrackingState?: string;
readonly mode?: IndexingMode;
readonly resetDatasourceDocumentIds?: string[];
readonly resetDocsFinalChangeTrackingState?: string;
readonly resetDocsInitialChangeTrackingState?: string;
readonly resetDocumentKeys?: string[];
}

// @public
export type IndexerExecutionEnvironment = string;

// @public
export interface IndexerExecutionResult {
readonly currentState?: IndexerCurrentState;
readonly currentState?: IndexerState;
readonly endTime?: Date;
readonly errorMessage?: string;
readonly errors: SearchIndexerError[];
Expand All @@ -665,6 +654,17 @@ export type IndexerExecutionStatus = "transientFailure" | "success" | "inProgres
// @public
export type IndexerExecutionStatusDetail = string;

// @public
export interface IndexerState {
readonly allDocumentsFinalChangeTrackingState?: string;
readonly allDocumentsInitialChangeTrackingState?: string;
readonly mode?: IndexingMode;
readonly resetDatasourceDocumentIds?: string[];
readonly resetDocumentKeys?: string[];
readonly resetDocumentsFinalChangeTrackingState?: string;
readonly resetDocumentsInitialChangeTrackingState?: string;
}

// @public
export type IndexerStatus = "unknown" | "error" | "running";

Expand Down Expand Up @@ -1677,7 +1677,7 @@ export type QueryType = "simple" | "full" | "semantic";
export type RegexFlags = string;

// @public
export interface ResetDocsOptions extends OperationOptions {
export interface ResetDocumentsOptions extends OperationOptions {
datasourceDocumentIds?: string[];
documentKeys?: string[];
overwrite?: boolean;
Expand All @@ -1687,7 +1687,9 @@ export interface ResetDocsOptions extends OperationOptions {
export type ResetIndexerOptions = OperationOptions;

// @public
export type ResetSkillsOptions = OperationOptions;
export interface ResetSkillsOptions extends OperationOptions {
skillNames?: string[];
}

// @public
export interface ResourceCounter {
Expand Down Expand Up @@ -1862,9 +1864,9 @@ export class SearchIndexerClient {
listIndexersNames(options?: ListIndexersOptions): Promise<Array<string>>;
listSkillsets(options?: ListSkillsetsOptions): Promise<Array<SearchIndexerSkillset>>;
listSkillsetsNames(options?: ListSkillsetsOptions): Promise<Array<string>>;
resetDocs(indexerName: string, options?: ResetDocsOptions): Promise<void>;
resetDocuments(indexerName: string, options?: ResetDocumentsOptions): Promise<void>;
resetIndexer(indexerName: string, options?: ResetIndexerOptions): Promise<void>;
resetSkills(skillsetName: string, skillNames: string[], options?: ResetSkillsOptions): Promise<void>;
resetSkills(skillsetName: string, options?: ResetSkillsOptions): Promise<void>;
runIndexer(indexerName: string, options?: RunIndexerOptions): Promise<void>;
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/search/search-documents/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

export const SDK_VERSION: string = "11.3.0-beta.4";
export const SDK_VERSION: string = "11.3.0-beta.5";
10 changes: 5 additions & 5 deletions sdk/search/search-documents/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@ export {
SearchIndexer,
LexicalNormalizer,
SearchIndexerDataIdentity,
ResetDocsOptions,
ResetSkillsOptions
ResetDocumentsOptions,
ResetSkillsOptions,
SearchIndexerStatus,
IndexerExecutionResult,
IndexerState
} from "./serviceModels";
export { default as GeographyPoint } from "./geographyPoint";
export { odata } from "./odata";
Expand Down Expand Up @@ -258,8 +261,6 @@ export {
IndexingParameters,
IndexingSchedule,
FieldMappingFunction,
SearchIndexerStatus,
IndexerExecutionResult,
SearchIndexerLimits,
IndexerStatus,
SearchIndexerError,
Expand Down Expand Up @@ -321,7 +322,6 @@ export {
KnownLineEnding,
SearchIndexerDataIdentity as BaseSearchIndexerDataIdentity,
SearchIndexerCache,
IndexerCurrentState,
IndexerExecutionStatusDetail,
KnownIndexerExecutionStatusDetail,
IndexingMode,
Expand Down
25 changes: 14 additions & 11 deletions sdk/search/search-documents/src/searchIndexerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { CommonClientOptions, InternalClientPipelineOptions } from "@azure/core-
import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline";
import { SpanStatusCode } from "@azure/core-tracing";
import { SDK_VERSION } from "./constants";
import { SearchIndexerStatus } from "./generated/service/models";
import { SearchServiceClient as GeneratedClient } from "./generated/service/searchServiceClient";
import { logger } from "./logger";
import { createSearchApiKeyCredentialPolicy } from "./searchApiKeyCredentialPolicy";
Expand All @@ -32,8 +31,9 @@ import {
DeleteDataSourceConnectionOptions,
GetDataSourceConnectionOptions,
CreateorUpdateDataSourceConnectionOptions,
ResetDocsOptions,
ResetSkillsOptions
ResetDocumentsOptions,
ResetSkillsOptions,
SearchIndexerStatus
} from "./serviceModels";
import * as utils from "./serviceUtils";
import { createSpan } from "./tracing";
Expand Down Expand Up @@ -676,7 +676,7 @@ export class SearchIndexerClient {
const { span, updatedOptions } = createSpan("SearchIndexerClient-getIndexerStatus", options);
try {
const result = await this.client.indexers.getStatus(indexerName, updatedOptions);
return result;
return utils.generatedIndexerStatusToPublicIndexerStatus(result);
} catch (e) {
span.setStatus({
code: SpanStatusCode.ERROR,
Expand Down Expand Up @@ -733,7 +733,10 @@ export class SearchIndexerClient {
* @param indexerName - The name of the indexer to reset documents for.
* @param options - Additional optional arguments.
*/
public async resetDocs(indexerName: string, options: ResetDocsOptions = {}): Promise<void> {
public async resetDocuments(
indexerName: string,
options: ResetDocumentsOptions = {}
): Promise<void> {
const { span, updatedOptions } = createSpan("SearchIndexerClient-resetDocs", options);
try {
await this.client.indexers.resetDocs(indexerName, {
Expand All @@ -760,14 +763,14 @@ export class SearchIndexerClient {
* @param skillNames - The names of skills to reset.
* @param options - The options parameters.
*/
public async resetSkills(
skillsetName: string,
skillNames: string[],
options: ResetSkillsOptions = {}
): Promise<void> {
public async resetSkills(skillsetName: string, options: ResetSkillsOptions = {}): Promise<void> {
const { span, updatedOptions } = createSpan("SearchIndexerClient-resetSkills", options);
try {
await this.client.skillsets.resetSkills(skillsetName, { skillNames }, updatedOptions);
await this.client.skillsets.resetSkills(
skillsetName,
{ skillNames: options.skillNames },
updatedOptions
);
} catch (e) {
span.setStatus({
code: SpanStatusCode.ERROR,
Expand Down
147 changes: 144 additions & 3 deletions sdk/search/search-documents/src/serviceModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,14 @@ import {
LexicalNormalizerName,
CustomNormalizer,
SearchIndexerKnowledgeStore,
SearchIndexerCache
SearchIndexerCache,
IndexingMode,
IndexerExecutionStatus,
IndexerExecutionStatusDetail,
SearchIndexerError,
SearchIndexerWarning,
IndexerStatus,
SearchIndexerLimits
} from "./generated/service/models";

import { PagedAsyncIterableIterator } from "@azure/core-paging";
Expand Down Expand Up @@ -240,7 +247,7 @@ export interface CreateOrUpdateIndexOptions extends OperationOptions {
/**
* Options for reset docs operation.
*/
export interface ResetDocsOptions extends OperationOptions {
export interface ResetDocumentsOptions extends OperationOptions {
/** document keys to be reset */
documentKeys?: string[];
/** datasource document identifiers to be reset */
Expand All @@ -249,10 +256,144 @@ export interface ResetDocsOptions extends OperationOptions {
overwrite?: boolean;
}

/** Represents the current status and execution history of an indexer. */
export interface SearchIndexerStatus {
/**
* Overall indexer status.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly status: IndexerStatus;
/**
* The result of the most recent or an in-progress indexer execution.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly lastResult?: IndexerExecutionResult;
/**
* History of the recent indexer executions, sorted in reverse chronological order.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly executionHistory: IndexerExecutionResult[];
/**
* The execution limits for the indexer.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly limits: SearchIndexerLimits;
}

/**
* Represents the result of an individual indexer execution.
*/
export interface IndexerExecutionResult {
/**
* The outcome of this indexer execution.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly status: IndexerExecutionStatus;
/**
* The outcome of this indexer execution.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly statusDetail?: IndexerExecutionStatusDetail;
/**
* All of the state that defines and dictates the indexer's current execution.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly currentState?: IndexerState;
/**
* The error message indicating the top-level error, if any.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly errorMessage?: string;
/**
* The start time of this indexer execution.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly startTime?: Date;
/**
* The end time of this indexer execution, if the execution has already completed.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly endTime?: Date;
/**
* The item-level indexing errors.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly errors: SearchIndexerError[];
/**
* The item-level indexing warnings.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly warnings: SearchIndexerWarning[];
/**
* The number of items that were processed during this indexer execution. This includes both successfully processed items and items where indexing was attempted but failed.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly itemCount: number;
/**
* The number of items that failed to be indexed during this indexer execution.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly failedItemCount: number;
/**
* Change tracking state with which an indexer execution started.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly initialTrackingState?: string;
/**
* Change tracking state with which an indexer execution finished.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly finalTrackingState?: string;
}

/**
* Represents all of the state that defines and dictates the indexer's current execution.
*/
export interface IndexerState {
/**
* The mode the indexer is running in.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly mode?: IndexingMode;
/**
* Change tracking state used when indexing starts on all documents in the datasource.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly allDocumentsInitialChangeTrackingState?: string;
/**
* Change tracking state value when indexing finishes on all documents in the datasource.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly allDocumentsFinalChangeTrackingState?: string;
/**
* Change tracking state used when indexing starts on select, reset documents in the datasource.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly resetDocumentsInitialChangeTrackingState?: string;
/**
* Change tracking state value when indexing finishes on select, reset documents in the datasource.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly resetDocumentsFinalChangeTrackingState?: string;
/**
* The list of document keys that have been reset. The document key is the document's unique identifier for the data in the search index. The indexer will prioritize selectively re-ingesting these keys.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly resetDocumentKeys?: string[];
/**
* The list of datasource document ids that have been reset. The datasource document id is the unique identifier for the data in the datasource. The indexer will prioritize selectively re-ingesting these ids.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly resetDatasourceDocumentIds?: string[];
}

/**
* Options for reset skills operation.
*/
export type ResetSkillsOptions = OperationOptions;
export interface ResetSkillsOptions extends OperationOptions {
/** the names of skills to be reset. */
skillNames?: string[];
}

/**
* Options for create/update skillset operation.
Expand Down
Loading