Interface ElasticsearchClient

All Known Implementing Classes:
ElasticsearchClientImpl

public interface ElasticsearchClient
Low-level operations for Elasticsearch. Doesn't know anything about aliases, this must be handled in the layer above.
  • Method Summary

    Modifier and Type Method Description
    void createAliasForIndex​(java.lang.String alias, java.lang.String index)
    Creates a new alias for the given index.
    void createCustomAlias​(java.lang.String alias, java.lang.String indexMapping)  
    com.fasterxml.jackson.databind.JsonNode createIndex​(java.lang.String indexName, java.lang.String alias, java.lang.String indexMapping)
    Creates an index with the given name and creates an alias with the same name at the same time.
    void deleteAliasAndRelatedIndices​(java.lang.String alias)  
    void deleteAliasForIndex​(java.lang.String alias, java.lang.String index)  
    void deleteAllIndicesWithPrefix​(java.lang.String prefix)  
    void deleteByQuery​(java.lang.String index, com.fasterxml.jackson.databind.node.ObjectNode requestNode)  
    void deleteDocument​(java.lang.String alias, java.lang.String id)  
    void deleteIndexIfExists​(java.lang.String index)  
    com.fasterxml.jackson.databind.JsonNode getById​(java.lang.String index, java.lang.String id)  
    com.fasterxml.jackson.databind.JsonNode getIndexCurrentMapping​(java.lang.String index)  
    java.lang.String getIndexNameForAlias​(java.lang.String alias)  
    org.elasticsearch.client.RestHighLevelClient getRestHighLevelClient()  
    org.elasticsearch.client.RestClient getRestLowLevelClient()  
    com.fasterxml.jackson.databind.JsonNode getVersionInformation()  
    boolean indexExists​(java.lang.String index)  
    com.fasterxml.jackson.databind.JsonNode query​(java.lang.String index, com.fasterxml.jackson.databind.node.ObjectNode queryBody)  
    com.fasterxml.jackson.databind.JsonNode query​(java.lang.String index, java.lang.String queryBody)  
    void refreshIndex​(java.lang.String index)  
    void swapAlias​(java.lang.String alias, java.lang.String oldIndexName, java.lang.String newIndexName)
    Swaps the alias from one index to another index.
    void synchronousIndexDocumentRequest​(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode, java.lang.Long version)
    Indexes a document using external versioning through Elasticsearch Index API, overriding the whole document.
    void synchronousUpdateDocumentRequest​(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode, com.fasterxml.jackson.databind.node.ObjectNode scriptNode)  
    void synchronousUpsertDocumentRequest​(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode)
    Indexes a document using an upsert query
    void updateAliasMapping​(java.lang.String indexName, java.lang.String aliasName, com.fasterxml.jackson.databind.JsonNode indexMapping)  
    void updateByQuery​(java.lang.String index, com.fasterxml.jackson.databind.node.ObjectNode requestNode)  
    void updateIndexMapping​(java.lang.String indexName, com.fasterxml.jackson.databind.JsonNode mappingDelta)  
    void updateIndexMetaData​(java.lang.String index, com.fasterxml.jackson.databind.JsonNode metaData)  
  • Method Details

    • getVersionInformation

      com.fasterxml.jackson.databind.JsonNode getVersionInformation()
    • createIndex

      com.fasterxml.jackson.databind.JsonNode createIndex​(java.lang.String indexName, java.lang.String alias, java.lang.String indexMapping)
      Creates an index with the given name and creates an alias with the same name at the same time.
      Parameters:
      indexName - The name of the index.
      alias - The alias name for the index. If alias is null, NO alias will be created, but the index still will be created.
      indexMapping - The full ES mapping json that will be created.
    • createAliasForIndex

      void createAliasForIndex​(java.lang.String alias, java.lang.String index)
      Creates a new alias for the given index.
    • swapAlias

      void swapAlias​(java.lang.String alias, java.lang.String oldIndexName, java.lang.String newIndexName)
      Swaps the alias from one index to another index.
    • synchronousUpsertDocumentRequest

      void synchronousUpsertDocumentRequest​(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode)
      Indexes a document using an upsert query
    • synchronousIndexDocumentRequest

      void synchronousIndexDocumentRequest​(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode, java.lang.Long version)
      Indexes a document using external versioning through Elasticsearch Index API, overriding the whole document. Update API is not available for external versioning.
    • synchronousUpdateDocumentRequest

      void synchronousUpdateDocumentRequest​(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode, com.fasterxml.jackson.databind.node.ObjectNode scriptNode)
    • updateByQuery

      void updateByQuery​(java.lang.String index, com.fasterxml.jackson.databind.node.ObjectNode requestNode)
    • deleteDocument

      void deleteDocument​(java.lang.String alias, java.lang.String id)
    • deleteByQuery

      void deleteByQuery​(java.lang.String index, com.fasterxml.jackson.databind.node.ObjectNode requestNode)
    • deleteAliasForIndex

      void deleteAliasForIndex​(java.lang.String alias, java.lang.String index)
    • deleteAliasAndRelatedIndices

      void deleteAliasAndRelatedIndices​(java.lang.String alias)
    • deleteIndexIfExists

      void deleteIndexIfExists​(java.lang.String index)
    • deleteAllIndicesWithPrefix

      void deleteAllIndicesWithPrefix​(java.lang.String prefix)
    • indexExists

      boolean indexExists​(java.lang.String index)
    • refreshIndex

      void refreshIndex​(java.lang.String index)
    • getIndexNameForAlias

      java.lang.String getIndexNameForAlias​(java.lang.String alias)
    • getById

      com.fasterxml.jackson.databind.JsonNode getById​(java.lang.String index, java.lang.String id)
    • query

      com.fasterxml.jackson.databind.JsonNode query​(java.lang.String index, java.lang.String queryBody)
    • query

      com.fasterxml.jackson.databind.JsonNode query​(java.lang.String index, com.fasterxml.jackson.databind.node.ObjectNode queryBody)
    • getRestLowLevelClient

      org.elasticsearch.client.RestClient getRestLowLevelClient()
    • getRestHighLevelClient

      org.elasticsearch.client.RestHighLevelClient getRestHighLevelClient()
    • createCustomAlias

      void createCustomAlias​(java.lang.String alias, java.lang.String indexMapping)
    • getIndexCurrentMapping

      com.fasterxml.jackson.databind.JsonNode getIndexCurrentMapping​(java.lang.String index)
    • updateIndexMetaData

      void updateIndexMetaData​(java.lang.String index, com.fasterxml.jackson.databind.JsonNode metaData)
    • updateAliasMapping

      void updateAliasMapping​(java.lang.String indexName, java.lang.String aliasName, com.fasterxml.jackson.databind.JsonNode indexMapping)
    • updateIndexMapping

      void updateIndexMapping​(java.lang.String indexName, com.fasterxml.jackson.databind.JsonNode mappingDelta)