@meilisearch/meili-api
Version:
The MeiliSearch JS client for Node.js and the browser.
94 lines • 2.78 kB
TypeScript
import { AxiosInstance, CancelTokenSource } from 'axios';
import * as Types from './types';
declare class Indexes {
instance: AxiosInstance;
indexUid: string;
cancelTokenSource: CancelTokenSource;
constructor(instance: AxiosInstance, indexUid: string);
/**
* Get the informations about on update
* @memberof Indexes
* @method getUpdate
*/
getUpdate(updateId: number): Promise<object>;
/**
* Get the list of all updates
* @memberof Indexes
* @method getAllUpdates
*/
getAllUpdates(): Promise<object[]>;
/**
* Search for documents into an index
* @memberof Meili
* @method search
*/
search(options: Types.SearchParams): Promise<Types.SearchResponse>;
getIndex(): Promise<Types.Index>;
updateIndex(data: Types.UpdateIndexRequest): Promise<Types.Index>;
deleteIndex(): Promise<void>;
getSchema(raw?: boolean): Promise<Types.Schema | Types.SchemaRaw>;
updateSchema(schema: Types.Schema | Types.SchemaRaw): Promise<Types.AsyncUpdateId>;
/**
* get stats of an index
* @memberof Indexes
* @method getStats
*/
getStats(): Promise<object[]>;
/**
* get documents of an index
* @memberof Indexes
* @method getDocuments
*/
getDocuments(params?: Types.GetDocumentsParams): Promise<object[]>;
/**
* Get one document
* @memberof Documents
* @method getDocument
*/
getDocument(documentId: string): Promise<object>;
/**
* Add or update multiples documents to an index
* @memberof Documents
* @method addDocuments
*/
addDocuments(documents: object[]): Promise<Types.AsyncUpdateId>;
/**
* Delete one document
* @memberof Documents
* @method deleteDocument
*/
deleteDocument(documentId: string): Promise<Types.AsyncUpdateId>;
/**
* Delete multiples documents to an index
* @memberof Documents
* @method deleteDocuments
*/
deleteDocuments(documentsIds: string[]): Promise<Types.AsyncUpdateId>;
deleteAllDocuments(): Promise<Types.AsyncUpdateId>;
/**
* Retrieve all settings
* @memberof Settings
* @method get
*/
getSettings(): Promise<object>;
/**
* Update all settings
* @memberof Settings
* @method set
*/
updateSettings(settings: object): Promise<void>;
/**
* Get the list of all synonyms
* @memberof Synonyms
* @method list
*/
listSynonyms(): Promise<object[]>;
/**
* Add a new relation between an input and equivalents synonyms
* @memberof Synonyms
* @method create
*/
createSynonym(input: string, synonyms: string[]): Promise<object>;
}
export { Indexes };
//# sourceMappingURL=indexes.d.ts.map