Meilisearch JS
    Preparing search index...

    Class Index<T>

    Type Parameters

    Index

    Constructors

    Properties

    Methods

    addDocuments addDocumentsFromString addDocumentsInBatches delete deleteAllDocuments deleteDocument deleteDocuments fetchInfo fetchPrimaryKey getDictionary getDisplayedAttributes getDistinctAttribute getDocument getDocuments getEmbedders getFaceting getFacetSearch getFilterableAttributes getLocalizedAttributes getNonSeparatorTokens getPagination getPrefixSearch getProximityPrecision getRankingRules getRawInfo getSearchableAttributes getSearchCutoffMs getSeparatorTokens getSettings getSortableAttributes getStats getStopWords getSynonyms getTypoTolerance resetDictionary resetDisplayedAttributes resetDistinctAttribute resetEmbedders resetFaceting resetFacetSearch resetFilterableAttributes resetLocalizedAttributes resetNonSeparatorTokens resetPagination resetPrefixSearch resetProximityPrecision resetRankingRules resetSearchableAttributes resetSearchCutoffMs resetSeparatorTokens resetSettings resetSortableAttributes resetStopWords resetSynonyms resetTypoTolerance search searchForFacetValues searchGet searchSimilarDocuments update updateDictionary updateDisplayedAttributes updateDistinctAttribute updateDocuments updateDocumentsByFunction updateDocumentsFromString updateDocumentsInBatches updateEmbedders updateFaceting updateFacetSearch updateFilterableAttributes updateLocalizedAttributes updateNonSeparatorTokens updatePagination updatePrefixSearch updateProximityPrecision updateRankingRules updateSearchableAttributes updateSearchCutoffMs updateSeparatorTokens updateSettings updateSortableAttributes updateStopWords updateSynonyms updateTypoTolerance create

    Constructors

    Properties

    createdAt: undefined | Date
    httpRequest: HttpRequests
    primaryKey: undefined | string
    tasks: TaskClient
    uid: string
    updatedAt: undefined | Date

    Methods

    • Add or replace multiples documents to an index in batches

      Parameters

      • documents: T[]

        Array of Document objects to add/replace

      • batchSize: number = 1000

        Size of the batch

      • Optionaloptions: DocumentOptions

        Options on document addition

      Returns EnqueuedTaskPromise[]

      Promise containing array of enqueued task objects for each batch

    • Fetch and update Index information.

      Returns Promise<Index<T>>

      Promise to the current Index object with updated information

    • Get Primary Key.

      Returns Promise<undefined | string>

      Promise containing the Primary Key of the index

    • Get the dictionary settings of a Meilisearch index.

      Returns Promise<string[]>

      Promise containing the dictionary settings

    • Get the displayed-attributes

      Returns Promise<string[]>

      Promise containing array of displayed-attributes

    • Get one document

      Type Parameters

      Parameters

      • documentId: string | number

        Document ID

      • Optionalparameters: DocumentQuery<T>

        Parameters applied on a document

      Returns Promise<D>

      Promise containing Document response

    • Get the facet search settings.

      Returns Promise<boolean>

      Promise containing object of facet search settings

    • Get the list of all non-separator tokens.

      Returns Promise<string[]>

      Promise containing array of non-separator tokens

    • Get the list of all ranking-rules

      Returns Promise<string[]>

      Promise containing array of ranking-rules

    • Get the searchable-attributes

      Returns Promise<string[]>

      Promise containing array of searchable-attributes

    • Get the list of all separator tokens.

      Returns Promise<string[]>

      Promise containing array of separator tokens

    • Get the sortable-attributes

      Returns Promise<string[]>

      Promise containing array of sortable-attributes

    • Get the list of all stop-words

      Returns Promise<string[]>

      Promise containing array of stop-words

    • Get the list of all synonyms

      Returns Promise<Record<string, string[]>>

      Promise containing record of synonym mappings

    • Add or update multiples documents to an index in batches

      Parameters

      • documents: Partial<T>[]

        Array of Document objects to add/update

      • batchSize: number = 1000

        Size of the batch

      • Optionaloptions: DocumentOptions

        Options on document update

      Returns EnqueuedTaskPromise[]

      Promise containing array of enqueued task objects for each batch