# Converting builder types

**URL:** <https://discuss.elastic.co/t/converting-builder-types/8090>\
**Category:** Elasticsearch\
**Created:** [June 13, 2012, 9:30pm UTC](https://discuss.elastic.co/t/converting-builder-types/8090 "2012-06-13T21:30:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [June 13, 2012, 9:30pm UTC](https://discuss.elastic.co/t/converting-builder-types/8090/1 "2012-06-13T21:30:14Z")

</div>

For the sake of simplicity, I am trying to convert a single  
SpanTermQueryBuilder to a TermQueryBuilder. What is the simplest way  
to achieve this goal, without going to JSON and back?

Cheers,

Ivan

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 14, 2012, 9:42pm UTC](https://discuss.elastic.co/t/converting-builder-types/8090/2 "2012-06-14T21:42:01Z")

</div>

Nothing jumps to mind, there isn't a getter for the relevant values...

On Wed, Jun 13, 2012 at 11:30 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> For the sake of simplicity, I am trying to convert a single  
> SpanTermQueryBuilder to a TermQueryBuilder. What is the simplest way  
> to achieve this goal, without going to JSON and back?
> 
> Cheers,
> 
> Ivan

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [June 15, 2012, 4:14pm UTC](https://discuss.elastic.co/t/converting-builder-types/8090/3 "2012-06-15T16:14:16Z")

</div>

I figured as much! No harm using a SpanTermQuery, just wanted to get  
my queries as simple as possible.

--  
Ivan

On Thu, Jun 14, 2012 at 2:42 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Nothing jumps to mind, there isn't a getter for the relevant values...
> 
> On Wed, Jun 13, 2012 at 11:30 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> 
> > For the sake of simplicity, I am trying to convert a single  
> > SpanTermQueryBuilder to a TermQueryBuilder. What is the simplest way  
> > to achieve this goal, without going to JSON and back?
> > 
> > Cheers,
> > 
> > Ivan

---

<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, 3:23am UTC](https://discuss.elastic.co/t/converting-builder-types/8090/4 "2017-07-06T03:23:52Z")

</div>

Closed on July 6, 2017, 3:23am UTC


