# Elastic App Search Analytics

**URL:** https://discuss.elastic.co/t/elastic-app-search-analytics/295204
**Category:** Elastic Search
**Created:** [January 24, 2022, 9:13am UTC](https://discuss.elastic.co/t/elastic-app-search-analytics/295204 "2022-01-24T09:13:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![aly](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@aly](https://discuss.elastic.co/u/aly)
#### Post date: [January 24, 2022, 9:13am UTC](https://discuss.elastic.co/t/elastic-app-search-analytics/295204/1 "2022-01-24T09:13:11Z")

</div>

Hello,

I am building a custom dashboard where I would like to display all my users search queries, top queries, top queries no results and many other statistics for the past 1 year using elastic app search analytics API ([Analytics APIs | Elastic App Search Documentation [7.16] | Elastic](https://www.elastic.co/guide/en/app-search/current/analytics.html)). I was wondering whether it is possible to show data prior to 180days as in the elastic app search dashboard it states that “Your analytics are stored for at least 180 days”.

1. Can I fetch data the for the last one year ?
2. Can I create a snapshot of the data at the end of the year (before deletion) ?
3. Can I use ILM (index lifecycle management) to change lifecycle policy from 180-days-default ?
4. Do I have the ability to change the lifecycle policy for the indices related to the elastic app search ?
5. Is it possible to track the user created the search query using elasticAppSearch analytics API?
6. Am I able to fetch data before 7 days using elasticAppSearch analytics API?

---

<div class="post-metadata">

### Author: ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)
#### Post date: [February 1, 2022, 10:15pm UTC](https://discuss.elastic.co/t/elastic-app-search-analytics/295204/2 "2022-02-01T22:15:10Z")

</div>

Hi @aly ,

All good questions! I think that they can all be answered with [Log retention | Enterprise Search documentation [8.11] | Elastic](https://www.elastic.co/guide/en/enterprise-search/current/log-retention.html)

> 1. Can I fetch data the for the last one year ?

Yes, if you change your ILM policy to retain data that long, or disable ILM.

> 1. Can I create a snapshot of the data at the end of the year (before deletion) ?

Yes, if you'd changed your ILM policy to retain data that long, or disabled ILM.

> 1. Can I use ILM (index lifecycle management) to change lifecycle policy from 180-days-default ?

Yes! See my link above.

> 1. Do I have the ability to change the lifecycle policy for the indices related to the elastic app search ?

Yes! See my link above.

> 1. Is it possible to track the user created the search query using elasticAppSearch analytics API?

Check out our [Tags guide](https://www.elastic.co/guide/en/app-search/current/analytics-tags-guide.html). Since App Search uses a public search key, we don't automatically distinguish one "user" from another. It would be up to you to distinguish users and identify who was searching via a tag. Then you could filter by tag in the Analytics API.

> 1. Am I able to fetch data before 7 days using elasticAppSearch analytics API?

Assuming you mean _after_ 7 days - yes! As long as you've configured your ILM policy to retain data that long, or have disabled ILM.

---

<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: [November 4, 2022, 8:33am UTC](https://discuss.elastic.co/t/elastic-app-search-analytics/295204/3 "2022-11-04T08:33:53Z")

</div>


