Share via


SearchIndexerClient class

Class to perform operations to manage (create, update, list/delete) indexers, datasources & skillsets.

Constructors

SearchIndexerClient(string, KeyCredential | TokenCredential, SearchIndexerClientOptions)

Creates an instance of SearchIndexerClient.

Example usage:

import { SearchIndexerClient, AzureKeyCredential } from "@azure/search-documents";

const indexerClient = new SearchIndexerClient("<endpoint>", new AzureKeyCredential("<apiKey>"));

Properties

apiVersion

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

serviceVersion

The API version to use when communicating with the service.

Methods

createDataSourceConnection(SearchIndexerDataSourceConnection, OperationOptions)

Creates a new dataSource in a search service.

createIndexer(SearchIndexer, OperationOptions)

Creates a new indexer in a search service.

createOrUpdateDataSourceConnection(SearchIndexerDataSourceConnection, CreateorUpdateDataSourceConnectionOptions)

Creates a new datasource or modifies an existing one.

createOrUpdateIndexer(SearchIndexer, CreateorUpdateIndexerOptions)

Creates a new indexer or modifies an existing one.

createOrUpdateSkillset(SearchIndexerSkillset, CreateOrUpdateSkillsetOptions)

Creates a new Skillset or modifies an existing one.

createSkillset(SearchIndexerSkillset, OperationOptions)

Creates a new skillset in a search service.

deleteDataSourceConnection(string | SearchIndexerDataSourceConnection, DeleteDataSourceConnectionOptions)

Deletes an existing datasource.

deleteIndexer(string | SearchIndexer, DeleteIndexerOptions)

Deletes an existing indexer.

deleteSkillset(string | SearchIndexerSkillset, DeleteSkillsetOptions)

Deletes an existing Skillset.

getDataSourceConnection(string, OperationOptions)

Retrieves information about a DataSource

getIndexer(string, OperationOptions)

Retrieves information about an Indexer.

getIndexerStatus(string, OperationOptions)

Returns the current status and execution history of an indexer.

getSkillset(string, OperationOptions)

Retrieves information about an Skillset.

listDataSourceConnections(OperationOptions)

Retrieves a list of existing data sources in the service.

listDataSourceConnectionsNames(OperationOptions)

Retrieves a list of names of existing data sources in the service.

listIndexers(OperationOptions)

Retrieves a list of existing indexers in the service.

listIndexersNames(OperationOptions)

Retrieves a list of names of existing indexers in the service.

listSkillsets(OperationOptions)

Retrieves a list of existing Skillsets in the service.

listSkillsetsNames(OperationOptions)

Retrieves a list of names of existing Skillsets in the service.

resetDocuments(string, ResetDocumentsOptions)

Resets specific documents in the datasource to be selectively re-ingested by the indexer.

resetIndexer(string, OperationOptions)

Resets the change tracking state associated with an indexer.

resetSkills(string, ResetSkillsOptions)

Reset an existing skillset in a search service.

runIndexer(string, OperationOptions)

Runs an indexer on-demand.

Constructor Details

SearchIndexerClient(string, KeyCredential | TokenCredential, SearchIndexerClientOptions)

Creates an instance of SearchIndexerClient.

Example usage:

import { SearchIndexerClient, AzureKeyCredential } from "@azure/search-documents";

const indexerClient = new SearchIndexerClient("<endpoint>", new AzureKeyCredential("<apiKey>"));
new SearchIndexerClient(endpoint: string, credential: KeyCredential | TokenCredential, options?: SearchIndexerClientOptions)

Parameters

endpoint

string

The endpoint of the search service

credential

KeyCredential | TokenCredential

Used to authenticate requests to the service.

options
SearchIndexerClientOptions

Used to configure the Search 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

createDataSourceConnection(SearchIndexerDataSourceConnection, OperationOptions)

Creates a new dataSource in a search service.

function createDataSourceConnection(dataSourceConnection: SearchIndexerDataSourceConnection, options?: OperationOptions): Promise<SearchIndexerDataSourceConnection>

