# How to properly find one string in another using vector search

**URL:** <https://discuss.elastic.co/t/how-to-properly-find-one-string-in-another-using-vector-search/343024>\
**Category:** Elasticsearch\
**Tags:** vector-search\
**Created:** [September 14, 2023, 7:59am UTC](https://discuss.elastic.co/t/how-to-properly-find-one-string-in-another-using-vector-search/343024 "2023-09-14T07:59:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andriy.afanasev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andriy.afanasev/32/125653_2.png) [@andriy.afanasev](https://discuss.elastic.co/u/andriy.afanasev)\
**Post date:** [September 14, 2023, 7:59am UTC](https://discuss.elastic.co/t/how-to-properly-find-one-string-in-another-using-vector-search/343024/1 "2023-09-14T07:59:01Z")

</div>

I need to search for the words in string (document) by their similarity to examples. For example I have string "I love the container with no. SADB21235236" and I have ref in elastic "SREB125136767". Then I need to find SADB21235236

I know that I can do vector search previously splitted string by words, but there are two little problems:

1. My strings are extremely large
2. It can be not one word, but a few words together, and to check every word... then pair... then tripple... I waste 3 times much time

I hope there is a functions that can help me 😔

- Why I store examples, but not documents vectors itself in elastic?
- `My task is to find a string most similar to examples from document, but not find what document is the most similar to word. Basically it is word extraction from documents by references`

---

<div class="post-metadata">

**Author:** ![Carlos\_D](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_d/32/126245_2.png) [@Carlos\_D](https://discuss.elastic.co/u/Carlos_D)\
**Post date:** [September 14, 2023, 12:14pm UTC](https://discuss.elastic.co/t/how-to-properly-find-one-string-in-another-using-vector-search/343024/2 "2023-09-14T12:14:08Z")

</div>

Hi @andriy.afanasev :

I'm sorry, but I don't understand your use case.

Could you provide a practical example, including:

- What do the documents look like?
- What would be the search string?
- What is the expected result given the stored documents?

Thanks!

---

<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:** [October 12, 2023, 12:15pm UTC](https://discuss.elastic.co/t/how-to-properly-find-one-string-in-another-using-vector-search/343024/3 "2023-10-12T12:15:02Z")

</div>

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