Skip to content

Commit

Permalink
[@azure/search-documents] Commit Aliases Operations for Search Index …
Browse files Browse the repository at this point in the history
…Client (#20658)

* Commit Aliases Operations for Search Index Client

* Update Perf Dependency

* Fix Linter errors

* Response to PR Comments
  • Loading branch information
sarangan12 authored Mar 4, 2022
1 parent 1b009e2 commit b29e358
Show file tree
Hide file tree
Showing 20 changed files with 716 additions and 10 deletions.
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.6",
"@azure/search-documents": "11.3.0-beta.7",
"@azure/test-utils-perf": "^1.0.0",
"dotenv": "^8.2.0"
},
Expand Down
6 changes: 6 additions & 0 deletions sdk/search/search-documents/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 11.3.0-beta.7 (2022-03-08)

### Features Added

- Added new APIs `createAlias`, `createOrUpdateAlias`, `deleteAlias`, `getAlias` & `listAliases` operations to the `SearchIndexClient`.

## 11.3.0-beta.6 (2022-02-08)

### 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.6",
"version": "11.3.0-beta.7",
"description": "Azure client library to use Cognitive Search for node.js and browser.",
"sdk-type": "client",
"main": "dist/index.js",
Expand Down
38 changes: 38 additions & 0 deletions sdk/search/search-documents/review/search-documents.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import { PagedAsyncIterableIterator } from '@azure/core-paging';
import { RestError } from '@azure/core-rest-pipeline';
import { TokenCredential } from '@azure/core-auth';

// @public
export type AliasIterator = PagedAsyncIterableIterator<SearchIndexAlias, SearchIndexAlias[], {}>;

// @public
export interface AnalyzedTokenInfo {
readonly endOffset: number;
Expand Down Expand Up @@ -273,6 +276,9 @@ export interface CorsOptions {
// @public
export type CountDocumentsOptions = OperationOptions;

// @public
export type CreateAliasOptions = OperationOptions;

// @public
export type CreateDataSourceConnectionOptions = OperationOptions;

Expand All @@ -282,6 +288,11 @@ export type CreateIndexerOptions = OperationOptions;
// @public
export type CreateIndexOptions = OperationOptions;

// @public
export interface CreateOrUpdateAliasOptions extends OperationOptions {
onlyIfUnchanged?: boolean;
}

// @public
export interface CreateorUpdateDataSourceConnectionOptions extends OperationOptions {
onlyIfUnchanged?: boolean;
Expand Down Expand Up @@ -396,6 +407,11 @@ export type DefaultCognitiveServicesAccount = BaseCognitiveServicesAccount & {
odatatype: "#Microsoft.Azure.Search.DefaultCognitiveServices";
};

// @public
export interface DeleteAliasOptions extends OperationOptions {
onlyIfUnchanged?: boolean;
}

// @public
export interface DeleteDataSourceConnectionOptions extends OperationOptions {
onlyIfUnchanged?: boolean;
Expand Down Expand Up @@ -557,6 +573,9 @@ export class GeographyPoint {
toJSON(): Record<string, unknown>;
}

// @public
export type GetAliasOptions = OperationOptions;

// @public
export type GetDataSourceConnectionOptions = OperationOptions;

Expand Down Expand Up @@ -1541,6 +1560,9 @@ export type LimitTokenFilter = BaseTokenFilter & {
// @public
export type LineEnding = string;

// @public
export type ListAliasesOptions = OperationOptions;

// @public
export type ListDataSourceConnectionsOptions = OperationOptions;

Expand Down Expand Up @@ -1809,6 +1831,13 @@ export interface ScoringProfile {
// @public
export type ScoringStatistics = "local" | "global";

// @public
export interface SearchAlias {
etag?: string;
indexes: string[];
name: string;
}

// @public
export class SearchClient<T> implements IndexDocumentsClient<T> {
constructor(endpoint: string, indexName: string, credential: KeyCredential | TokenCredential, options?: SearchClientOptions);
Expand Down Expand Up @@ -1883,24 +1912,32 @@ export interface SearchIndex {
tokenizers?: LexicalTokenizer[];
}

// @public
export type SearchIndexAlias = SearchAlias;

// @public
export class SearchIndexClient {
constructor(endpoint: string, credential: KeyCredential | TokenCredential, options?: SearchIndexClientOptions);
analyzeText(indexName: string, options: AnalyzeTextOptions): Promise<AnalyzeResult>;
// @deprecated
readonly apiVersion: string;
createAlias(alias: SearchIndexAlias, options?: CreateAliasOptions): Promise<SearchIndexAlias>;
createIndex(index: SearchIndex, options?: CreateIndexOptions): Promise<SearchIndex>;
createOrUpdateAlias(alias: SearchIndexAlias, options?: CreateOrUpdateAliasOptions): Promise<SearchIndexAlias>;
createOrUpdateIndex(index: SearchIndex, options?: CreateOrUpdateIndexOptions): Promise<SearchIndex>;
createOrUpdateSynonymMap(synonymMap: SynonymMap, options?: CreateOrUpdateSynonymMapOptions): Promise<SynonymMap>;
createSynonymMap(synonymMap: SynonymMap, options?: CreateSynonymMapOptions): Promise<SynonymMap>;
deleteAlias(alias: string | SearchIndexAlias, options?: DeleteAliasOptions): Promise<void>;
deleteIndex(index: string | SearchIndex, options?: DeleteIndexOptions): Promise<void>;
deleteSynonymMap(synonymMap: string | SynonymMap, options?: DeleteSynonymMapOptions): Promise<void>;
readonly endpoint: string;
getAlias(aliasName: string, options?: GetAliasOptions): Promise<SearchIndexAlias>;
getIndex(indexName: string, options?: GetIndexOptions): Promise<SearchIndex>;
getIndexStatistics(indexName: string, options?: GetIndexStatisticsOptions): Promise<SearchIndexStatistics>;
getSearchClient<T>(indexName: string, options?: SearchClientOptions): SearchClient<T>;
getServiceStatistics(options?: GetServiceStatisticsOptions): Promise<SearchServiceStatistics>;
getSynonymMap(synonymMapName: string, options?: GetSynonymMapsOptions): Promise<SynonymMap>;
listAliases(options?: ListAliasesOptions): AliasIterator;
listIndexes(options?: ListIndexesOptions): IndexIterator;
listIndexesNames(options?: ListIndexesOptions): IndexNameIterator;
listSynonymMaps(options?: ListSynonymMapsOptions): Promise<Array<SynonymMap>>;
Expand Down Expand Up @@ -2291,6 +2328,7 @@ export type SentimentSkillV3 = BaseSearchIndexerSkill & {

// @public
export interface ServiceCounters {
aliasCounter?: ResourceCounter;
dataSourceCounter: ResourceCounter;
documentCounter: ResourceCounter;
indexCounter: ResourceCounter;
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.6";
export const SDK_VERSION: string = "11.3.0-beta.7";

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 75 additions & 0 deletions sdk/search/search-documents/src/generated/service/models/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b29e358

Please sign in to comment.