Parameters

dataSourceConnection
SearchIndexerDataSourceConnection

The dataSource definition to create in a search service.

options
OperationOptions

Additional optional arguments.

Returns

createIndexer(SearchIndexer, OperationOptions)

Creates a new indexer in a search service.

function createIndexer(indexer: SearchIndexer, options?: OperationOptions): Promise<SearchIndexer>

Parameters

indexer
SearchIndexer

The indexer definition to create in a search service.

options
OperationOptions

Additional optional arguments.

Returns

Promise<SearchIndexer>

createOrUpdateDataSourceConnection(SearchIndexerDataSourceConnection, CreateorUpdateDataSourceConnectionOptions)

Creates a new datasource or modifies an existing one.

function createOrUpdateDataSourceConnection(dataSourceConnection: SearchIndexerDataSourceConnection, options?: CreateorUpdateDataSourceConnectionOptions): Promise<SearchIndexerDataSourceConnection>

Parameters

dataSourceConnection
SearchIndexerDataSourceConnection

The information describing the datasource to be created/updated.

options
CreateorUpdateDataSourceConnectionOptions

Additional optional arguments.

Returns

createOrUpdateIndexer(SearchIndexer, CreateorUpdateIndexerOptions)

Creates a new indexer or modifies an existing one.

function createOrUpdateIndexer(indexer: SearchIndexer, options?: CreateorUpdateIndexerOptions): Promise<SearchIndexer>

Parameters

indexer
SearchIndexer

The information describing the indexer to be created/updated.

options
CreateorUpdateIndexerOptions

Additional optional arguments.

Returns

Promise<SearchIndexer>

createOrUpdateSkillset(SearchIndexerSkillset, CreateOrUpdateSkillsetOptions)

Creates a new Skillset or modifies an existing one.

function createOrUpdateSkillset(skillset: SearchIndexerSkillset, options?: CreateOrUpdateSkillsetOptions): Promise<SearchIndexerSkillset>

Parameters

skillset
SearchIndexerSkillset

The information describing the index to be created.

options
CreateOrUpdateSkillsetOptions

Additional optional arguments.

Returns

createSkillset(SearchIndexerSkillset, OperationOptions)

Creates a new skillset in a search service.

function createSkillset(skillset: SearchIndexerSkillset, options?: OperationOptions): Promise<SearchIndexerSkillset>

Parameters

skillset
SearchIndexerSkillset

The skillset containing one or more skills to create in a search service.

options
OperationOptions

Additional optional arguments.

Returns

deleteDataSourceConnection(string | SearchIndexerDataSourceConnection, DeleteDataSourceConnectionOptions)

Deletes an existing datasource.

function deleteDataSourceConnection(dataSourceConnection: string | SearchIndexerDataSourceConnection, options?: DeleteDataSourceConnectionOptions): Promise<void>

Parameters

dataSourceConnection

string | SearchIndexerDataSourceConnection

options
DeleteDataSourceConnectionOptions

Additional optional arguments.

Returns

Promise<void>

deleteIndexer(string | SearchIndexer, DeleteIndexerOptions)

Deletes an existing indexer.

function deleteIndexer(indexer: string | SearchIndexer, options?: DeleteIndexerOptions): Promise<void>

Parameters

indexer

string | SearchIndexer

Indexer/Name of the indexer to delete.

options
DeleteIndexerOptions

Additional optional arguments.

Returns

Promise<void>

deleteSkillset(string | SearchIndexerSkillset, DeleteSkillsetOptions)

Deletes an existing Skillset.

function deleteSkillset(skillset: string | SearchIndexerSkillset, options?: DeleteSkillsetOptions): Promise<void>

Parameters

skillset

string | SearchIndexerSkillset

Skillset/Name of the Skillset to delete.

options
DeleteSkillsetOptions

Additional optional arguments.

Returns

Promise<void>

getDataSourceConnection(string, OperationOptions)

Retrieves information about a DataSource

