# Is there any alternate way for connecting Elasticsearch from C++ code except ODBC?

**URL:** https://discuss.elastic.co/t/is-there-any-alternate-way-for-connecting-elasticsearch-from-c-code-except-odbc/269837
**Category:** Elasticsearch
**Created:** [April 12, 2021, 6:50am UTC](https://discuss.elastic.co/t/is-there-any-alternate-way-for-connecting-elasticsearch-from-c-code-except-odbc/269837 "2021-04-12T06:50:49Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![onkark](https://avatars.discourse-cdn.com/v4/letter/o/bbce88/32.png) [@onkark](https://discuss.elastic.co/u/onkark)
#### Post date: [April 12, 2021, 6:50am UTC](https://discuss.elastic.co/t/is-there-any-alternate-way-for-connecting-elasticsearch-from-c-code-except-odbc/269837/1 "2021-04-12T06:50:49Z")

</div>

I tried fetching data of Elasticsearch from C++ code using Elasticsearch ODBC. As elasticsearch is known for its fast fetching speed, I'm not getting the expected performance using ODBC as compared to other RDBMS. So, can anyone suggest me the any other way, other than Elasticsearch ODBC to connect Elasticsearch from C++ code where the speed of fetching documents from Elasticsearch needs to be considered ?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 12, 2021, 8:33am UTC](https://discuss.elastic.co/t/is-there-any-alternate-way-for-connecting-elasticsearch-from-c-code-except-odbc/269837/2 "2021-04-12T08:33:30Z")

</div>

Could you share the query you are running?

---

<div class="post-metadata">

### Author: ![onkark](https://avatars.discourse-cdn.com/v4/letter/o/bbce88/32.png) [@onkark](https://discuss.elastic.co/u/onkark)
#### Post date: [April 12, 2021, 8:46am UTC](https://discuss.elastic.co/t/is-there-any-alternate-way-for-connecting-elasticsearch-from-c-code-except-odbc/269837/3 "2021-04-12T08:46:28Z")

</div>

The query is as simple as 'select empno, empname, address from emp where empno = 123'

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 12, 2021, 8:59am UTC](https://discuss.elastic.co/t/is-there-any-alternate-way-for-connecting-elasticsearch-from-c-code-except-odbc/269837/4 "2021-04-12T08:59:54Z")

</div>

How long does it take?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 12, 2021, 9:49am UTC](https://discuss.elastic.co/t/is-there-any-alternate-way-for-connecting-elasticsearch-from-c-code-except-odbc/269837/5 "2021-04-12T09:49:47Z")

</div>

It looks like you already opened a discussion which is similar at [Elasticsearch SQL ODBC taking more time than previous version](https://discuss.elastic.co/t/elasticsearch-sql-odbc-taking-more-time-than-previous-version/269442)

I suggest that we keep the discussion there.

---

<div class="post-metadata">

### Author: ![onkark](https://avatars.discourse-cdn.com/v4/letter/o/bbce88/32.png) [@onkark](https://discuss.elastic.co/u/onkark)
#### Post date: [April 12, 2021, 10:19am UTC](https://discuss.elastic.co/t/is-there-any-alternate-way-for-connecting-elasticsearch-from-c-code-except-odbc/269837/6 "2021-04-12T10:19:18Z")

</div>

It is approx. 400 milliseconds. The time is not taken immediately after starting node, but after warming up the indices. The time is much as compared to other RDBMS where they take only 20-30 milliseconds.

---

<div class="post-metadata">

### Author: ![bogdan.pintea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bogdan.pintea/32/45740_2.png) [@bogdan.pintea](https://discuss.elastic.co/u/bogdan.pintea)
#### Post date: [April 12, 2021, 2:47pm UTC](https://discuss.elastic.co/t/is-there-any-alternate-way-for-connecting-elasticsearch-from-c-code-except-odbc/269837/7 "2021-04-12T14:47:06Z")

</div>

> [@onkark](#):
>
> can anyone suggest me the any other way, other than Elasticsearch ODBC to connect Elasticsearch from C++ code

If u only need to connect to Elasticsearch'es REST [search API](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html) - ie. if Query DSL is an option - there seems to be a community [C++ client](https://www.elastic.co/guide/en/elasticsearch/client/community/current/index.html#cpp). Don't know if it supports other API's, like [SQL](https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-rest.html) or up to date.

But I also recommend troubleshooting your environment, to find out what's the cause of the delays you're getting, the ODBC driver is just a thin layer.

---

<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: [May 10, 2021, 2:47pm UTC](https://discuss.elastic.co/t/is-there-any-alternate-way-for-connecting-elasticsearch-from-c-code-except-odbc/269837/8 "2021-05-10T14:47:46Z")

</div>

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