# Specifying X-Enterprise-Search-Analytics with the Node.js client.app.searchEsSearch method?

**URL:** <https://discuss.elastic.co/t/specifying-x-enterprise-search-analytics-with-the-node-js-client-app-searchessearch-method/348347>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [November 30, 2023, 5:01pm UTC](https://discuss.elastic.co/t/specifying-x-enterprise-search-analytics-with-the-node-js-client-app-searchessearch-method/348347 "2023-11-30T17:01:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gagravarr](https://avatars.discourse-cdn.com/v4/letter/g/ba9def/32.png) [@gagravarr](https://discuss.elastic.co/u/gagravarr)\
**Post date:** [November 30, 2023, 5:01pm UTC](https://discuss.elastic.co/t/specifying-x-enterprise-search-analytics-with-the-node-js-client-app-searchessearch-method/348347/1 "2023-11-30T17:01:20Z")

</div>

I'm using App Search, and for one quite complex query I need to make an Elasticsearch search rather than an App Search search

As I'm working in NodeJS, I'm doing that with a `client.app.searchEsSearch` call

In the App Search docs for the Elasticsearch Search api, at [Elasticsearch search API for App Search | App Search documentation [8.11] | Elastic](https://www.elastic.co/guide/en/app-search/current/elasticsearch-search-api-reference.html#elasticsearch-search-api-reference-analytics-parameters) it suggests setting the `X-Enterprise-Search-Analytics` header so that the searches still show in analytics

However, I'm not sure how I can go about setting that header when using the Node.js client library. I can't seem to see it mentioned anywhere in the Node.js library docs at [App Search APIs | enterprise-search-js [8.11] | Elastic](https://www.elastic.co/guide/en/enterprise-search-clients/enterprise-search-node/8.11/app-search-api.html) . Does anyone know what the trick is to get that header set?

---

<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:** [December 28, 2023, 5:01pm UTC](https://discuss.elastic.co/t/specifying-x-enterprise-search-analytics-with-the-node-js-client-app-searchessearch-method/348347/2 "2023-12-28T17:01:35Z")

</div>

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