# Date range facet\_filter

**URL:** https://discuss.elastic.co/t/date-range-facet-filter/7980
**Category:** Elasticsearch
**Created:** [June 5, 2012, 1:26pm UTC](https://discuss.elastic.co/t/date-range-facet-filter/7980 "2012-06-05T13:26:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jeremie\_BORDIER1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremie_bordier1/32/2860_2.png) [@Jeremie\_BORDIER1](https://discuss.elastic.co/u/Jeremie_BORDIER1)
#### Post date: [June 5, 2012, 1:26pm UTC](https://discuss.elastic.co/t/date-range-facet-filter/7980/1 "2012-06-05T13:26:17Z")

</div>

Hi,

I'm having issues with a date\_histogram facet using a facet\_filter:

```
"date": {
  "date_histogram": {
    "field": "creationDate",
    "interval": "month"
  },
  "facet_filter": {
    "range": {
      "from": "1325376000000",
      "to": "1325376000000||+1M"
    }
  }
}

```

I get the following exception:  
QueryParsingException[[idx\_1.4] [range] filter does not support [from]]; }]

This same filter works great as a top filter element:  
"filter": {  
"range": {  
"creationDate": {  
"from": "1325376000000",  
"to": "1325376000000||+1M"  
}  
}  
}

Is that a bug or a limitation ?

Cheers,  
Jérémie

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [June 5, 2012, 2:45pm UTC](https://discuss.elastic.co/t/date-range-facet-filter/7980/2 "2012-06-05T14:45:35Z")

</div>

Not sure but I think that there's somtehing wrong in the way you wrote the range  
filter.

IMHO, it should be something like:

```
 "date": {
   "date_histogram": {
     "field": "creationDate",
     "interval": "month"
   },
   "facet_filter": {
     "range": {
       "creationDate": {
         "from": "1325376000000",
         "to": "1325376000000||+1M"
       }
     }
   }
 }

```

HTH  
David.

Le 5 juin 2012 à 15:26, "Jérémie BORDIER" [jeremie.bordier@gmail.com](mailto:jeremie.bordier@gmail.com) a écrit :

> Hi,
> 
> I'm having issues with a date\_histogram facet using a facet\_filter:
> 
> ```
> "date": {
> "date_histogram": {
> "field": "creationDate",
> "interval": "month"
> },
> "facet_filter": {
> "range": {
> "from": "1325376000000",
> "to": "1325376000000||+1M"
> }
> }
> }
> 
> ```
> 
> I get the following exception:  
> QueryParsingException[[idx\_1.4] [range] filter does not support [from]]; }]
> 
> This same filter works great as a top filter element:  
> "filter": {  
> "range": {  
> "creationDate": {  
> "from": "1325376000000",  
> "to": "1325376000000||+1M"  
> }  
> }  
> }
> 
> Is that a bug or a limitation ?
> 
> Cheers,  
> Jérémie

--  
David Pilato  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet

---

<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, 3:25am UTC](https://discuss.elastic.co/t/date-range-facet-filter/7980/3 "2017-07-06T03:25:36Z")

</div>


