# ANN Search Timeouts

**URL:** https://discuss.elastic.co/t/ann-search-timeouts/299879
**Category:** Elasticsearch
**Tags:** docker
**Created:** [March 16, 2022, 4:11pm UTC](https://discuss.elastic.co/t/ann-search-timeouts/299879 "2022-03-16T16:11:50Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![Julie\_Tibshirani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julie_tibshirani/32/55628_2.png) [@Julie\_Tibshirani](https://discuss.elastic.co/u/Julie_Tibshirani)
#### Post date: [April 6, 2022, 7:03pm UTC](https://discuss.elastic.co/t/ann-search-timeouts/299879/8 "2022-04-06T19:03:33Z")

</div>

Adding one other idea, since you mentioned searches maybe became slower once you switched from `l2_norm` to `cosine` for the similarity. The `cosine` similarity is convenient for testing and development, but can be slower to compute than the other types. For best performance, we recommend normalizing all the vectors in advance to have length 1, and using `dot_product` instead. These docs have more information under the `similarity` section: [Dense vector field type | Elasticsearch Guide [8.1] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.1/dense-vector.html).

---

_[View the full topic](https://discuss.elastic.co/t/ann-search-timeouts/299879)._
