Class JMElasticsearchClient

  • All Implemented Interfaces:
    Closeable, AutoCloseable, org.elasticsearch.client.Client, org.elasticsearch.client.ElasticsearchClient, org.elasticsearch.common.lease.Releasable

    public class JMElasticsearchClient
    extends org.elasticsearch.transport.client.PreBuiltTransportClient
    The type Jm elasticsearch client.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.elasticsearch.client.transport.TransportClient

        org.elasticsearch.client.transport.TransportClient.HostFailureListener
    • Field Summary

      • Fields inherited from class org.elasticsearch.client.transport.TransportClient

        CLIENT_TRANSPORT_NODES_SAMPLER_INTERVAL, CLIENT_TRANSPORT_PING_TIMEOUT, CLIENT_TYPE, namedWriteableRegistry, TRANSPORT_CLIENT_FEATURE
      • Fields inherited from class org.elasticsearch.client.support.AbstractClient

        logger
      • Fields inherited from interface org.elasticsearch.client.Client

        CLIENT_TYPE_SETTING_S
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean create​(String index)
      Create boolean.
      List<String> extractIdList​(String index, String type, org.elasticsearch.index.query.QueryBuilder filterQueryBuilder)
      Extract id list list.
      List<String> extractIdList​(org.elasticsearch.action.search.SearchResponse searchResponse)
      Extract id list list.
      List<String> getAllIdList​(String index, String type)
      Gets all id list.
      Set<String> getAllIndices()
      Gets all indices.
      Map<String,​org.elasticsearch.action.admin.indices.stats.IndexStats> getAllIndicesStats()
      Gets all indices stats.
      List<String> getFilteredIndexList​(String containedString)
      Gets filtered index list.
      Optional<Map<String,​?>> getMappings​(String index, String type)
      Gets mappings.
      org.elasticsearch.common.collect.ImmutableOpenMap<String,​org.elasticsearch.common.collect.ImmutableOpenMap<String,​org.elasticsearch.cluster.metadata.MappingMetaData>> getMappingsResponse​(String... indices)
      Gets mappings response.
      org.elasticsearch.action.get.GetResponse getQuery​(org.elasticsearch.action.get.GetRequestBuilder getRequestBuilder)
      Gets query.
      static org.elasticsearch.common.settings.Settings.Builder getSettingsBuilder​(String nodeName, boolean clientTransportSniff, String clusterName)
      Gets settings builder.
      boolean isExists​(String index)
      Is exists boolean.
      org.elasticsearch.action.update.UpdateResponse updateQuery​(org.elasticsearch.action.update.UpdateRequestBuilder updateRequestBuilder)
      Update query update response.
      • Methods inherited from class org.elasticsearch.transport.client.PreBuiltTransportClient

        close
      • Methods inherited from class org.elasticsearch.client.transport.TransportClient

        addPlugins, addPlugins, addTransportAddress, addTransportAddresses, connectedNodes, doExecute, filteredNodes, listedNodes, removeTransportAddress, transportAddresses
      • Methods inherited from class org.elasticsearch.client.support.AbstractClient

        admin, bulk, bulk, clearScroll, clearScroll, delete, delete, execute, execute, explain, explain, fieldCaps, fieldCaps, filterWithHeader, get, get, index, index, multiGet, multiGet, multiSearch, multiSearch, multiTermVectors, multiTermVectors, prepareBulk, prepareBulk, prepareClearScroll, prepareDelete, prepareDelete, prepareExecute, prepareExplain, prepareFieldCaps, prepareGet, prepareGet, prepareIndex, prepareIndex, prepareIndex, prepareMultiGet, prepareMultiSearch, prepareMultiTermVectors, prepareSearch, prepareSearchScroll, prepareTermVector, prepareTermVector, prepareTermVectors, prepareTermVectors, prepareUpdate, prepareUpdate, search, search, searchScroll, searchScroll, settings, termVector, termVector, termVectors, termVectors, threadPool, update, update
      • Methods inherited from interface org.elasticsearch.client.Client

        getRemoteClusterClient
    • Constructor Detail

      • JMElasticsearchClient

        public JMElasticsearchClient()
        Instantiates a new Jm elasticsearch client.
      • JMElasticsearchClient

        public JMElasticsearchClient​(String elasticsearchConnect)
        Instantiates a new Jm elasticsearch client.
        Parameters:
        elasticsearchConnect - the elasticsearch connect
      • JMElasticsearchClient

        public JMElasticsearchClient​(String elasticsearchConnect,
                                     boolean clientTransportSniff)
        Instantiates a new Jm elasticsearch client.
        Parameters:
        elasticsearchConnect - the elasticsearch connect
        clientTransportSniff - the client transport sniff
      • JMElasticsearchClient

        public JMElasticsearchClient​(String elasticsearchConnect,
                                     boolean clientTransportSniff,
                                     String clusterName)
        Instantiates a new Jm elasticsearch client.
        Parameters:
        elasticsearchConnect - the elasticsearch connect
        clientTransportSniff - the client transport sniff
        clusterName - the cluster name
      • JMElasticsearchClient

        public JMElasticsearchClient​(String elasticsearchConnect,
                                     String nodeName)
        Instantiates a new Jm elasticsearch client.
        Parameters:
        elasticsearchConnect - the elasticsearch connect
        nodeName - the node name
      • JMElasticsearchClient

        public JMElasticsearchClient​(String elasticsearchConnect,
                                     String nodeName,
                                     boolean clientTransportSniff)
        Instantiates a new Jm elasticsearch client.
        Parameters:
        elasticsearchConnect - the elasticsearch connect
        nodeName - the node name
        clientTransportSniff - the client transport sniff
      • JMElasticsearchClient

        public JMElasticsearchClient​(String elasticsearchConnect,
                                     String nodeName,
                                     boolean clientTransportSniff,
                                     String clusterName)
        Instantiates a new Jm elasticsearch client.
        Parameters:
        elasticsearchConnect - the elasticsearch connect
        nodeName - the node name
        clientTransportSniff - the client transport sniff
        clusterName - the cluster name
      • JMElasticsearchClient

        public JMElasticsearchClient​(String elasticsearchConnect,
                                     org.elasticsearch.common.settings.Settings settings)
        Instantiates a new Jm elasticsearch client.
        Parameters:
        elasticsearchConnect - the elasticsearch connect
        settings - the settings
    • Method Detail

      • getSettingsBuilder

        public static org.elasticsearch.common.settings.Settings.Builder getSettingsBuilder​(String nodeName,
                                                                                            boolean clientTransportSniff,
                                                                                            String clusterName)
        Gets settings builder.
        Parameters:
        nodeName - the node name
        clientTransportSniff - the client transport sniff
        clusterName - the cluster name
        Returns:
        the settings builder
      • isExists

        public boolean isExists​(String index)
        Is exists boolean.
        Parameters:
        index - the index
        Returns:
        the boolean
      • create

        public boolean create​(String index)
        Create boolean.
        Parameters:
        index - the index
        Returns:
        the boolean
      • extractIdList

        public List<String> extractIdList​(org.elasticsearch.action.search.SearchResponse searchResponse)
        Extract id list list.
        Parameters:
        searchResponse - the search response
        Returns:
        the list
      • getAllIdList

        public List<String> getAllIdList​(String index,
                                         String type)
        Gets all id list.
        Parameters:
        index - the index
        type - the type
        Returns:
        the all id list
      • extractIdList

        public List<String> extractIdList​(String index,
                                          String type,
                                          org.elasticsearch.index.query.QueryBuilder filterQueryBuilder)
        Extract id list list.
        Parameters:
        index - the index
        type - the type
        filterQueryBuilder - the filter query builder
        Returns:
        the list
      • getMappingsResponse

        public org.elasticsearch.common.collect.ImmutableOpenMap<String,​org.elasticsearch.common.collect.ImmutableOpenMap<String,​org.elasticsearch.cluster.metadata.MappingMetaData>> getMappingsResponse​(String... indices)
        Gets mappings response.
        Parameters:
        indices - the indices
        Returns:
        the mappings response
      • getAllIndicesStats

        public Map<String,​org.elasticsearch.action.admin.indices.stats.IndexStats> getAllIndicesStats()
        Gets all indices stats.
        Returns:
        the all indices stats
      • getAllIndices

        public Set<String> getAllIndices()
        Gets all indices.
        Returns:
        the all indices
      • getFilteredIndexList

        public List<String> getFilteredIndexList​(String containedString)
        Gets filtered index list.
        Parameters:
        containedString - the contained string
        Returns:
        the filtered index list
      • getQuery

        public org.elasticsearch.action.get.GetResponse getQuery​(org.elasticsearch.action.get.GetRequestBuilder getRequestBuilder)
        Gets query.
        Parameters:
        getRequestBuilder - the get request builder
        Returns:
        the query
      • updateQuery

        public org.elasticsearch.action.update.UpdateResponse updateQuery​(org.elasticsearch.action.update.UpdateRequestBuilder updateRequestBuilder)
        Update query update response.
        Parameters:
        updateRequestBuilder - the update request builder
        Returns:
        the update response
      • getMappings

        public Optional<Map<String,​?>> getMappings​(String index,
                                                         String type)
        Gets mappings.
        Parameters:
        index - the index
        type - the type
        Returns:
        the mappings