function getDataSourceConnection(dataSourceConnectionName: string, options?: OperationOptions): Promise<SearchIndexerDataSourceConnection>

Parameters

dataSourceConnectionName

string

options
OperationOptions

Additional optional arguments

Returns

getIndexer(string, OperationOptions)

Retrieves information about an Indexer.

function getIndexer(indexerName: string, options?: OperationOptions): Promise<SearchIndexer>

Parameters

indexerName

string

The name of the Indexer.

options
OperationOptions

Additional optional arguments.

Returns

Promise<SearchIndexer>

getIndexerStatus(string, OperationOptions)

Returns the current status and execution history of an indexer.

function getIndexerStatus(indexerName: string, options?: OperationOptions): Promise<SearchIndexerStatus>

Parameters

indexerName

string

The name of the indexer.

options
OperationOptions

Additional optional arguments.

Returns

getSkillset(string, OperationOptions)

Retrieves information about an Skillset.

function getSkillset(skillsetName: string, options?: OperationOptions): Promise<SearchIndexerSkillset>

Parameters

skillsetName

string

options
OperationOptions

Additional optional arguments.

Returns

listDataSourceConnections(OperationOptions)

Retrieves a list of existing data sources in the service.

function listDataSourceConnections(options?: OperationOptions): Promise<SearchIndexerDataSourceConnection[]>

Parameters

options
OperationOptions

Options to the list indexers operation.

Returns

listDataSourceConnectionsNames(OperationOptions)

Retrieves a list of names of existing data sources in the service.

function listDataSourceConnectionsNames(options?: OperationOptions): Promise<string[]>

Parameters

options
OperationOptions

Options to the list indexers operation.

Returns

Promise<string[]>

listIndexers(OperationOptions)

Retrieves a list of existing indexers in the service.

function listIndexers(options?: OperationOptions): Promise<SearchIndexer[]>

Parameters

options
OperationOptions

Options to the list indexers operation.

Returns

Promise<SearchIndexer[]>

listIndexersNames(OperationOptions)

Retrieves a list of names of existing indexers in the service.

function listIndexersNames(options?: OperationOptions): Promise<string[]>

Parameters

options
OperationOptions

Options to the list indexers operation.

Returns

Promise<string[]>

listSkillsets(OperationOptions)

Retrieves a list of existing Skillsets in the service.

function listSkillsets(options?: OperationOptions): Promise<SearchIndexerSkillset[]>

Parameters

options
OperationOptions

Options to the list Skillsets operation.

Returns

listSkillsetsNames(OperationOptions)

Retrieves a list of names of existing Skillsets in the service.

function listSkillsetsNames(options?: OperationOptions): Promise<string[]>

Parameters

options
OperationOptions

Options to the list Skillsets operation.

Returns

Promise<string[]>

resetDocuments(string, ResetDocumentsOptions)

Resets specific documents in the datasource to be selectively re-ingested by the indexer.

function resetDocuments(indexerName: string, options?: ResetDocumentsOptions): Promise<void>

Parameters

indexerName

string

The name of the indexer to reset documents for.

options
ResetDocumentsOptions

Additional optional arguments.

Returns

Promise<void>

resetIndexer(string, OperationOptions)

Resets the change tracking state associated with an indexer.

function resetIndexer(indexerName: string, options?: OperationOptions): Promise<void>

Parameters

indexerName

string

The name of the indexer to reset.

options
OperationOptions

Additional optional arguments.

Returns

Promise<void>

resetSkills(string, ResetSkillsOptions)

Reset an existing skillset in a search service.

function resetSkills(skillsetName: string, options?: ResetSkillsOptions): Promise<void>

Parameters

skillsetName

string

The name of the skillset to reset.

options
ResetSkillsOptions

The options parameters.

Returns

Promise<void>

runIndexer(string, OperationOptions)

Runs an indexer on-demand.

function runIndexer(indexerName: string, options?: OperationOptions): Promise<void>

Parameters

indexerName

string

The name of the indexer to run.

options
OperationOptions

Additional optional arguments.

Returns

Promise<void>