# Analyzers at search/query time vs at index time

**URL:** <https://discuss.elastic.co/t/analyzers-at-search-query-time-vs-at-index-time/258175>\
**Category:** Elasticsearch\
**Created:** [December 9, 2020, 7:10pm UTC](https://discuss.elastic.co/t/analyzers-at-search-query-time-vs-at-index-time/258175 "2020-12-09T19:10:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_McAfee1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_mcafee1/32/47236_2.png) [@John\_McAfee1](https://discuss.elastic.co/u/John_McAfee1)\
**Post date:** [December 9, 2020, 7:10pm UTC](https://discuss.elastic.co/t/analyzers-at-search-query-time-vs-at-index-time/258175/1 "2020-12-09T19:10:41Z")

</div>

Hello!

My team and I are using analyzers both at search/query and when data is indexed.  
After revewing the Elastic documentation and a few web searches, I have not found a conclusive answerto my questions. I have two questions please.

Question 1: Is there a difference, based on performance, between using an analyzer  
at search/query time vs at index time?

Question 2: Is there a tool to measure the performance of analysis at search/query time vs at index time?

I assume the Query Profiler Tool can be used for search/query time analysis?

Thank you for your time!

John

---

<div class="post-metadata">

**Author:** ![mayya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mayya/32/83147_2.png) [@mayya](https://discuss.elastic.co/u/mayya)\
**Post date:** [December 9, 2020, 10:29pm UTC](https://discuss.elastic.co/t/analyzers-at-search-query-time-vs-at-index-time/258175/2 "2020-12-09T22:29:40Z")

</div>

I am wondering why is this a concern? What analyzer are you using? Usually analysis is a very fast process. Also, it is common to use the same analyzer during indexing and search so that your documents are queries will match.

In some cases, for example for synonyms, it is enough to use a synonym analyzer only during indexing or during querying. But here a relevant consideration is not speed, but if you want your synonyms to be updateable.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 9, 2020, 10:31pm UTC](https://discuss.elastic.co/t/analyzers-at-search-query-time-vs-at-index-time/258175/3 "2020-12-09T22:31:47Z")

</div>

> [@John\_McAfee1](#):
>
> Question 1: Is there a difference, based on performance, between using an analyzer  
> at search/query time vs at index time?

This isn't a definitive answer, but they should be close. The thing you need to ask is do you want to pay the cost of the analysis at index or query time? Query time is likely to add extra latency in the request for the user.

---

<div class="post-metadata">

**Author:** ![John\_McAfee1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_mcafee1/32/47236_2.png) [@John\_McAfee1](https://discuss.elastic.co/u/John_McAfee1)\
**Post date:** [December 14, 2020, 3:24pm UTC](https://discuss.elastic.co/t/analyzers-at-search-query-time-vs-at-index-time/258175/4 "2020-12-14T15:24:50Z")

</div>

Hello Mark and Mayya:

Thank you both for your responses!

-John

---

<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:** [January 11, 2021, 3:24pm UTC](https://discuss.elastic.co/t/analyzers-at-search-query-time-vs-at-index-time/258175/5 "2021-01-11T15:24:51Z")

</div>

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