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
ConstructorsConstructorDescriptionMeilisearchClient(ClientConfiguration clientConfiguration) MeilisearchClient(ClientConfiguration clientConfiguration, com.meilisearch.sdk.json.JsonHandler jsonHandler) -
Method Summary
Modifier and TypeMethodDescriptioncom.meilisearch.sdk.json.JsonHandlergetRawDocuments(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.intintMethods 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
-
Constructor Details
-
MeilisearchClient
-
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 documentsdocumentIds- 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 documentsoffset- number of documents to skip, or negative to use the server defaultlimit- maximum number of documents to return, or negative to use the server defaultsort- sort expressions inattribute:directionform, or null for an unsorted listing- Returns:
- the raw fetch response
- Throws:
com.meilisearch.sdk.exceptions.MeilisearchException- if the request fails
-