# Script Transform

**URL:** <https://discuss.elastic.co/t/script-transform/22189>\
**Category:** Elasticsearch\
**Created:** [February 16, 2015, 1:27pm UTC](https://discuss.elastic.co/t/script-transform/22189 "2015-02-16T13:27:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![OJS](https://avatars.discourse-cdn.com/v4/letter/o/5f9b8f/32.png) [@OJS](https://discuss.elastic.co/u/OJS)\
**Post date:** [February 16, 2015, 1:27pm UTC](https://discuss.elastic.co/t/script-transform/22189/1 "2015-02-16T13:27:31Z")

</div>

Hello All,

I am trying to index a document with escaped JSON string as a field. This  
field is a JSON representation of a legal document.

I want to extract the document text for analysis (the string also includes  
formatting data e.g. style info, paragraph info, line breaks etc ).  
So far I have tried to use a transform script to do this, my approach has  
been to write a script that

1. Converts the string to JSON object
2. Load a mustache template
3. Use mustache template to extract text for analysis

This has not worked so the question is

Is this possible?  
If not, is there another approach I can use?

I would prefer to use the transform approach as the content does not change  
and this step is only required for analysis.

Many thanks

OJS

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f645e190-8c73-4c21-9b34-2e5baad00ced%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f645e190-8c73-4c21-9b34-2e5baad00ced%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:32am UTC](https://discuss.elastic.co/t/script-transform/22189/2 "2017-07-06T00:32:27Z")

</div>

Closed on July 6, 2017, 12:32am UTC


