# Text Embedding in Elastic Search

**URL:** <https://discuss.elastic.co/t/text-embedding-in-elastic-search/272242>\
**Category:** Elasticsearch\
**Created:** [May 6, 2021, 6:21am UTC](https://discuss.elastic.co/t/text-embedding-in-elastic-search/272242 "2021-05-06T06:21:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![harry\_richard](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harry_richard/32/88292_2.png) [@harry\_richard](https://discuss.elastic.co/u/harry_richard)\
**Post date:** [May 6, 2021, 6:21am UTC](https://discuss.elastic.co/t/text-embedding-in-elastic-search/272242/1 "2021-05-06T06:21:44Z")

</div>

Hi All,

I have implemented text embedding using doc 2 vec and stored the vectors in elastic search , using cosine similarity I am trying to search for similar texts. But the issue is whenver I am giving a same text twice the output differs , for the same text the output changes constantly and also the scores differs.

Can anyone explain me why is this happening? I am confused...

Hope I am clear..  
....

Thank you

---

<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:** [May 6, 2021, 2:42pm UTC](https://discuss.elastic.co/t/text-embedding-in-elastic-search/272242/2 "2021-05-06T14:42:36Z")

</div>

> I am giving a same text twice the output differs

Can you please clarify the meaning of this? Is this on the stage of generating the vector embeddings from a text? If yes, elasticsearch is not responsible for this.

---

<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:** [June 3, 2021, 2:43pm UTC](https://discuss.elastic.co/t/text-embedding-in-elastic-search/272242/3 "2021-06-03T14:43:18Z")

</div>

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