Skip to main content
Skip to main content

AbstractSearchService

admin/discounts.internal.AbstractSearchService

Implements

Properties

isDefaultanyRequired
options_Record<string, unknown>Required

Accessors

options

get options(): Record<string, unknown>

Returns

Record<string, unknown>

RecordRecord<string, unknown>Required

Implementation of

ISearchService.options

Methods

addDocuments

Abstract addDocuments(indexName, documents, type): unknown

Used to index documents by the search engine provider

Parameters

indexNamestringRequired
the index name
documentsunknownRequired
documents array to be indexed
typestringRequired
of documents to be added (e.g: products, regions, orders, etc)

Returns

unknown

unknownunknown
returns response from search engine provider

Implementation of

ISearchService.addDocuments


createIndex

Abstract createIndex(indexName, options): unknown

Used to create an index

Parameters

indexNamestringRequired
the index name
optionsunknownRequired
the options

Returns

unknown

unknownunknown
returns response from search engine provider

Implementation of

ISearchService.createIndex


deleteAllDocuments

Abstract deleteAllDocuments(indexName): unknown

Used to delete all documents

Parameters

indexNamestringRequired
the index name

Returns

unknown

unknownunknown
returns response from search engine provider

Implementation of

ISearchService.deleteAllDocuments


deleteDocument

Abstract deleteDocument(indexName, document_id): unknown

Used to delete document

Parameters

indexNamestringRequired
the index name
document_idstring | numberRequired
the id of the document

Returns

unknown

unknownunknown
returns response from search engine provider

Implementation of

ISearchService.deleteDocument


getIndex

Abstract getIndex(indexName): unknown

Used to get an index

Parameters

indexNamestringRequired
the index name.

Returns

unknown

unknownunknown
returns response from search engine provider

Implementation of

ISearchService.getIndex


replaceDocuments

Abstract replaceDocuments(indexName, documents, type): unknown

Used to replace documents

Parameters

indexNamestringRequired
the index name.
documentsunknownRequired
array of document objects that will replace existing documents
typestringRequired
type of documents to be replaced (e.g: products, regions, orders, etc)

Returns

unknown

unknownunknown
returns response from search engine provider

Implementation of

ISearchService.replaceDocuments


Abstract search(indexName, query, options): unknown

Used to search for a document in an index

Parameters

indexNamestringRequired
the index name
querynull | stringRequired
the search query
optionsunknownRequired
any options passed to the request object other than the query and indexName - additionalOptions contain any provider specific options

Returns

unknown

unknownunknown
returns response from search engine provider

Implementation of

ISearchService.search


updateSettings

Abstract updateSettings(indexName, settings): unknown

Used to update the settings of an index

Parameters

indexNamestringRequired
the index name
settingsunknownRequired
settings object

Returns

unknown

unknownunknown
returns response from search engine provider

Implementation of

ISearchService.updateSettings

Was this section helpful?