# Rewrite\_time on \_search too high

**URL:** <https://discuss.elastic.co/t/rewrite-time-on-search-too-high/153162>\
**Category:** Elasticsearch\
**Created:** [October 19, 2018, 10:59am UTC](https://discuss.elastic.co/t/rewrite-time-on-search-too-high/153162 "2018-10-19T10:59:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomas\_Kurinec](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@Tomas\_Kurinec](https://discuss.elastic.co/u/Tomas_Kurinec)\
**Post date:** [October 19, 2018, 10:59am UTC](https://discuss.elastic.co/t/rewrite-time-on-search-too-high/153162/1 "2018-10-19T10:59:31Z")

</div>

Hi,

we have ES cluster 6.4.2 with 2 nodes each node HW is:  
Intel® Xeon® E3-1275 v5 Quad Core  
64 GB DDR4 ECC RAM  
2 x 512 GB NVMe Gen3 x4 SSD (Software RAID 1)  
1 Gbit eth between them.

We have 1 index with 5 shards and 1 replica (tried different setups, but it was worse or equally bad). According to Search Profiler in Kibana the query would normally took about 10ms to get the result. What it really took is almost 300ms, because the 290ms is spent on rewriting the queries. Can the rewrite\_time be somehow optimised or turned off or what can we do?

Thank you very much for you kind response.

Query: [https://privatebin.net/?194b058d362e895e#S7S+e45GkGAyfsLjos9jUV9/tPomiPx537QnkkKCCFY=](https://privatebin.net/?194b058d362e895e#S7S+e45GkGAyfsLjos9jUV9/tPomiPx537QnkkKCCFY=)  
Response: [https://privatebin.net/?e790ba39aa95f98a#2Lfk6ixK97+YOFvlmKg73sl4q/jse3IZlbOhxAgDF64=](https://privatebin.net/?e790ba39aa95f98a#2Lfk6ixK97+YOFvlmKg73sl4q/jse3IZlbOhxAgDF64=)

---

<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:** [October 19, 2018, 11:51am UTC](https://discuss.elastic.co/t/rewrite-time-on-search-too-high/153162/2 "2018-10-19T11:51:37Z")

</div>

> [@Tomas\_Kurinec](#):
>
> PS: The query and result are too long to post it here.

You can always post to [gist.github.com](http://gist.github.com) and share the link here

---

<div class="post-metadata">

**Author:** ![Tomas\_Kurinec](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@Tomas\_Kurinec](https://discuss.elastic.co/u/Tomas_Kurinec)\
**Post date:** [October 19, 2018, 12:24pm UTC](https://discuss.elastic.co/t/rewrite-time-on-search-too-high/153162/4 "2018-10-19T12:24:40Z")

</div>

> [@dadoonet](#):
>
> > [@Tomas\_Kurinec](#):
> >
> > PS: The query and result are too long to post it here.
> 
> You can always post to [gist.github.com](http://gist.github.com) and share the link here

Thx I used pastebin

---

<div class="post-metadata">

**Author:** ![Tomas\_Kurinec](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@Tomas\_Kurinec](https://discuss.elastic.co/u/Tomas_Kurinec)\
**Post date:** [October 24, 2018, 8:44am UTC](https://discuss.elastic.co/t/rewrite-time-on-search-too-high/153162/5 "2018-10-24T08:44:11Z")

</div>

Does anyone have an idea how to optimize this? How to get rewrite\_time as low as possible?

---

<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 21, 2018, 8:44am UTC](https://discuss.elastic.co/t/rewrite-time-on-search-too-high/153162/6 "2018-11-21T08:44:11Z")

</div>

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