# How can I avoid existing semantic query slowdown during re-indexing using ELSER model in Elastic Search V8

**URL:** <https://discuss.elastic.co/t/how-can-i-avoid-existing-semantic-query-slowdown-during-re-indexing-using-elser-model-in-elastic-search-v8/362468>\
**Category:** Elasticsearch\
**Created:** [July 3, 2024, 1:38pm UTC](https://discuss.elastic.co/t/how-can-i-avoid-existing-semantic-query-slowdown-during-re-indexing-using-elser-model-in-elastic-search-v8/362468 "2024-07-03T13:38:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudom0nk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sudom0nk/32/123224_2.png) [@sudom0nk](https://discuss.elastic.co/u/sudom0nk)\
**Post date:** [July 3, 2024, 1:38pm UTC](https://discuss.elastic.co/t/how-can-i-avoid-existing-semantic-query-slowdown-during-re-indexing-using-elser-model-in-elastic-search-v8/362468/1 "2024-07-03T13:38:23Z")

</div>

We are using Elastic ELSER model for Semantic Search. I follow this doc to create my semantic tokens in the index: [Tutorial: semantic search with ELSER | Elasticsearch Guide [8.14] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/semantic-search-elser.html)

The Problem: The search data changes every day for our service. Because of this, I have to reindex the newly pushed data to generate the tokens for semantic search. When this re-indexing is running using the ELSER model, the search on existing data also slows down due to model involvement in reindexing. How can this be avoided?

---

<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:** [July 3, 2024, 1:44pm UTC](https://discuss.elastic.co/t/how-can-i-avoid-existing-semantic-query-slowdown-during-re-indexing-using-elser-model-in-elastic-search-v8/362468/2 "2024-07-03T13:44:08Z")

</div>

Hi @sudom0nk ,

I see that you also asked [this question in the community slack](https://elasticstack.slack.com/archives/C05CED61S9J/p1719991571257739). In the future, please only ask in one place, so that we can avoid duplicate efforts to triage and answer your questions. 🙂

I'll copy the responses from there. From @Quentin_Pradet :

> This is expected especially if both queries and reindexing are using the same model deployment and thus "fighting" for the same resource. Options to address this include:
> 
> - Throttling your reindex to use less queries per second: [Reindex API | Elasticsearch Guide [8.14] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#docs-reindex-throttle). If it's still running, you can also use the `_rethrottle` API.
> - Make sure your deployment has enough allocation and threads. More threads can especially help with query performance: [Deploy the model in your cluster | Machine Learning in the Elastic Stack [8.14] | Elastic](https://www.elastic.co/guide/en/machine-learning/current/ml-nlp-deploy-model.html)
> - Consider adding more ML nodes to increase overall capacity. On Elastic Cloud, ML nodes support autoscaling, which can help by adding more capacity during reindexing

from myself:

> Another option (I believe) is to deploy ELSER twice. You can use one model\_id for ingest, and another for search. This ensures that your search queue is not flooded with ingest requests during periods of heavy ingest, or vice-versa.

---

<div class="post-metadata">

**Author:** ![Alex\_Salgado-Elastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_salgado-elastic/32/103081_2.png) [@Alex\_Salgado-Elastic](https://discuss.elastic.co/u/Alex_Salgado-Elastic)\
**Post date:** [July 3, 2024, 1:53pm UTC](https://discuss.elastic.co/t/how-can-i-avoid-existing-semantic-query-slowdown-during-re-indexing-using-elser-model-in-elastic-search-v8/362468/4 "2024-07-03T13:53:34Z")

</div>

Another help and question is, do you need to reindex new data or just insert new data?

---

<div class="post-metadata">

**Author:** ![sudom0nk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sudom0nk/32/123224_2.png) [@sudom0nk](https://discuss.elastic.co/u/sudom0nk)\
**Post date:** [July 5, 2024, 10:15am UTC](https://discuss.elastic.co/t/how-can-i-avoid-existing-semantic-query-slowdown-during-re-indexing-using-elser-model-in-elastic-search-v8/362468/5 "2024-07-05T10:15:28Z")

</div>

Noted.  
Thank you @Sean_Story for the help.

---

<div class="post-metadata">

**Author:** ![sudom0nk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sudom0nk/32/123224_2.png) [@sudom0nk](https://discuss.elastic.co/u/sudom0nk)\
**Post date:** [July 5, 2024, 10:16am UTC](https://discuss.elastic.co/t/how-can-i-avoid-existing-semantic-query-slowdown-during-re-indexing-using-elser-model-in-elastic-search-v8/362468/6 "2024-07-05T10:16:00Z")

</div>

Basically insert new data for semantic search.

---

<div class="post-metadata">

**Author:** ![Alex\_Salgado-Elastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_salgado-elastic/32/103081_2.png) [@Alex\_Salgado-Elastic](https://discuss.elastic.co/u/Alex_Salgado-Elastic)\
**Post date:** [July 5, 2024, 11:28am UTC](https://discuss.elastic.co/t/how-can-i-avoid-existing-semantic-query-slowdown-during-re-indexing-using-elser-model-in-elastic-search-v8/362468/7 "2024-07-05T11:28:42Z")

</div>

So, if I understood correctly, you don't need to reindex every time you insert a new record; just insert the new record.
