-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[@azure/search-documents] Commit Aliases Operations for Search Index Client #20658
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -273,6 +273,9 @@ export interface CorsOptions { | |
// @public | ||
export type CountDocumentsOptions = OperationOptions; | ||
|
||
// @public | ||
export type CreateAliasOptions = OperationOptions; | ||
|
||
// @public | ||
export type CreateDataSourceConnectionOptions = OperationOptions; | ||
|
||
|
@@ -282,6 +285,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; | ||
|
@@ -396,6 +404,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; | ||
|
@@ -557,6 +570,9 @@ export class GeographyPoint { | |
toJSON(): Record<string, unknown>; | ||
} | ||
|
||
// @public | ||
export type GetAliasOptions = OperationOptions; | ||
|
||
// @public | ||
export type GetDataSourceConnectionOptions = OperationOptions; | ||
|
||
|
@@ -1541,6 +1557,9 @@ export type LimitTokenFilter = BaseTokenFilter & { | |
// @public | ||
export type LineEnding = string; | ||
|
||
// @public | ||
export type ListAliasesOptions = OperationOptions; | ||
|
||
// @public | ||
export type ListDataSourceConnectionsOptions = OperationOptions; | ||
|
||
|
@@ -1809,6 +1828,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); | ||
|
@@ -1889,18 +1915,23 @@ export class SearchIndexClient { | |
analyzeText(indexName: string, options: AnalyzeTextOptions): Promise<AnalyzeResult>; | ||
// @deprecated | ||
readonly apiVersion: string; | ||
createAlias(alias: SearchIndexerAlias, options?: CreateAliasOptions): Promise<SearchIndexerAlias>; | ||
createIndex(index: SearchIndex, options?: CreateIndexOptions): Promise<SearchIndex>; | ||
createOrUpdateAlias(alias: SearchIndexerAlias, options?: CreateOrUpdateAliasOptions): Promise<SearchIndexerAlias>; | ||
createOrUpdateIndex(index: SearchIndex, options?: CreateOrUpdateIndexOptions): Promise<SearchIndex>; | ||
createOrUpdateSynonymMap(synonymMap: SynonymMap, options?: CreateOrUpdateSynonymMapOptions): Promise<SynonymMap>; | ||
createSynonymMap(synonymMap: SynonymMap, options?: CreateSynonymMapOptions): Promise<SynonymMap>; | ||
deleteAlias(alias: string | SearchIndexerAlias, 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<SearchIndexerAlias>; | ||
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): Promise<Array<SearchIndexerAlias>>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're sure we don't want an iterator for these? What are the limits of how many can be returned / exist on an account? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have modified the |
||
listIndexes(options?: ListIndexesOptions): IndexIterator; | ||
listIndexesNames(options?: ListIndexesOptions): IndexNameIterator; | ||
listSynonymMaps(options?: ListSynonymMapsOptions): Promise<Array<SynonymMap>>; | ||
|
@@ -1932,6 +1963,9 @@ export interface SearchIndexer { | |
targetIndexName: string; | ||
} | ||
|
||
// @public | ||
export type SearchIndexerAlias = SearchAlias; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why have both There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, it should be And both has to be exposed in the index file. Else, API Extractor will complain about a missing export. |
||
|
||
// @public (undocumented) | ||
export interface SearchIndexerCache { | ||
enableReprocessing?: boolean; | ||
|
@@ -2291,6 +2325,7 @@ export type SentimentSkillV3 = BaseSearchIndexerSkill & { | |
|
||
// @public | ||
export interface ServiceCounters { | ||
aliasCounter?: ResourceCounter; | ||
dataSourceCounter: ResourceCounter; | ||
documentCounter: ResourceCounter; | ||
indexCounter: ResourceCounter; | ||
|
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this has changed a few times but at least when I was adding an upsert-like operation to AKV we settled on
set
instead ofcreateOrUpdate
orupsert
(sosetAlias
in this case).I was also wondering: why is there both
createAlias
andcreateOrUpdateAlias
- doescreateAlias
throw if the alias already exists? Do we need both?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
search-documents
SDK, Yes. We have bothcreate
/createOrUpdate
operations for all entities such as Indexes, SynonymMaps, DataSourceConnections, etc. To be in sync with that and other language SDKs, the same policy is followed here.create
method will throw an error if the entity exists already.