# Parse ShapeBuilder from SearchHit

**URL:** <https://discuss.elastic.co/t/parse-shapebuilder-from-searchhit/72045>\
**Category:** Elasticsearch\
**Created:** [January 18, 2017, 4:01pm UTC](https://discuss.elastic.co/t/parse-shapebuilder-from-searchhit/72045 "2017-01-18T16:01:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Hudson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brian_hudson/32/1306_2.png) [@Brian\_Hudson](https://discuss.elastic.co/u/Brian_Hudson)\
**Post date:** [January 18, 2017, 4:01pm UTC](https://discuss.elastic.co/t/parse-shapebuilder-from-searchhit/72045/1 "2017-01-18T16:01:46Z")

</div>

I have a `SearchHit` whose source contains several fields, one of which is a field called "shape" which is a `geo_shape`.

Using the Java API, is there a good way of parsing this field into a `ShapeBuilder`?

`ShapeBuilder` has a `parse(XContentParser)` method which appears to do what I need but I haven't found an easy way getting the `XContentParser` needed from the `SearchHit`.

---

<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:** [February 15, 2017, 4:01pm UTC](https://discuss.elastic.co/t/parse-shapebuilder-from-searchhit/72045/2 "2017-02-15T16:01:47Z")

</div>

Closed on February 15, 2017, 4:01pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
