# How to use different similarity models (use DSL) in the process of search

**URL:** https://discuss.elastic.co/t/how-to-use-different-similarity-models-use-dsl-in-the-process-of-search/1667
**Category:** Elasticsearch
**Created:** [June 1, 2015, 9:49pm UTC](https://discuss.elastic.co/t/how-to-use-different-similarity-models-use-dsl-in-the-process-of-search/1667 "2015-06-01T21:49:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![harry747747](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harry747747/32/483_2.png) [@harry747747](https://discuss.elastic.co/u/harry747747)
#### Post date: [June 1, 2015, 9:49pm UTC](https://discuss.elastic.co/t/how-to-use-different-similarity-models-use-dsl-in-the-process-of-search/1667/1 "2015-06-01T21:49:46Z")

</div>

1. From the documentation, I know that I can use a different similarity model when building the index. The problem is my index is already built and very large, takes a few days to build. So, I wonder if it is possible to use a different similarity model (use DSL) when I do search.
2. Though the documentation tells how to use a different similarity model with mapping API, I cannot find how to use DSL for a different model. Any codes?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [June 2, 2015, 11:17am UTC](https://discuss.elastic.co/t/how-to-use-different-similarity-models-use-dsl-in-the-process-of-search/1667/2 "2015-06-02T11:17:55Z")

</div>

Are you referring to this - [https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-similarity.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-similarity.html)?

---

<div class="post-metadata">

### Author: ![harry747747](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harry747747/32/483_2.png) [@harry747747](https://discuss.elastic.co/u/harry747747)
#### Post date: [June 2, 2015, 2:13pm UTC](https://discuss.elastic.co/t/how-to-use-different-similarity-models-use-dsl-in-the-process-of-search/1667/3 "2015-06-02T14:13:17Z")

</div>

This reference talks about how to use similarity model APIs. But I want to embed codes into our program, i.e., use DSL.

---

<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: [July 6, 2017, 12:10am UTC](https://discuss.elastic.co/t/how-to-use-different-similarity-models-use-dsl-in-the-process-of-search/1667/4 "2017-07-06T00:10:12Z")

</div>


