SearchIndexClient class
Class to perform operations to manage (create, update, list/delete) indexes, & synonymmaps.
Constructors
| Search |
Creates an instance of SearchIndexClient. Example usage:
|
Properties
| api |
The API version to use when communicating with the service. |
| endpoint | The endpoint of the search service |
| pipeline | A reference to the internal HTTP pipeline for use with raw requests |
| service |
The API version to use when communicating with the service. |
Methods
| analyze |
Calls an analyzer or tokenizer manually on provided text. |
| create |
Creates a new search alias. |
| create |
Creates a new index. |
| create |
Creates a new knowledgebase. |
| create |
Creates a new knowledge source. |
| create |
Creates a new search alias or updates an alias if it already exists. |
| create |
Creates a new index or modifies an existing one. |
| create |
Creates a new knowledge base or updates a knowledge base if it already exists. |
| create |
|
| create |
Creates a new SynonymMap or modifies an existing one. |
| create |
Creates a new SynonymMap in a search service. |
| delete |
Deletes a search alias and its associated mapping to an index. This operation is permanent, with no recovery option. The mapped index is untouched by this operation. |
| delete |
Deletes a search alias and its associated mapping to an index. This operation is permanent, with no recovery option. The mapped index is untouched by this operation. |
| delete |
Deletes an existing index. |
| delete |
Deletes an existing index. |
| delete |
Deletes an existing knowledge base. |
| delete |
Deletes an existing knowledge base. |
| delete |
Deletes an existing source. |
| delete |
Deletes an existing source. |
| delete |
Deletes an existing SynonymMap. |
| get |
Retrieves an alias definition. |
| get |
Retrieves information about an index. |
| get |
Retrieves statistics about an index, such as the count of documents and the size of index storage. |
| get |
Retrieves a list of existing indexes in the service. |
| get |
Retrieves a knowledge base definition. |
| get |
Retrieves the KnowledgeRetrievalClient corresponding to this SearchIndexClient |
| get |
Retrieves a knowledge source definition. |
| get |
Returns the current status and synchronization history of a knowledge source. |
| get |
Retrieves the SearchClient corresponding to this SearchIndexClient |
| get |
Retrieves statistics about the service, such as the count of documents, index, etc. |
| get |
Retrieves information about a SynonymMap. |
| list |
Lists all aliases available for a search service. |
| list |
Retrieves a list of existing indexes in the service. |
| list |
Retrieves a list of names of existing indexes in the service. |
| list |
Retrieves a list of existing KnowledgeBases in the service. |
| list |
Retrieves a list of existing KnowledgeSources in the service. |
| list |
Retrieves a list of existing SynonymMaps in the service. |
| list |
Retrieves a list of names of existing SynonymMaps in the service. |
Constructor Details
SearchIndexClient(string, KeyCredential | TokenCredential, SearchIndexClientOptions)
Creates an instance of SearchIndexClient.
Example usage:
import { SearchIndexClient, AzureKeyCredential } from "@azure/search-documents";
const indexClient = new SearchIndexClient("<endpoint>", new AzureKeyCredential("<apiKey>"));
new SearchIndexClient(endpoint: string, credential: KeyCredential | TokenCredential, options?: SearchIndexClientOptions)
Parameters
- endpoint
-
string
The endpoint of the search service
- credential
Used to authenticate requests to the service.
- options
- SearchIndexClientOptions
Used to configure the Search Index client.
Property Details
apiVersion
Warning
This API is now deprecated.
use {@Link serviceVersion} instead
The API version to use when communicating with the service.
apiVersion: string
Property Value
string
endpoint
The endpoint of the search service
endpoint: string
Property Value
string
pipeline
A reference to the internal HTTP pipeline for use with raw requests
pipeline: Pipeline
Property Value
serviceVersion
The API version to use when communicating with the service.
serviceVersion: string
Property Value
string
Method Details
analyzeText(string, AnalyzeTextOptions)
Calls an analyzer or tokenizer manually on provided text.
function analyzeText(indexName: string, options: AnalyzeTextOptions): Promise<AnalyzeResult>
Parameters
- indexName
-
string
The name of the index that contains the field to analyze
- options
- AnalyzeTextOptions
Additional arguments
Returns
Promise<AnalyzeResult>
createAlias(SearchAlias, OperationOptions)
Creates a new search alias.
function createAlias(alias: SearchAlias, options?: OperationOptions): Promise<SearchAlias>
Parameters
- alias
- SearchAlias
The definition of the alias to create.
- options
- OperationOptions
The options parameters.
Returns
Promise<SearchAlias>
createIndex(SearchIndex, OperationOptions)
Creates a new index.
function createIndex(index: SearchIndex, options?: OperationOptions): Promise<SearchIndex>
Parameters
- index
- SearchIndex
The information describing the index to be created.
- options
- OperationOptions
Additional optional arguments.
Returns
Promise<SearchIndex>
createKnowledgeBase(KnowledgeBase, CreateKnowledgeBaseOptions)
Creates a new knowledgebase.
function createKnowledgeBase(knowledgeBase: KnowledgeBase, options?: CreateKnowledgeBaseOptions): Promise<KnowledgeBase>
Parameters
- knowledgeBase
- KnowledgeBase
definition of the knowledgebase to create.
- options
- CreateKnowledgeBaseOptions
options parameters.
Returns
Promise<KnowledgeBase>
createKnowledgeSource(KnowledgeSource, CreateKnowledgeSourceOptions)
Creates a new knowledge source.
function createKnowledgeSource(knowledgeSource: KnowledgeSource, options?: CreateKnowledgeSourceOptions): Promise<KnowledgeSource>
Parameters
- knowledgeSource
- KnowledgeSource
The definition of the knowledge source to create.
- options
- CreateKnowledgeSourceOptions
The options parameters.
Returns
Promise<KnowledgeSource>
createOrUpdateAlias(SearchAlias, CreateOrUpdateAliasOptions)
Creates a new search alias or updates an alias if it already exists.
function createOrUpdateAlias(alias: SearchAlias, options?: CreateOrUpdateAliasOptions): Promise<SearchAlias>
Parameters
- alias
- SearchAlias
The definition of the alias to create or update.
- options
- CreateOrUpdateAliasOptions
The options parameters.
Returns
Promise<SearchAlias>
createOrUpdateIndex(SearchIndex, CreateOrUpdateIndexOptions)
Creates a new index or modifies an existing one.
function createOrUpdateIndex(index: SearchIndex, options?: CreateOrUpdateIndexOptions): Promise<SearchIndex>
Parameters
- index
- SearchIndex
The information describing the index to be created.
- options
- CreateOrUpdateIndexOptions
Additional optional arguments.
Returns
Promise<SearchIndex>
createOrUpdateKnowledgeBase(string, KnowledgeBase, CreateOrUpdateKnowledgeBaseOptions)
Creates a new knowledge base or updates a knowledge base if it already exists.
function createOrUpdateKnowledgeBase(knowledgeBaseName: string, knowledgeBase: KnowledgeBase, options?: CreateOrUpdateKnowledgeBaseOptions): Promise<KnowledgeBase>
Parameters
- knowledgeBaseName
-
string
name of the knowledge base to create or update.
- knowledgeBase
- KnowledgeBase
definition of the knowledge base to create or update.
options parameters.
Returns
Promise<KnowledgeBase>
createOrUpdateKnowledgeSource(string, KnowledgeSource, CreateOrUpdateKnowledgeSourceOptions)
function createOrUpdateKnowledgeSource(sourceName: string, knowledgeSource: KnowledgeSource, options?: CreateOrUpdateKnowledgeSourceOptions): Promise<KnowledgeSource>
Parameters
- sourceName
-
string
- knowledgeSource
- KnowledgeSource
Returns
Promise<KnowledgeSource>
createOrUpdateSynonymMap(SynonymMap, CreateOrUpdateSynonymMapOptions)
Creates a new SynonymMap or modifies an existing one.
function createOrUpdateSynonymMap(synonymMap: SynonymMap, options?: CreateOrUpdateSynonymMapOptions): Promise<SynonymMap>
Parameters
- synonymMap
- SynonymMap
The information describing the SynonymMap to be created.
- options
- CreateOrUpdateSynonymMapOptions
Additional optional arguments.
Returns
Promise<SynonymMap>
createSynonymMap(SynonymMap, OperationOptions)
Creates a new SynonymMap in a search service.
function createSynonymMap(synonymMap: SynonymMap, options?: OperationOptions): Promise<SynonymMap>
Parameters
- synonymMap
- SynonymMap
The synonymMap definition to create in a search service.
- options
- OperationOptions
Additional optional arguments.
Returns
Promise<SynonymMap>
deleteAlias(SearchAlias, DeleteAliasOptions)
Deletes a search alias and its associated mapping to an index. This operation is permanent, with no recovery option. The mapped index is untouched by this operation.
function deleteAlias(alias: SearchAlias, options?: DeleteAliasOptions): Promise<void>
Parameters
- alias
- SearchAlias
The alias to delete.
- options
- DeleteAliasOptions
Additional optional arguments.
Returns
Promise<void>
deleteAlias(string, DeleteAliasOptions)
Deletes a search alias and its associated mapping to an index. This operation is permanent, with no recovery option. The mapped index is untouched by this operation.
function deleteAlias(aliasName: string, options?: DeleteAliasOptions): Promise<void>
Parameters
- aliasName
-
string
Name of the alias to delete.
- options
- DeleteAliasOptions
Additional optional arguments.
Returns
Promise<void>
deleteIndex(SearchIndex, DeleteIndexOptions)
Deletes an existing index.
function deleteIndex(index: SearchIndex, options?: DeleteIndexOptions): Promise<void>
Parameters
- index
- SearchIndex
The index to delete.
- options
- DeleteIndexOptions
Additional optional arguments.
Returns
Promise<void>
deleteIndex(string, DeleteIndexOptions)
Deletes an existing index.
function deleteIndex(indexName: string, options?: DeleteIndexOptions): Promise<void>
Parameters
- indexName
-
string
Name of the index to delete.
- options
- DeleteIndexOptions
Additional optional arguments.
Returns
Promise<void>
deleteKnowledgeBase(KnowledgeBase, DeleteKnowledgeBaseOptions)
Deletes an existing knowledge base.
function deleteKnowledgeBase(knowledgeBase: KnowledgeBase, options?: DeleteKnowledgeBaseOptions): Promise<void>
Parameters
- knowledgeBase
- KnowledgeBase
the knowledge base to delete.
- options
- DeleteKnowledgeBaseOptions
options parameters.
Returns
Promise<void>
deleteKnowledgeBase(string, DeleteKnowledgeBaseOptions)
Deletes an existing knowledge base.
function deleteKnowledgeBase(knowledgeBaseName: string, options?: DeleteKnowledgeBaseOptions): Promise<void>
Parameters
- knowledgeBaseName
-
string
name of the knowledge base to delete.
- options
- DeleteKnowledgeBaseOptions
options parameters.
Returns
Promise<void>
deleteKnowledgeSource(KnowledgeSource, DeleteKnowledgeSourceOptions)
Deletes an existing source.
function deleteKnowledgeSource(source: KnowledgeSource, options?: DeleteKnowledgeSourceOptions): Promise<void>
Parameters
- source
- KnowledgeSource
the knowledge source to delete.
- options
- DeleteKnowledgeSourceOptions
options parameters.
Returns
Promise<void>
deleteKnowledgeSource(string, DeleteKnowledgeSourceOptions)
Deletes an existing source.
function deleteKnowledgeSource(sourceName: string, options?: DeleteKnowledgeSourceOptions): Promise<void>
Parameters
- sourceName
-
string
name of the knowledge source to delete.
- options
- DeleteKnowledgeSourceOptions
options parameters.
Returns
Promise<void>
deleteSynonymMap(string | SynonymMap, DeleteSynonymMapOptions)
Deletes an existing SynonymMap.
function deleteSynonymMap(synonymMap: string | SynonymMap, options?: DeleteSynonymMapOptions): Promise<void>
Parameters
- synonymMap
-
string | SynonymMap
- options
- DeleteSynonymMapOptions
Additional optional arguments.
Returns
Promise<void>
getAlias(string, OperationOptions)
Retrieves an alias definition.
function getAlias(aliasName: string, options?: OperationOptions): Promise<SearchAlias>
Parameters
- aliasName
-
string
The name of the alias to retrieve.
- options
- OperationOptions
The options parameters.
Returns
Promise<SearchAlias>
getIndex(string, OperationOptions)
Retrieves information about an index.
function getIndex(indexName: string, options?: OperationOptions): Promise<SearchIndex>
Parameters
- indexName
-
string
The name of the index.
- options
- OperationOptions
Additional optional arguments.
Returns
Promise<SearchIndex>
getIndexStatistics(string, OperationOptions)
Retrieves statistics about an index, such as the count of documents and the size of index storage.
function getIndexStatistics(indexName: string, options?: OperationOptions): Promise<SearchIndexStatistics>
Parameters
- indexName
-
string
The name of the index.
- options
- OperationOptions
Additional optional arguments.
Returns
Promise<SearchIndexStatistics>
getIndexStatsSummary(GetIndexStatsSummaryOptions)
Retrieves a list of existing indexes in the service.
function getIndexStatsSummary(options?: GetIndexStatsSummaryOptions): IndexStatisticsSummaryIterator
Parameters
- options
- GetIndexStatsSummaryOptions
Options to the list index operation.
Returns
getKnowledgeBase(string, GetKnowledgeBaseOptions)
Retrieves a knowledge base definition.
function getKnowledgeBase(knowledgeBaseName: string, options?: GetKnowledgeBaseOptions): Promise<KnowledgeBase>
Parameters
- knowledgeBaseName
-
string
name of the knowledge base to retrieve.
- options
- GetKnowledgeBaseOptions
options parameters.
Returns
Promise<KnowledgeBase>
getKnowledgeRetrievalClient(string, KnowledgeRetrievalClientOptions)
Retrieves the KnowledgeRetrievalClient corresponding to this SearchIndexClient
function getKnowledgeRetrievalClient(knowledgeBaseName: string, options?: KnowledgeRetrievalClientOptions): KnowledgeRetrievalClient
Parameters
- knowledgeBaseName
-
string
Name of the knowledge base
- options
- KnowledgeRetrievalClientOptions
KnowledgeRetrievalClient Options
Returns
getKnowledgeSource(string, GetKnowledgeSourceOptions)
Retrieves a knowledge source definition.
function getKnowledgeSource(sourceName: string, options?: GetKnowledgeSourceOptions): Promise<KnowledgeSource>
Parameters
- sourceName
-
string
The name of the knowledge source to retrieve.
- options
- GetKnowledgeSourceOptions
The options parameters.
Returns
Promise<KnowledgeSource>
getKnowledgeSourceStatus(string, GetKnowledgeSourceStatusOptions)
Returns the current status and synchronization history of a knowledge source.
function getKnowledgeSourceStatus(sourceName: string, options?: GetKnowledgeSourceStatusOptions): Promise<KnowledgeSourceStatus>
Parameters
- sourceName
-
string
The name of the knowledge source for which to retrieve status.
- options
- GetKnowledgeSourceStatusOptions
The options parameters.
Returns
Promise<KnowledgeSourceStatus>
getSearchClient<TModel>(string, SearchClientOptions)
Retrieves the SearchClient corresponding to this SearchIndexClient
function getSearchClient<TModel>(indexName: string, options?: SearchClientOptions): SearchClient<TModel>
Parameters
- indexName
-
string
Name of the index
- options
- SearchClientOptions
SearchClient Options
Returns
SearchClient<TModel>
getServiceStatistics(OperationOptions)
Retrieves statistics about the service, such as the count of documents, index, etc.
function getServiceStatistics(options?: OperationOptions): Promise<SearchServiceStatistics>
Parameters
- options
- OperationOptions
Additional optional arguments.
Returns
Promise<SearchServiceStatistics>
getSynonymMap(string, OperationOptions)
Retrieves information about a SynonymMap.
function getSynonymMap(synonymMapName: string, options?: OperationOptions): Promise<SynonymMap>
Parameters
- synonymMapName
-
string
The name of the SynonymMap.
- options
- OperationOptions
Additional optional arguments.
Returns
Promise<SynonymMap>
listAliases(OperationOptions)
Lists all aliases available for a search service.
function listAliases(options?: OperationOptions): AliasIterator
Parameters
- options
- OperationOptions
The options parameters.
Returns
listIndexes(OperationOptions)
Retrieves a list of existing indexes in the service.
function listIndexes(options?: OperationOptions): IndexIterator
Parameters
- options
- OperationOptions
Options to the list index operation.
Returns
listIndexesNames(OperationOptions)
Retrieves a list of names of existing indexes in the service.
function listIndexesNames(options?: OperationOptions): IndexNameIterator
Parameters
- options
- OperationOptions
Options to the list index operation.
Returns
listKnowledgeBases(ListKnowledgeBasesOptions)
Retrieves a list of existing KnowledgeBases in the service.
function listKnowledgeBases(options?: ListKnowledgeBasesOptions): KnowledgeBaseIterator
Parameters
- options
- ListKnowledgeBasesOptions
Options to the list knowledge bases operation.
Returns
listKnowledgeSources(ListKnowledgeSourcesOptions)
Retrieves a list of existing KnowledgeSources in the service.
function listKnowledgeSources(options?: ListKnowledgeSourcesOptions): KnowledgeSourceIterator
Parameters
- options
- ListKnowledgeSourcesOptions
Options to the list knowledge sources operation.
Returns
listSynonymMaps(OperationOptions)
Retrieves a list of existing SynonymMaps in the service.
function listSynonymMaps(options?: OperationOptions): Promise<SynonymMap[]>
Parameters
- options
- OperationOptions
Options to the list SynonymMaps operation.
Returns
Promise<SynonymMap[]>
listSynonymMapsNames(OperationOptions)
Retrieves a list of names of existing SynonymMaps in the service.
function listSynonymMapsNames(options?: OperationOptions): Promise<string[]>
Parameters
- options
- OperationOptions
Options to the list SynonymMaps operation.
Returns
Promise<string[]>