Class DocumentsApiImpl<T>

    • Constructor Detail

      • DocumentsApiImpl

        public DocumentsApiImpl​(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                String baseUrl,
                                okhttp3.OkHttpClient client,
                                Class<T> resultType)
    • 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 delay
        maxDelay - maximum delay
        delayFactor - the retry delay factor
        Returns:
        The DocumentsApi
      • index

        public IndexResponse index​(String engineName,
                                   List<T> documents)
        Description copied from interface: DocumentsApi
        Create or Update document(s) in the index
        Specified by:
        index in interface DocumentsApi<T>
        Parameters:
        engineName - The engine name
        documents - The documents to insert or update
        Returns:
        The index response
      • getDocuments

        public List<T> getDocuments​(String engineName,
                                    List<String> ids)
        Description copied from interface: DocumentsApi
        Retrieves one or more documents by id. All field values are returned in string format
        Specified by:
        getDocuments in interface DocumentsApi<T>
        Parameters:
        engineName - the engine name
        ids - 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: DocumentsApi
        Delete the documents with the given ids
        Specified by:
        delete in interface DocumentsApi<T>
        Parameters:
        engineName - The engine name
        ids - A list of document ids to delete
        Returns:
        The delete response
      • listDocuments

        public ListResponse<T> listDocuments​(String engineName,
                                             Page page)
        Description copied from interface: DocumentsApi
        Lists documents in the given engine
        Specified by:
        listDocuments in interface DocumentsApi<T>
        Parameters:
        engineName - The name of the engine
        page - A page object
        Returns:
        A list of documents