# ES myindex/\_analyze?analyzer=...&text=... is very slow. Is there any way to speed it up

**URL:** <https://discuss.elastic.co/t/es-myindex--analyze-analyzer-text-is-very-slow-is-there-any-way-to-speed-it-up/11297>\
**Category:** Elasticsearch\
**Created:** [March 25, 2013, 4:23pm UTC](https://discuss.elastic.co/t/es-myindex--analyze-analyzer-text-is-very-slow-is-there-any-way-to-speed-it-up/11297 "2013-03-25T16:23:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![roytmana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roytmana/32/44855_2.png) [@roytmana](https://discuss.elastic.co/u/roytmana)\
**Post date:** [March 25, 2013, 4:23pm UTC](https://discuss.elastic.co/t/es-myindex--analyze-analyzer-text-is-very-slow-is-there-any-way-to-speed-it-up/11297/1 "2013-03-25T16:23:30Z")

</div>

I would like to use myindex/\_analyze?analyzer too get list of tokens ES is  
using in my query to attempt client side highlighting.  
I noticed that it is very slow relative to the query itself. While query  
takes 20-30ms (browser measured roundtrip time) analyze call takes over  
200ms  
Is there any way to speedup this call?

Thank you,  
Alex

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [March 25, 2013, 4:37pm UTC](https://discuss.elastic.co/t/es-myindex--analyze-analyzer-text-is-very-slow-is-there-any-way-to-speed-it-up/11297/2 "2013-03-25T16:37:10Z")

</div>

If you are using Java, then you can recreate the analysis service locally  
and avoiding doing network calls. Your Elasticsearch config file and  
another external files such as synonyms would need to be in your classpath.  
Look at the test classes for implementation details.

--  
Ivan

On Mon, Mar 25, 2013 at 9:23 AM, AlexR [roytmana@gmail.com](mailto:roytmana@gmail.com) wrote:

> I would like to use myindex/\_analyze?analyzer too get list of tokens ES is  
> using in my query to attempt client side highlighting.  
> I noticed that it is very slow relative to the query itself. While query  
> takes 20-30ms (browser measured roundtrip time) analyze call takes over  
> 200ms  
> Is there any way to speedup this call?
> 
> Thank you,  
> Alex
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![roytmana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roytmana/32/44855_2.png) [@roytmana](https://discuss.elastic.co/u/roytmana)\
**Post date:** [March 25, 2013, 4:38pm UTC](https://discuss.elastic.co/t/es-myindex--analyze-analyzer-text-is-very-slow-is-there-any-way-to-speed-it-up/11297/3 "2013-03-25T16:38:52Z")

</div>

Thank you Ivan, at the moment it is a pure REST with ExtJS client

On Mon, Mar 25, 2013 at 12:37 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> If you are using Java, then you can recreate the analysis service locally  
> and avoiding doing network calls. Your Elasticsearch config file and  
> another external files such as synonyms would need to be in your classpath.  
> Look at the test classes for implementation details.
> 
> --  
> Ivan
> 
> On Mon, Mar 25, 2013 at 9:23 AM, AlexR [roytmana@gmail.com](mailto:roytmana@gmail.com) wrote:
> 
> > I would like to use myindex/\_analyze?analyzer too get list of tokens ES  
> > is using in my query to attempt client side highlighting.  
> > I noticed that it is very slow relative to the query itself. While query  
> > takes 20-30ms (browser measured roundtrip time) analyze call takes over  
> > 200ms  
> > Is there any way to speedup this call?
> > 
> > Thank you,  
> > Alex
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).
> > 
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/xu3Imq-P6yc/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/xu3Imq-P6yc/unsubscribe?hl=en-US)  
> .  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [March 25, 2013, 6:24pm UTC](https://discuss.elastic.co/t/es-myindex--analyze-analyzer-text-is-very-slow-is-there-any-way-to-speed-it-up/11297/4 "2013-03-25T18:24:21Z")

</div>

On Monday, March 25, 2013 5:23:30 PM UTC+1, AlexR wrote:

> I would like to use myindex/\_analyze?analyzer too get list of tokens ES is  
> using in my query to attempt client side highlighting.  
> I noticed that it is very slow relative to the query itself. While query  
> takes 20-30ms (browser measured roundtrip time) analyze call takes over  
> 200ms  
> Is there any way to speedup this call?

hey alex,

I'd be curious what kind analysis call you are doing to reproduce this  
rather slowish call. 200ms is a lot for just an analysis call so I'd want  
to get to root of the problem.

simon

> Thank you,  
> Alex

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![roytmana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roytmana/32/44855_2.png) [@roytmana](https://discuss.elastic.co/u/roytmana)\
**Post date:** [March 25, 2013, 6:29pm UTC](https://discuss.elastic.co/t/es-myindex--analyze-analyzer-text-is-very-slow-is-there-any-way-to-speed-it-up/11297/5 "2013-03-25T18:29:20Z")

</div>

Hi Simon,

"all\_kstem": {  
"tokenizer": "standard",  
"filter": ["standard", "lowercase", "stop",  
"stem\_possessive\_english", "kstem"]  
}

[http://localhost/search/award/\_analyze?&text=laboratory%20equipment%20manufacturing&analyzer=all\_kstem](http://localhost/search/award/_analyze?&text=laboratory%20equipment%20manufacturing&analyzer=all_kstem)

ran the above 5 times in a row took between 130 and 182ms watching it in  
firebug. search on the same string with highlighting etc was taking only  
20ms per firebug

ES 0.20.5

On Mon, Mar 25, 2013 at 2:24 PM, simonw  
[simon.willnauer@elasticsearch.com](mailto:simon.willnauer@elasticsearch.com)wrote:

> On Monday, March 25, 2013 5:23:30 PM UTC+1, AlexR wrote:
> 
> > I would like to use myindex/\_analyze?analyzer too get list of tokens ES  
> > is using in my query to attempt client side highlighting.  
> > I noticed that it is very slow relative to the query itself. While query  
> > takes 20-30ms (browser measured roundtrip time) analyze call takes over  
> > 200ms  
> > Is there any way to speedup this call?
> 
> hey alex,
> 
> I'd be curious what kind analysis call you are doing to reproduce this  
> rather slowish call. 200ms is a lot for just an analysis call so I'd want  
> to get to root of the problem.
> 
> simon
> 
> > Thank you,  
> > Alex
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/xu3Imq-P6yc/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/xu3Imq-P6yc/unsubscribe?hl=en-US)  
> .  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [March 25, 2013, 6:36pm UTC](https://discuss.elastic.co/t/es-myindex--analyze-analyzer-text-is-very-slow-is-there-any-way-to-speed-it-up/11297/6 "2013-03-25T18:36:08Z")

</div>

I will try this hopefully tomorrow.

simon

On Monday, March 25, 2013 7:29:20 PM UTC+1, AlexR wrote:

> Hi Simon,
> 
> "all\_kstem": {  
> "tokenizer": "standard",  
> "filter": ["standard", "lowercase", "stop",  
> "stem\_possessive\_english", "kstem"]  
> }
> 
> [http://localhost/search/award/\_analyze?&text=laboratory%20equipment%20manufacturing&analyzer=all\_kstem](http://localhost/search/award/_analyze?&text=laboratory%20equipment%20manufacturing&analyzer=all_kstem)
> 
> ran the above 5 times in a row took between 130 and 182ms watching it in  
> firebug. search on the same string with highlighting etc was taking only  
> 20ms per firebug
> 
> ES 0.20.5
> 
> On Mon, Mar 25, 2013 at 2:24 PM, simonw \<[simon.w...@elasticsearch.com](mailto:simon.w...@elasticsearch.com)\<javascript:\>
> 
> > wrote:
> 
> > On Monday, March 25, 2013 5:23:30 PM UTC+1, AlexR wrote:
> > 
> > > I would like to use myindex/\_analyze?analyzer too get list of tokens ES  
> > > is using in my query to attempt client side highlighting.  
> > > I noticed that it is very slow relative to the query itself. While query  
> > > takes 20-30ms (browser measured roundtrip time) analyze call takes over  
> > > 200ms  
> > > Is there any way to speedup this call?
> > 
> > hey alex,
> > 
> > I'd be curious what kind analysis call you are doing to reproduce this  
> > rather slowish call. 200ms is a lot for just an analysis call so I'd want  
> > to get to root of the problem.
> > 
> > simon
> > 
> > > Thank you,  
> > > Alex
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/elasticsearch/xu3Imq-P6yc/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/xu3Imq-P6yc/unsubscribe?hl=en-US)  
> > .  
> > To unsubscribe from this group and all its topics, send an email to  
> > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:44am UTC](https://discuss.elastic.co/t/es-myindex--analyze-analyzer-text-is-very-slow-is-there-any-way-to-speed-it-up/11297/7 "2017-07-06T02:44:40Z")

</div>


