Class ElasticIndexingClient


  • public class ElasticIndexingClient
    extends ElasticClient
    Created by The eXo Platform SAS Author : Thibault Clement tclement@exoplatform.com 9/1/15
    • Method Detail

      • sendCreateIndexRequest

        public boolean sendCreateIndexRequest​(String index,
                                              String settings,
                                              String mappings)
        Send request to ES to create a new index
      • sendCUDRequest

        public void sendCUDRequest​(String bulkRequest)
        Send request to ES to perform a C-reate, U-pdate or D-elete operation on a ES document
        Parameters:
        bulkRequest - JSON containing C-reate, U-pdate or D-elete operation
      • sendCreateAttachmentPipelineRequest

        public void sendCreateAttachmentPipelineRequest​(String index,
                                                        String pipelineName,
                                                        String processorMappings)
        Send request to ES to create a new Ingest pipeline for attachment
        Parameters:
        index -
        pipelineName -
        processorMappings -
      • sendCreateDocOnPipeline

        public void sendCreateDocOnPipeline​(String index,
                                            String id,
                                            String pipelineName,
                                            String pipelineRequestOperation)
        Send request to ES to create a new Ingest pipeline for attachment
        Parameters:
        index -
        id -
        pipelineName -
        pipelineRequestOperation -
      • sendCreateIndexAliasRequest

        public void sendCreateIndexAliasRequest​(String index,
                                                String oldIndex,
                                                String indexAlias)
        Send request to ES to create a new index alias for new ES Index and remove it from old index if exists
      • sendGetIndexAliasesRequest

        public Set<String> sendGetIndexAliasesRequest​(String index)
        Send request to ES to get index aliases
      • sendCountIndexObjectsRequest

        public long sendCountIndexObjectsRequest​(String index)
        Send request to ES to count all documents found in index
      • sendGetESVersion

        public String sendGetESVersion()
        Send request to ES to get version
      • sendDeleteIndexRequest

        public void sendDeleteIndexRequest​(String index)
        Deletes an index from ES
        Parameters:
        index - index name to delete
      • sendReindexTypeRequest

        public void sendReindexTypeRequest​(String index,
                                           String oldIndex,
                                           String type,
                                           String pipeline)
        This operation reindex the documents from old index/type to new index/type mapping. A pipeline could be used when reindexing in case Ingest Attachment plugin is used by a target type.
        Parameters:
        index - target index name
        oldIndex - source index name
        type - source type name
        pipeline - target pipeline name (optional)
      • sendIsIndexExistsRequest

        public boolean sendIsIndexExistsRequest​(String index)
        Send request to ES to test if index exists
        Parameters:
        index - ES index
        Returns:
        true if index exists in ES
      • resetMaxConnections

        protected void resetMaxConnections()