code: @Override
      public void put(String spaceId, String key, Map<String, Object> doc,
              IPutCallback<Map<String, Object>> callback) {
          try {
              byte[] data = documentToBytes(doc);
              Document _doc = createDocument(spaceId, key);
              _doc.add(new StoredField(FIELD_DATA, data));
              doc.forEach((k, v) -> {
                  Field field = createIndexField(k, v);
                  if (field != null) {
                      _doc.add(field);
                  }
              });
              IndexWriter indexWriter = getIndexWriter();
              indexWriter.updateDocument(buildIdTerm(spaceId, key), _doc);
              if (!isAsyncWrite()) {
                  indexWriter.commit();
              } else if (getIndexManager().getBackgroundCommitIndexPeriodMs() <= 0) {
                  LOGGER.warn("Async-write is enable, autoCommitPeriodMs must be larger than 0!");
              }
              if (callback != null) {
                  callback.onSuccess(spaceId, key, doc);
              }
          } catch (Throwable t) {
              if (callback != null) {
                  callback.onError(spaceId, key, doc, t);
              }
          }
      }
docs: {@inheritDoc}