Class MeilisearchClient

java.lang.Object
com.meilisearch.sdk.Client
io.vanslog.spring.data.meilisearch.client.MeilisearchClient

public class MeilisearchClient extends com.meilisearch.sdk.Client
Extension of Client that allows to configure the additional attributes that are required for request timeout and retry handling. And also provides JsonHandler to convert the request and response body.
Author:
Junghoon Ban
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    MeilisearchClient(ClientConfiguration clientConfiguration, com.meilisearch.sdk.json.JsonHandler jsonHandler)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.meilisearch.sdk.json.JsonHandler
     
    getRawDocuments(String indexUid, int offset, int limit, String[] sort)
    Fetch raw documents through the documents/fetch endpoint.
    getRawDocumentsByIds(String indexUid, List<String> documentIds)
    Fetch raw documents by ID through the internal HTTP transport.
    int
     
    int
     

    Methods inherited from class com.meilisearch.sdk.Client

    cancelTasks, createDump, createIndex, createIndex, createKey, createSnapshot, createWebhook, deleteIndex, deleteKey, deleteTasks, deleteWebhook, experimentalFeatures, export, generateTenantToken, generateTenantToken, getAllBatches, getBatch, getIndex, getIndexes, getIndexes, getKey, getKeys, getKeys, getRawIndexes, getRawIndexes, getStats, getTask, getTasks, getTasks, getVersion, getWebhook, getWebhooks, health, index, isHealthy, multiSearch, multiSearch, renderTemplate, swapIndexes, updateIndex, updateIndex, updateKey, updateWebhook, waitForTask

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MeilisearchClient

      public MeilisearchClient(ClientConfiguration clientConfiguration)
    • MeilisearchClient

      public MeilisearchClient(ClientConfiguration clientConfiguration, com.meilisearch.sdk.json.JsonHandler jsonHandler)
  • Method Details

    • getJsonHandler

      public com.meilisearch.sdk.json.JsonHandler getJsonHandler()
    • getRequestTimeout

      public int getRequestTimeout()
    • getRequestInterval

      public int getRequestInterval()
    • getRawDocumentsByIds

      public String getRawDocumentsByIds(String indexUid, List<String> documentIds) throws com.meilisearch.sdk.exceptions.MeilisearchException
      Fetch raw documents by ID through the internal HTTP transport. Native ID-list retrieval requires Meilisearch 1.14 or later.
      Parameters:
      indexUid - index containing the documents
      documentIds - requested document IDs
      Returns:
      the raw fetch response
      Throws:
      com.meilisearch.sdk.exceptions.MeilisearchException - if the request fails
    • getRawDocuments

      public String getRawDocuments(String indexUid, int offset, int limit, @Nullable String[] sort) throws com.meilisearch.sdk.exceptions.MeilisearchException
      Fetch raw documents through the documents/fetch endpoint. Sorting requires Meilisearch 1.16 or later.
      Parameters:
      indexUid - index containing the documents
      offset - number of documents to skip, or negative to use the server default
      limit - maximum number of documents to return, or negative to use the server default
      sort - sort expressions in attribute:direction form, or null for an unsorted listing
      Returns:
      the raw fetch response
      Throws:
      com.meilisearch.sdk.exceptions.MeilisearchException - if the request fails