Class DocumentsApiImpl<T>
- java.lang.Object
-
- co.elasticsearch.enterprisesearch.client.DocumentsApiImpl<T>
-
- All Implemented Interfaces:
DocumentsApi<T>
public class DocumentsApiImpl<T> extends Object implements DocumentsApi<T>
-
-
Constructor Summary
Constructors Constructor Description DocumentsApiImpl(com.fasterxml.jackson.databind.ObjectMapper objectMapper, String baseUrl, okhttp3.OkHttpClient client, Class<T> resultType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DeleteResponsedelete(String engineName, List<String> ids)Delete the documents with the given idsDocumentsApi<T>disableRetries()List<T>getDocuments(String engineName, List<String> ids)Retrieves one or more documents by id.IndexResponseindex(String engineName, List<T> documents)Create or Update document(s) in the indexListResponse<T>listDocuments(String engineName, Page page)Lists documents in the given engineDocumentsApi<T>setBackoff(@NotNull Duration delay, @NotNull Duration maxDelay, double delayFactor)Set the Failsafe Retry policy for all the Documents API calls
-
-
-
Method Detail
-
setBackoff
public DocumentsApi<T> setBackoff(@NotNull @NotNull Duration delay, @NotNull @NotNull Duration maxDelay, double delayFactor)
Set the Failsafe Retry policy for all the Documents API calls- Parameters:
delay- retry delaymaxDelay- maximum delaydelayFactor- the retry delay factor- Returns:
- The DocumentsApi
-
disableRetries
public DocumentsApi<T> disableRetries()
-
index
public IndexResponse index(String engineName, List<T> documents)
Description copied from interface:DocumentsApiCreate or Update document(s) in the index- Specified by:
indexin interfaceDocumentsApi<T>- Parameters:
engineName- The engine namedocuments- The documents to insert or update- Returns:
- The index response
-
getDocuments
public List<T> getDocuments(String engineName, List<String> ids)
Description copied from interface:DocumentsApiRetrieves one or more documents by id. All field values are returned in string format- Specified by:
getDocumentsin interfaceDocumentsApi<T>- Parameters:
engineName- the engine nameids- the document ids- Returns:
- a list of documents matching the given ids. Documents not found will be null entries
-
delete
public DeleteResponse delete(String engineName, List<String> ids)
Description copied from interface:DocumentsApiDelete the documents with the given ids- Specified by:
deletein interfaceDocumentsApi<T>- Parameters:
engineName- The engine nameids- A list of document ids to delete- Returns:
- The delete response
-
listDocuments
public ListResponse<T> listDocuments(String engineName, Page page)
Description copied from interface:DocumentsApiLists documents in the given engine- Specified by:
listDocumentsin interfaceDocumentsApi<T>- Parameters:
engineName- The name of the enginepage- A page object- Returns:
- A list of documents
-
-