code: private boolean checkIfKeyExists(String key)
      {
          if (aggregationsKeySet == null)
          {
              aggregationsKeySet = new HashSet<String>();
          }
          return aggregationsKeySet.add(key);
      }
docs: Checks whether key exist in ES Query.
  
  @param key
  the key
  @return true, if is new key