# How to use dsl

**URL:** <https://discuss.elastic.co/t/how-to-use-dsl/309718>\
**Category:** Elasticsearch\
**Created:** [July 15, 2022, 8:08am UTC](https://discuss.elastic.co/t/how-to-use-dsl/309718 "2022-07-15T08:08:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)\
**Post date:** [July 15, 2022, 8:08am UTC](https://discuss.elastic.co/t/how-to-use-dsl/309718/1 "2022-07-15T08:08:23Z")

</div>

Hi all,

I want to learn elasticsearch DSL but i dont know what is the use of query , filter. I want practical questions which teach me actual use of particular function. Sorry for this silly question but i want to learn DSL with practical questions

---

<div class="post-metadata">

**Author:** ![anime\_lover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anime_lover/32/100265_2.png) [@anime\_lover](https://discuss.elastic.co/u/anime_lover)\
**Post date:** [July 15, 2022, 10:44am UTC](https://discuss.elastic.co/t/how-to-use-dsl/309718/2 "2022-07-15T10:44:15Z")

</div>

Hi there ,  
I think i might be able to help you this replay...  
suppose you have a lot of data of any thing like ecommerce sites ,or any log data on es.  
if you want to get range data than you can use filter

```auto
GET index_name/_search
{
  "query": { 
    "bool": { 
      "filter": [ 
        { "range": { "date": { "gte": "2022-07-15" }}}
      ]
    }
  }
}

```

- for reference read this : [https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html)

---

<div class="post-metadata">

**Author:** ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)\
**Post date:** [July 16, 2022, 6:29pm UTC](https://discuss.elastic.co/t/how-to-use-dsl/309718/3 "2022-07-16T18:29:43Z")

</div>

Hi @anime_lover , thank you for replying me i will try

---

<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:** [August 13, 2022, 6:29pm UTC](https://discuss.elastic.co/t/how-to-use-dsl/309718/4 "2022-08-13T18:29:51Z")

</div>

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