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 |
Methods
| analyze |
Calls an analyzer or tokenizer manually on provided text. |
| create |
Creates a new index. |
| create |
Creates a new index or modifies an existing one. |
| create |
Creates a new SynonymMap or modifies an existing one. |
| create |
Creates a new SynonymMap in a search service. |
| delete |
Deletes an existing index. |
| delete |
Deletes an existing SynonymMap. |
| 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 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 |
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 SynonymMaps in the service. |
| list |
Retrieves a list of names of existing SynonymMaps in the service. |
Constructor Details
SearchIndexClient(string, KeyCredential, SearchIndexClientOptions)
Creates an instance of SearchIndexClient. Example usage:
const { SearchIndexClient, AzureKeyCredential } = require("@azure/search-documents");
const client = new SearchIndexClient(
"<endpoint>",
new AzureKeyCredential("<Admin Key>");
);
new SearchIndexClient(endpoint: string, credential: KeyCredential, options?: SearchIndexClientOptions)
Parameters
- endpoint
-
string
The endpoint of the search service
- credential
-
KeyCredential
Used to authenticate requests to the service.
- options
- SearchIndexClientOptions
Used to configure the Search Index client.
Property Details
apiVersion
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
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>
createIndex(SearchIndex, CreateIndexOptions)
Creates a new index.
function createIndex(index: SearchIndex, options?: CreateIndexOptions): Promise<SearchIndex>
Parameters
- index
- SearchIndex
The information describing the index to be created.
- options
- CreateIndexOptions
Additional optional arguments.
Returns
Promise<SearchIndex>
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>
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, CreateSynonymMapOptions)
Creates a new SynonymMap in a search service.
function createSynonymMap(synonymMap: SynonymMap, options?: CreateSynonymMapOptions): Promise<SynonymMap>
Parameters
- synonymMap
- SynonymMap
The synonymMap definition to create in a search service.
- options
- CreateSynonymMapOptions
Additional optional arguments.
Returns
Promise<SynonymMap>
deleteIndex(string | SearchIndex, DeleteIndexOptions)
Deletes an existing index.
function deleteIndex(index: string | SearchIndex, options?: DeleteIndexOptions): Promise<void>
Parameters
- index
-
string | SearchIndex
- options
- DeleteIndexOptions
Additional optional arguments.
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>
getIndex(string, GetIndexOptions)
Retrieves information about an index.
function getIndex(indexName: string, options?: GetIndexOptions): Promise<SearchIndex>
Parameters
- indexName
-
string
The name of the index.
- options
- GetIndexOptions
Additional optional arguments.
Returns
Promise<SearchIndex>
getIndexStatistics(string, GetIndexStatisticsOptions)
Retrieves statistics about an index, such as the count of documents and the size of index storage.
function getIndexStatistics(indexName: string, options?: GetIndexStatisticsOptions): Promise<SearchIndexStatistics>
Parameters
- indexName
-
string
The name of the index.
- options
- GetIndexStatisticsOptions
Additional optional arguments.
Returns
Promise<SearchIndexStatistics>
getSearchClient<T>(string, SearchClientOptions)
Retrieves the SearchClient corresponding to this SearchIndexClient
function getSearchClient<T>(indexName: string, options?: SearchClientOptions): SearchClient<T>
Parameters
- indexName
-
string
Name of the index
- options
- SearchClientOptions
SearchClient Options
Returns
SearchClient<T>
getServiceStatistics(GetServiceStatisticsOptions)
Retrieves statistics about the service, such as the count of documents, index, etc.
function getServiceStatistics(options?: GetServiceStatisticsOptions): Promise<SearchServiceStatistics>
Parameters
- options
- GetServiceStatisticsOptions
Additional optional arguments.
Returns
Promise<SearchServiceStatistics>
getSynonymMap(string, GetSynonymMapsOptions)
Retrieves information about a SynonymMap.
function getSynonymMap(synonymMapName: string, options?: GetSynonymMapsOptions): Promise<SynonymMap>
Parameters
- synonymMapName
-
string
The name of the SynonymMap.
- options
- GetSynonymMapsOptions
Additional optional arguments.
Returns
Promise<SynonymMap>
listIndexes(ListIndexesOptions)
Retrieves a list of existing indexes in the service.
function listIndexes(options?: ListIndexesOptions): IndexIterator
Parameters
- options
- ListIndexesOptions
Options to the list index operation.
Returns
listIndexesNames(ListIndexesOptions)
Retrieves a list of names of existing indexes in the service.
function listIndexesNames(options?: ListIndexesOptions): IndexNameIterator
Parameters
- options
- ListIndexesOptions
Options to the list index operation.
Returns
listSynonymMaps(ListSynonymMapsOptions)
Retrieves a list of existing SynonymMaps in the service.
function listSynonymMaps(options?: ListSynonymMapsOptions): Promise<Array<SynonymMap>>
Parameters
- options
- ListSynonymMapsOptions
Options to the list SynonymMaps operation.
Returns
Promise<Array<SynonymMap>>
listSynonymMapsNames(ListSynonymMapsOptions)
Retrieves a list of names of existing SynonymMaps in the service.
function listSynonymMapsNames(options?: ListSynonymMapsOptions): Promise<Array<string>>
Parameters
- options
- ListSynonymMapsOptions
Options to the list SynonymMaps operation.
Returns
Promise<Array<string>>