import { Config, SearchResponse, SearchParams, IndexObject, IndexOptions, IndexStats, DocumentsQuery, DocumentQuery, DocumentOptions, Settings, Synonyms, StopWords, RankingRules, DistinctAttribute, FilterableAttributes, SortableAttributes, SearchableAttributes, DisplayedAttributes, TypoTolerance, WaitOptions, TasksQuery, TasksResults, PaginationSettings, Faceting, ResourceResults, RawDocumentAdditionOptions, ContentType, DocumentsIds, DocumentsDeletionQuery, SearchForFacetValuesParams, SearchForFacetValuesResponse, SeparatorTokens, NonSeparatorTokens, Dictionary, ProximityPrecision, Embedders, SearchCutoffMs, SearchSimilarDocumentsParams, LocalizedAttributes, UpdateDocumentsByFunctionOptions } from "./types"; import { HttpRequests } from "./http-requests"; import { Task, TaskClient } from "./task"; import { EnqueuedTask } from "./enqueued-task"; declare class Index = Record> { uid: string; primaryKey: string | undefined; createdAt: Date | undefined; updatedAt: Date | undefined; httpRequest: HttpRequests; tasks: TaskClient; /** * @param config - Request configuration options * @param uid - UID of the index * @param primaryKey - Primary Key of the index */ constructor(config: Config, uid: string, primaryKey?: string); /** * Search for documents into an index * * @param query - Query string * @param options - Search options * @param config - Additional request configuration options * @returns Promise containing the search response */ search = T, S extends SearchParams = SearchParams>(query?: string | null, options?: S, config?: Partial): Promise>; /** * Search for documents into an index using the GET method * * @param query - Query string * @param options - Search options * @param config - Additional request configuration options * @returns Promise containing the search response */ searchGet = T, S extends SearchParams = SearchParams>(query?: string | null, options?: S, config?: Partial): Promise>; /** * Search for facet values * * @param params - Parameters used to search on the facets * @param config - Additional request configuration options * @returns Promise containing the search response */ searchForFacetValues(params: SearchForFacetValuesParams, config?: Partial): Promise; /** * Search for similar documents * * @param params - Parameters used to search for similar documents * @returns Promise containing the search response */ searchSimilarDocuments = T, S extends SearchParams = SearchParams>(params: SearchSimilarDocumentsParams): Promise>; /** * Get index information. * * @returns Promise containing index information */ getRawInfo(): Promise; /** * Fetch and update Index information. * * @returns Promise to the current Index object with updated information */ fetchInfo(): Promise; /** * Get Primary Key. * * @returns Promise containing the Primary Key of the index */ fetchPrimaryKey(): Promise; /** * Create an index. * * @param uid - Unique identifier of the Index * @param options - Index options * @param config - Request configuration options * @returns Newly created Index object */ static create(uid: string, options: IndexOptions | undefined, config: Config): Promise; /** * Update an index. * * @param data - Data to update * @returns Promise to the current Index object with updated information */ update(data: IndexOptions): Promise; /** * Delete an index. * * @returns Promise which resolves when index is deleted successfully */ delete(): Promise; /** * Get the list of all the tasks of the index. * * @param parameters - Parameters to browse the tasks * @returns Promise containing all tasks */ getTasks(parameters?: TasksQuery): Promise; /** * Get one task of the index. * * @param taskUid - Task identifier * @returns Promise containing a task */ getTask(taskUid: number): Promise; /** * Wait for multiple tasks to be processed. * * @param taskUids - Tasks identifier * @param waitOptions - Options on timeout and interval * @returns Promise containing an array of tasks */ waitForTasks(taskUids: number[], { timeOutMs, intervalMs }?: WaitOptions): Promise; /** * Wait for a task to be processed. * * @param taskUid - Task identifier * @param waitOptions - Options on timeout and interval * @returns Promise containing an array of tasks */ waitForTask(taskUid: number, { timeOutMs, intervalMs }?: WaitOptions): Promise; /** * Get stats of an index * * @returns Promise containing object with stats of the index */ getStats(): Promise; /** * Get documents of an index. * * @param parameters - Parameters to browse the documents. Parameters can * contain the `filter` field only available in Meilisearch v1.2 and newer * @returns Promise containing the returned documents */ getDocuments = T>(parameters?: DocumentsQuery): Promise>; /** * Get one document * * @param documentId - Document ID * @param parameters - Parameters applied on a document * @returns Promise containing Document response */ getDocument = T>(documentId: string | number, parameters?: DocumentQuery): Promise; /** * Add or replace multiples documents to an index * * @param documents - Array of Document objects to add/replace * @param options - Options on document addition * @returns Promise containing an EnqueuedTask */ addDocuments(documents: T[], options?: DocumentOptions): Promise; /** * Add or replace multiples documents in a string format to an index. It only * supports csv, ndjson and json formats. * * @param documents - Documents provided in a string to add/replace * @param contentType - Content type of your document: * 'text/csv'|'application/x-ndjson'|'application/json' * @param options - Options on document addition * @returns Promise containing an EnqueuedTask */ addDocumentsFromString(documents: string, contentType: ContentType, queryParams?: RawDocumentAdditionOptions): Promise; /** * Add or replace multiples documents to an index in batches * * @param documents - Array of Document objects to add/replace * @param batchSize - Size of the batch * @param options - Options on document addition * @returns Promise containing array of enqueued task objects for each batch */ addDocumentsInBatches(documents: T[], batchSize?: number, options?: DocumentOptions): Promise; /** * Add or update multiples documents to an index * * @param documents - Array of Document objects to add/update * @param options - Options on document update * @returns Promise containing an EnqueuedTask */ updateDocuments(documents: Array>, options?: DocumentOptions): Promise; /** * Add or update multiples documents to an index in batches * * @param documents - Array of Document objects to add/update * @param batchSize - Size of the batch * @param options - Options on document update * @returns Promise containing array of enqueued task objects for each batch */ updateDocumentsInBatches(documents: Array>, batchSize?: number, options?: DocumentOptions): Promise; /** * Add or update multiples documents in a string format to an index. It only * supports csv, ndjson and json formats. * * @param documents - Documents provided in a string to add/update * @param contentType - Content type of your document: * 'text/csv'|'application/x-ndjson'|'application/json' * @param queryParams - Options on raw document addition * @returns Promise containing an EnqueuedTask */ updateDocumentsFromString(documents: string, contentType: ContentType, queryParams?: RawDocumentAdditionOptions): Promise; /** * Delete one document * * @param documentId - Id of Document to delete * @returns Promise containing an EnqueuedTask */ deleteDocument(documentId: string | number): Promise; /** * Delete multiples documents of an index. * * @param params - Params value can be: * * - DocumentsDeletionQuery: An object containing the parameters to customize * your document deletion. Only available in Meilisearch v1.2 and newer * - DocumentsIds: An array of document ids to delete * * @returns Promise containing an EnqueuedTask */ deleteDocuments(params: DocumentsDeletionQuery | DocumentsIds): Promise; /** * Delete all documents of an index * * @returns Promise containing an EnqueuedTask */ deleteAllDocuments(): Promise; /** * This is an EXPERIMENTAL feature, which may break without a major version. * It's available after Meilisearch v1.10. * * More info about the feature: * https://github.com/orgs/meilisearch/discussions/762 More info about * experimental features in general: * https://www.meilisearch.com/docs/reference/api/experimental-features * * @param options - Object containing the function string and related options * @returns Promise containing an EnqueuedTask */ updateDocumentsByFunction(options: UpdateDocumentsByFunctionOptions): Promise; /** * Retrieve all settings * * @returns Promise containing Settings object */ getSettings(): Promise; /** * Update all settings Any parameters not provided will be left unchanged. * * @param settings - Object containing parameters with their updated values * @returns Promise containing an EnqueuedTask */ updateSettings(settings: Settings): Promise; /** * Reset settings. * * @returns Promise containing an EnqueuedTask */ resetSettings(): Promise; /** * Get the pagination settings. * * @returns Promise containing object of pagination settings */ getPagination(): Promise; /** * Update the pagination settings. * * @param pagination - Pagination object * @returns Promise containing an EnqueuedTask */ updatePagination(pagination: PaginationSettings): Promise; /** * Reset the pagination settings. * * @returns Promise containing an EnqueuedTask */ resetPagination(): Promise; /** * Get the list of all synonyms * * @returns Promise containing object of synonym mappings */ getSynonyms(): Promise; /** * Update the list of synonyms. Overwrite the old list. * * @param synonyms - Mapping of synonyms with their associated words * @returns Promise containing an EnqueuedTask */ updateSynonyms(synonyms: Synonyms): Promise; /** * Reset the synonym list to be empty again * * @returns Promise containing an EnqueuedTask */ resetSynonyms(): Promise; /** * Get the list of all stop-words * * @returns Promise containing array of stop-words */ getStopWords(): Promise; /** * Update the list of stop-words. Overwrite the old list. * * @param stopWords - Array of strings that contains the stop-words. * @returns Promise containing an EnqueuedTask */ updateStopWords(stopWords: StopWords): Promise; /** * Reset the stop-words list to be empty again * * @returns Promise containing an EnqueuedTask */ resetStopWords(): Promise; /** * Get the list of all ranking-rules * * @returns Promise containing array of ranking-rules */ getRankingRules(): Promise; /** * Update the list of ranking-rules. Overwrite the old list. * * @param rankingRules - Array that contain ranking rules sorted by order of * importance. * @returns Promise containing an EnqueuedTask */ updateRankingRules(rankingRules: RankingRules): Promise; /** * Reset the ranking rules list to its default value * * @returns Promise containing an EnqueuedTask */ resetRankingRules(): Promise; /** * Get the distinct-attribute * * @returns Promise containing the distinct-attribute of the index */ getDistinctAttribute(): Promise; /** * Update the distinct-attribute. * * @param distinctAttribute - Field name of the distinct-attribute * @returns Promise containing an EnqueuedTask */ updateDistinctAttribute(distinctAttribute: DistinctAttribute): Promise; /** * Reset the distinct-attribute. * * @returns Promise containing an EnqueuedTask */ resetDistinctAttribute(): Promise; /** * Get the filterable-attributes * * @returns Promise containing an array of filterable-attributes */ getFilterableAttributes(): Promise; /** * Update the filterable-attributes. * * @param filterableAttributes - Array of strings containing the attributes * that can be used as filters at query time * @returns Promise containing an EnqueuedTask */ updateFilterableAttributes(filterableAttributes: FilterableAttributes): Promise; /** * Reset the filterable-attributes. * * @returns Promise containing an EnqueuedTask */ resetFilterableAttributes(): Promise; /** * Get the sortable-attributes * * @returns Promise containing array of sortable-attributes */ getSortableAttributes(): Promise; /** * Update the sortable-attributes. * * @param sortableAttributes - Array of strings containing the attributes that * can be used to sort search results at query time * @returns Promise containing an EnqueuedTask */ updateSortableAttributes(sortableAttributes: SortableAttributes): Promise; /** * Reset the sortable-attributes. * * @returns Promise containing an EnqueuedTask */ resetSortableAttributes(): Promise; /** * Get the searchable-attributes * * @returns Promise containing array of searchable-attributes */ getSearchableAttributes(): Promise; /** * Update the searchable-attributes. * * @param searchableAttributes - Array of strings that contains searchable * attributes sorted by order of importance(most to least important) * @returns Promise containing an EnqueuedTask */ updateSearchableAttributes(searchableAttributes: SearchableAttributes): Promise; /** * Reset the searchable-attributes. * * @returns Promise containing an EnqueuedTask */ resetSearchableAttributes(): Promise; /** * Get the displayed-attributes * * @returns Promise containing array of displayed-attributes */ getDisplayedAttributes(): Promise; /** * Update the displayed-attributes. * * @param displayedAttributes - Array of strings that contains attributes of * an index to display * @returns Promise containing an EnqueuedTask */ updateDisplayedAttributes(displayedAttributes: DisplayedAttributes): Promise; /** * Reset the displayed-attributes. * * @returns Promise containing an EnqueuedTask */ resetDisplayedAttributes(): Promise; /** * Get the typo tolerance settings. * * @returns Promise containing the typo tolerance settings. */ getTypoTolerance(): Promise; /** * Update the typo tolerance settings. * * @param typoTolerance - Object containing the custom typo tolerance * settings. * @returns Promise containing object of the enqueued update */ updateTypoTolerance(typoTolerance: TypoTolerance): Promise; /** * Reset the typo tolerance settings. * * @returns Promise containing object of the enqueued update */ resetTypoTolerance(): Promise; /** * Get the faceting settings. * * @returns Promise containing object of faceting index settings */ getFaceting(): Promise; /** * Update the faceting settings. * * @param faceting - Faceting index settings object * @returns Promise containing an EnqueuedTask */ updateFaceting(faceting: Faceting): Promise; /** * Reset the faceting settings. * * @returns Promise containing an EnqueuedTask */ resetFaceting(): Promise; /** * Get the list of all separator tokens. * * @returns Promise containing array of separator tokens */ getSeparatorTokens(): Promise; /** * Update the list of separator tokens. Overwrite the old list. * * @param separatorTokens - Array that contains separator tokens. * @returns Promise containing an EnqueuedTask or null */ updateSeparatorTokens(separatorTokens: SeparatorTokens): Promise; /** * Reset the separator tokens list to its default value * * @returns Promise containing an EnqueuedTask */ resetSeparatorTokens(): Promise; /** * Get the list of all non-separator tokens. * * @returns Promise containing array of non-separator tokens */ getNonSeparatorTokens(): Promise; /** * Update the list of non-separator tokens. Overwrite the old list. * * @param nonSeparatorTokens - Array that contains non-separator tokens. * @returns Promise containing an EnqueuedTask or null */ updateNonSeparatorTokens(nonSeparatorTokens: NonSeparatorTokens): Promise; /** * Reset the non-separator tokens list to its default value * * @returns Promise containing an EnqueuedTask */ resetNonSeparatorTokens(): Promise; /** * Get the dictionary settings of a Meilisearch index. * * @returns Promise containing the dictionary settings */ getDictionary(): Promise; /** * Update the dictionary settings. Overwrite the old settings. * * @param dictionary - Array that contains the new dictionary settings. * @returns Promise containing an EnqueuedTask or null */ updateDictionary(dictionary: Dictionary): Promise; /** * Reset the dictionary settings to its default value * * @returns Promise containing an EnqueuedTask */ resetDictionary(): Promise; /** * Get the proximity precision settings of a Meilisearch index. * * @returns Promise containing the proximity precision settings */ getProximityPrecision(): Promise; /** * Update the proximity precision settings. Overwrite the old settings. * * @param proximityPrecision - String that contains the new proximity * precision settings. * @returns Promise containing an EnqueuedTask or null */ updateProximityPrecision(proximityPrecision: ProximityPrecision): Promise; /** * Reset the proximity precision settings to its default value * * @returns Promise containing an EnqueuedTask */ resetProximityPrecision(): Promise; /** * Get the embedders settings of a Meilisearch index. * * @returns Promise containing the embedders settings */ getEmbedders(): Promise; /** * Update the embedders settings. Overwrite the old settings. * * @param embedders - Object that contains the new embedders settings. * @returns Promise containing an EnqueuedTask or null */ updateEmbedders(embedders: Embedders): Promise; /** * Reset the embedders settings to its default value * * @returns Promise containing an EnqueuedTask */ resetEmbedders(): Promise; /** * Get the SearchCutoffMs settings. * * @returns Promise containing object of SearchCutoffMs settings */ getSearchCutoffMs(): Promise; /** * Update the SearchCutoffMs settings. * * @param searchCutoffMs - Object containing SearchCutoffMsSettings * @returns Promise containing an EnqueuedTask */ updateSearchCutoffMs(searchCutoffMs: SearchCutoffMs): Promise; /** * Reset the SearchCutoffMs settings. * * @returns Promise containing an EnqueuedTask */ resetSearchCutoffMs(): Promise; /** * Get the localized attributes settings. * * @returns Promise containing object of localized attributes settings */ getLocalizedAttributes(): Promise; /** * Update the localized attributes settings. * * @param localizedAttributes - Localized attributes object * @returns Promise containing an EnqueuedTask */ updateLocalizedAttributes(localizedAttributes: LocalizedAttributes): Promise; /** * Reset the localized attributes settings. * * @returns Promise containing an EnqueuedTask */ resetLocalizedAttributes(): Promise; } export { Index }; //# sourceMappingURL=indexes.d.ts.map