@Override
  public Collection<Document> toDocuments(LuceneIndex index, Object value) {
    Document doc = new Document();
    PdxInstance pdx = (PdxInstance) value;
    for (String field : index.getFieldNames()) {
      if (pdx.hasField(field)) {
        Object fieldValue = pdx.getField(field);
        if (fieldValue == null) {
          continue;
        }
        SerializerUtil.addField(doc, field, fieldValue);
      }
    }
    if (logger.isDebugEnabled()) {
      logger.debug("PdxLuceneSerializer.toDocument:" + doc);
    }
    return Collections.singleton(doc);
  }
LuceneSerializer which can handle any PdxInstance
geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/repository/serializer/PdxLuceneSerializer.java