# TransportClient builder query

**URL:** <https://discuss.elastic.co/t/transportclient-builder-query/138083>\
**Category:** Elasticsearch\
**Created:** [July 1, 2018, 2:59pm UTC](https://discuss.elastic.co/t/transportclient-builder-query/138083 "2018-07-01T14:59:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkshara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pkshara/32/48222_2.png) [@pkshara](https://discuss.elastic.co/u/pkshara)\
**Post date:** [July 1, 2018, 2:59pm UTC](https://discuss.elastic.co/t/transportclient-builder-query/138083/1 "2018-07-01T14:59:48Z")

</div>

Hi Team,

SearchResponse res = client.prepareSearch("logstash\_stack\_index")  
.setTypes("logs")  
.setSearchType(SearchType.DFS\_QUERY\_THEN\_FETCH)  
.setQuery(QueryBuilders.matchQuery("Errors", "org.springframework.jdbc.CannotGetJdbcConnectionException"))  
.execute()  
.actionGet();

By using above code snippet i am searching index hits , which contains errorlog of org.springframework.jdbc.CannotGetJdbcConnectionException.

If i want to matchquery for 2 more errors, is there any way to give OR condition ?? or should i use if case for searchquery.

Can you please suggest for the same.

Thank you

---

<div class="post-metadata">

**Author:** ![pkshara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pkshara/32/48222_2.png) [@pkshara](https://discuss.elastic.co/u/pkshara)\
**Post date:** [July 2, 2018, 11:03am UTC](https://discuss.elastic.co/t/transportclient-builder-query/138083/2 "2018-07-02T11:03:16Z")

</div>

Solved

---

<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 30, 2018, 11:03am UTC](https://discuss.elastic.co/t/transportclient-builder-query/138083/3 "2018-07-30T11:03:16Z")

</div>

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