Class ElasticIndexingClient

java.lang.Object
org.exoplatform.commons.search.es.client.ElasticClient
org.exoplatform.commons.search.es.client.ElasticIndexingClient

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

  • Constructor Details

  • Method Details

    • 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
    • sendDeleteAllDocsRequest

      public void sendDeleteAllDocsRequest(String index)
      Send request to ES to delete all documents of the given type
    • 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 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
    • 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
    • getEsUsernameProperty

      protected String getEsUsernameProperty()
      Specified by:
      getEsUsernameProperty in class ElasticClient
    • getEsPasswordProperty

      protected String getEsPasswordProperty()
      Specified by:
      getEsPasswordProperty in class ElasticClient
    • getClientConnectionManager

      protected org.apache.http.conn.HttpClientConnectionManager getClientConnectionManager()
      Specified by:
      getClientConnectionManager in class ElasticClient
    • getMaxConnections

      protected int getMaxConnections()
      Overrides:
      getMaxConnections in class ElasticClient
    • resetMaxConnections

      protected void resetMaxConnections()