SearchService
Constructors
constructor
**new SearchService**(«destructured», options)
Parameters
options
anyRequiredProperties
Accessors
options
get**options**(): Record<string, unknown>
Returns
Record<string, unknown>
Record
Record<string, unknown>RequiredMethods
addDocuments
**addDocuments**(indexName, documents, type): Promise<void>
Used to index documents by the search engine provider
Parameters
indexName
stringRequireddocuments
unknownRequiredtype
stringRequiredReturns
Promise<void>
Promise
Promise<void>RequiredcreateIndex
**createIndex**(indexName, options): Promise<void>
Used to create an index
Parameters
indexName
stringRequiredoptions
unknownRequiredReturns
Promise<void>
Promise
Promise<void>RequireddeleteAllDocuments
**deleteAllDocuments**(indexName): Promise<void>
Used to delete all documents
Parameters
indexName
stringRequiredReturns
Promise<void>
Promise
Promise<void>RequireddeleteDocument
**deleteDocument**(indexName, document_id): Promise<void>
Used to delete document
Parameters
indexName
stringRequireddocument_id
string | numberRequiredReturns
Promise<void>
Promise
Promise<void>RequiredgetIndex
**getIndex**(indexName): Promise<void>
Used to get an index
Parameters
indexName
stringRequiredReturns
Promise<void>
Promise
Promise<void>RequiredreplaceDocuments
**replaceDocuments**(indexName, documents, type): Promise<void>
Used to replace documents
Parameters
indexName
stringRequireddocuments
unknownRequiredtype
stringRequiredReturns
Promise<void>
Promise
Promise<void>Requiredsearch
**search**(indexName, query, options): Promise<{ hits: unknown[] }>
Used to search for a document in an index
Parameters
indexName
stringRequiredquery
unknownRequiredoptions
unknownRequiredReturns
Promise<{ hits: unknown[] }>
Promise
Promise<{ hits: unknown[] }>RequiredupdateSettings
**updateSettings**(indexName, settings): Promise<void>
Used to update the settings of an index
Parameters
indexName
stringRequiredsettings
unknownRequiredReturns
Promise<void>
Promise
Promise<void>Required