# How to index short sentences for similarity search?

**URL:** <https://discuss.elastic.co/t/how-to-index-short-sentences-for-similarity-search/305302>\
**Category:** Elasticsearch\
**Created:** [May 20, 2022, 4:01pm UTC](https://discuss.elastic.co/t/how-to-index-short-sentences-for-similarity-search/305302 "2022-05-20T16:01:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimw](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jimw](https://discuss.elastic.co/u/jimw)\
**Post date:** [May 20, 2022, 4:01pm UTC](https://discuss.elastic.co/t/how-to-index-short-sentences-for-similarity-search/305302/1 "2022-05-20T16:01:59Z")

</div>

I have a huge dataset, each document is the dataset contains some lines of short sentences.

My problem is: Given a document, I need search similar documents based on the threshold of how many percentage of short sentence are same. For example, if the threshold is 25%, then if the 25% of short sentences are same in two documents, they are thought similar.

My question is:  
How should index the documents, and what similarity algorithm should be used? Thanks in advance for any suggestions and feedbacks.

---

<div class="post-metadata">

**Author:** ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)\
**Post date:** [May 21, 2022, 8:22am UTC](https://discuss.elastic.co/t/how-to-index-short-sentences-for-similarity-search/305302/2 "2022-05-21T08:22:45Z")

</div>

If you need exact match of such short sentences, you may use keyword fields and [More like this query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html) on that field. How about it??

---

<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 18, 2022, 8:22am UTC](https://discuss.elastic.co/t/how-to-index-short-sentences-for-similarity-search/305302/3 "2022-06-18T08:22:54Z")

</div>

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