code: @Override
      public void index(Class entityClazz, EntityMetadata metadata, Map<String, Object> values, Object parentId,
              Class parentClazz)
      {
          ObjectMapper mapper = new ObjectMapper();
          try
          {
              values.put("entity_class", metadata.getEntityClazz().getCanonicalName().toLowerCase());
              if (parentId != null)
              {
                  values.put(PARENT_ID_FIELD, parentId);
              }
              if (entityClazz != null)
              {
                  values.put(PARENT_ID_CLASS, parentClazz.getCanonicalName().toLowerCase());
              }
              String json = mapper.writeValueAsString(values);
              String idColumnName = ((AbstractAttribute) metadata.getIdAttribute()).getJPAColumnName();
              Object id = PropertyAccessorHelper.fromSourceToTargetClass(String.class,
                      ((AbstractAttribute) metadata.getIdAttribute()).getBindableJavaType(), values.get(idColumnName));
  
              ListenableActionFuture<IndexResponse> listenableActionFuture = client
                      .prepareIndex(metadata.getSchema().toLowerCase(), entityClazz.getSimpleName(), id.toString())
                      .setSource(json).execute();
              IndexResponse response = listenableActionFuture.actionGet();
          }
          catch (JsonGenerationException e)
          {
              log.error("Error while creating json document", e);
              throw new KunderaException(e);
          }
          catch (JsonMappingException e)
          {
              log.error("Error while creating json document", e);
              throw new KunderaException(e);
          }
          catch (IOException e)
          {
              log.error("Error while creating json document", e);
              throw new KunderaException(e);
          }
          catch (Exception e)
          {
              log.error("Error while creating indexes on document", e);
              throw new KunderaException(e);
          }
      }
docs: /*
  (non-Javadoc)
  
  @see com.impetus.kundera.index.Indexer#index(java.lang.Class,
  com.impetus.kundera.metadata.model.EntityMetadata, java.util.Map,
  java.lang.Object, java.lang.Class)