@Override
  public Collection<Document> toDocuments(LuceneIndex index, Object value) {
    Document doc = new Document();
    for (Field field : fields) {
      try {
        Object fieldValue = field.get(value);
        if (fieldValue == null) {
          continue;
        }
        SerializerUtil.addField(doc, field.getName(), fieldValue);
      } catch (IllegalArgumentException | IllegalAccessException e) {
        // TODO - what to do if we can't read a field?
      }
    }
    if (logger.isDebugEnabled()) {
      logger.debug("ReflectionLuceneSerializer.toDocument:" + doc);
    }
    return Collections.singleton(doc);
  }
A lucene serializer that handles a single class and can map an instance of that class to a
document using reflection.
geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/repository/serializer/ReflectionLuceneSerializer.java