Class ElasticsearchUtil


  • public abstract class ElasticsearchUtil
    extends java.lang.Object
    Utility methods for Elasticsearch big data implementation.
    Since:
    8.1.0
    Version:
    $Revision: 26156 $ $Date: 2024-01-13 10:26:46 -0300 (Sat, 13 Jan 2024) $
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ElasticsearchUtil.Client
      Elasticsearch client-related operations.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.Object> convertFieldAndValuesToElasticsearch​(java.util.Map<DocumentTypeField,​java.lang.Object> fieldValues)
      Method responsable for perform the conversion of DocumentTypeField to the correct elasticsearch field, also this will convert the value to the right format.
      static java.lang.Object getValueInMapChain​(java.lang.String key, java.util.Map currentObject)
      Returns event field value from the given object by your full key id.
      static java.util.List<java.lang.Object> getValuesInMapChain​(java.lang.String key, java.lang.Object currentObject)
      Returns event field values from the given object by your full key id.
      static void putValueInMapChain​(java.lang.String key, java.lang.Object value, java.util.Map map)
      Create a chain of Maps and put the value in the most inner map.
      static java.lang.String toJson​(co.elastic.clients.json.JsonpSerializable obj)
      Returns the JSON representation of a Elasticsearch client object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ElasticsearchUtil

        public ElasticsearchUtil()
    • Method Detail

      • getValueInMapChain

        public static java.lang.Object getValueInMapChain​(java.lang.String key,
                                                          java.util.Map currentObject)
        Returns event field value from the given object by your full key id.
        Parameters:
        key - the event field identifier.
        currentObject - the current object.
        Returns:
        event value in chain map.
        Since:
        12.2.0
      • getValuesInMapChain

        public static java.util.List<java.lang.Object> getValuesInMapChain​(java.lang.String key,
                                                                           java.lang.Object currentObject)
        Returns event field values from the given object by your full key id.
        Parameters:
        key - the event field identifier.
        currentObject - the current object.
        Returns:
        event values in chain map.
        Since:
        12.2.0
      • putValueInMapChain

        public static void putValueInMapChain​(java.lang.String key,
                                              java.lang.Object value,
                                              java.util.Map map)
        Create a chain of Maps and put the value in the most inner map.
        Parameters:
        key - the id of event for chain identifier.
        value - the value to store
        map - the root chain.
        Since:
        12.0.0
      • convertFieldAndValuesToElasticsearch

        public static java.util.Map<java.lang.String,​java.lang.Object> convertFieldAndValuesToElasticsearch​(java.util.Map<DocumentTypeField,​java.lang.Object> fieldValues)
        Method responsable for perform the conversion of DocumentTypeField to the correct elasticsearch field, also this will convert the value to the right format.
        Parameters:
        fieldValues - the map of DocumentTypeField and relative value.
        Returns:
        the converted map to elasticsearch field and value.
        Since:
        12.3.0
      • toJson

        public static java.lang.String toJson​(co.elastic.clients.json.JsonpSerializable obj)
        Returns the JSON representation of a Elasticsearch client object.
        Parameters:
        obj - the Elasticsearch client object that may be JSON serializable.
        Returns:
        the JSON.
        Since:
        16.1.0