Interface OpenSearchClient

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
OpenSearchRestClient

public interface OpenSearchClient extends AutoCloseable
Since:
9.3
  • Method Summary

    Modifier and Type
    Method
    Description
    org.opensearch.action.bulk.BulkResponse
    bulk(org.opensearch.action.bulk.BulkRequest request)
     
    org.opensearch.action.search.ClearScrollResponse
    clearScroll(org.opensearch.action.search.ClearScrollRequest request)
     
    void
    createIndex(String indexName, String jsonSettings)
     
    void
    createMapping(String indexName, String jsonMapping)
     
    default void
    dropIndex(String indexName)
    Drops the index and wait for the action to be effective until 5 minutes.
    void
    dropIndex(String indexName, Duration timeout)
     
    void
    flush(String indexName)
     
    org.opensearch.action.get.GetResponse
    get(org.opensearch.action.get.GetRequest request)
     
     
    getMapping(String indexName)
    Returns the mapping from elastic, exposed for testing purposes
    org.opensearch.action.index.IndexResponse
    index(org.opensearch.action.index.IndexRequest request)
     
    boolean
    indexExists(String indexName)
     
    boolean
     
    boolean
    mappingExists(String indexName)
     
    void
    optimize(String indexName)
     
    void
    refresh(String indexName)
     
    org.opensearch.action.search.SearchResponse
    scroll(org.opensearch.action.search.SearchScrollRequest request)
     
    org.opensearch.action.search.SearchResponse
    search(org.opensearch.action.search.SearchRequest request)
     
    boolean
    waitForYellowStatus(String[] indexNames, Duration timeout)
     

    Methods inherited from interface java.lang.AutoCloseable

    close
  • Method Details

    • getId

      String getId()
      Returns:
      The client id
    • isReady

      boolean isReady()
      Returns:
      Whether the targeted OpenSearch is ready or not (its status is at least ClusterHealthStatus.YELLOW
      Since:
      2025.0
    • waitForYellowStatus

      boolean waitForYellowStatus(String[] indexNames, Duration timeout)
    • refresh

      void refresh(String indexName)
    • flush

      void flush(String indexName)
    • optimize

      void optimize(String indexName)
    • createIndex

      void createIndex(String indexName, String jsonSettings)
    • indexExists

      boolean indexExists(String indexName)
    • dropIndex

      default void dropIndex(String indexName)
      Drops the index and wait for the action to be effective until 5 minutes.
    • dropIndex

      void dropIndex(String indexName, Duration timeout)
    • createMapping

      void createMapping(String indexName, String jsonMapping)
    • mappingExists

      boolean mappingExists(String indexName)
    • getMapping

      String getMapping(String indexName)
      Returns the mapping from elastic, exposed for testing purposes
      Since:
      2021.17
    • index

      org.opensearch.action.index.IndexResponse index(org.opensearch.action.index.IndexRequest request)
    • bulk

      org.opensearch.action.bulk.BulkResponse bulk(org.opensearch.action.bulk.BulkRequest request)
    • get

      org.opensearch.action.get.GetResponse get(org.opensearch.action.get.GetRequest request)
    • search

      org.opensearch.action.search.SearchResponse search(org.opensearch.action.search.SearchRequest request)
    • scroll

      org.opensearch.action.search.SearchResponse scroll(org.opensearch.action.search.SearchScrollRequest request)
    • clearScroll

      org.opensearch.action.search.ClearScrollResponse clearScroll(org.opensearch.action.search.ClearScrollRequest request)