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 Detail

      • getVersionInformation

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

        com.fasterxml.jackson.databind.JsonNode createIndex​(String indexName,
                                                            String alias,
                                                            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​(String alias,
                                 String index)
        Creates a new alias for the given index.
      • swapAlias

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

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

        void synchronousIndexDocumentRequest​(String index,
                                             String id,
                                             com.fasterxml.jackson.databind.node.ObjectNode objectNode,
                                             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​(String index,
                                              String id,
                                              com.fasterxml.jackson.databind.node.ObjectNode objectNode,
                                              com.fasterxml.jackson.databind.node.ObjectNode scriptNode)
      • updateByQuery

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

        void deleteDocument​(String alias,
                            String id)
      • deleteByQuery

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

        void deleteAliasForIndex​(String alias,
                                 String index)
      • deleteAliasAndRelatedIndices

        void deleteAliasAndRelatedIndices​(String alias)
      • deleteIndexIfExists

        void deleteIndexIfExists​(String index)
      • deleteAllIndicesWithPrefix

        void deleteAllIndicesWithPrefix​(String prefix)
      • indexExists

        boolean indexExists​(String index)
      • refreshIndex

        void refreshIndex​(String index)
      • getIndexNameForAlias

        String getIndexNameForAlias​(String alias)
      • getById

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

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

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

        void createCustomAlias​(String alias,
                               String indexMapping)
      • getIndexCurrentMapping

        com.fasterxml.jackson.databind.JsonNode getIndexCurrentMapping​(String index)
      • getIndexCurrentSettings

        com.fasterxml.jackson.databind.JsonNode getIndexCurrentSettings​(String index)
      • updateIndexMetaData

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

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

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