# Changing elastic endpoint for elasticsearch-js client

**URL:** <https://discuss.elastic.co/t/changing-elastic-endpoint-for-elasticsearch-js-client/90258>\
**Category:** Elasticsearch\
**Created:** [June 21, 2017, 9:52am UTC](https://discuss.elastic.co/t/changing-elastic-endpoint-for-elasticsearch-js-client/90258 "2017-06-21T09:52:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndreyL](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andreyl/32/19365_2.png) [@AndreyL](https://discuss.elastic.co/u/AndreyL)\
**Post date:** [June 21, 2017, 9:52am UTC](https://discuss.elastic.co/t/changing-elastic-endpoint-for-elasticsearch-js-client/90258/1 "2017-06-21T09:52:11Z")

</div>

We expose elasticsearch to client applications via our custom api service; our endpoint is `/search` instead of `/_search` that elasticsearch.js client expects. How do I tell the `elasticsearch.js` client to use `/search` endpoint? I only see an option to provide the host url, not the actual endpoint.

In other words, if I specify host as '[myelastic.com](http://myelastic.com)' then the elasticsearch.js client will post the queries to `http://myelastic.com/_search` and I need it to post queries to `http://myelastic.com/search` (no underscore)

---

<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:** [June 21, 2017, 12:50pm UTC](https://discuss.elastic.co/t/changing-elastic-endpoint-for-elasticsearch-js-client/90258/2 "2017-06-21T12:50:57Z")

</div>

Don't use the client if it's not an elasticsearch server but your own application.

I don't understand what you are doing TBH.

---

<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 19, 2017, 12:51pm UTC](https://discuss.elastic.co/t/changing-elastic-endpoint-for-elasticsearch-js-client/90258/3 "2017-07-19T12:51:08Z")

</div>

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