# Convert ParseContext.Document to json

**URL:** <https://discuss.elastic.co/t/convert-parsecontext-document-to-json/40305>\
**Category:** Elasticsearch\
**Created:** [January 28, 2016, 12:01am UTC](https://discuss.elastic.co/t/convert-parsecontext-document-to-json/40305 "2016-01-28T00:01:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![krasnaya](https://avatars.discourse-cdn.com/v4/letter/k/6bbea6/32.png) [@krasnaya](https://discuss.elastic.co/u/krasnaya)\
**Post date:** [January 28, 2016, 12:01am UTC](https://discuss.elastic.co/t/convert-parsecontext-document-to-json/40305/1 "2016-01-28T00:01:48Z")

</div>

I'm trying to write an elasticsearch plugin where I return changes to an index, along with the documents that changed.

I have access to instances of `org.elasticsearch.index.mapper.ParseContext.Document`, but I can't figure out how to convert them to a JSON objects (similar to the "\_source" property that is usually returned in searches). Is there an easy way to do this?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:20pm UTC](https://discuss.elastic.co/t/convert-parsecontext-document-to-json/40305/2 "2017-07-05T23:20:55Z")

</div>


