# Range faceting help

**URL:** <https://discuss.elastic.co/t/range-faceting-help/14225>\
**Category:** Elasticsearch\
**Created:** [November 1, 2013, 8:45pm UTC](https://discuss.elastic.co/t/range-faceting-help/14225 "2013-11-01T20:45:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhishek\_Andhavarapu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhishek_andhavarapu/32/782_2.png) [@Abhishek\_Andhavarapu](https://discuss.elastic.co/u/Abhishek_Andhavarapu)\
**Post date:** [November 1, 2013, 8:45pm UTC](https://discuss.elastic.co/t/range-faceting-help/14225/1 "2013-11-01T20:45:11Z")

</div>

Hi All,

I'm trying to run range faceting where my key\_field is a regular field  
where as value\_field is a nested document property.

My nested document structure

{  
"rdata" :  
{ "mapid" : "integer", "value" : "float" }  
}

{  
"query": {  
"match\_all" : {}  
},  
"facets": {  
"StatisticalFacetResult": {  
"range": {  
"key\_field": "rdate", //Non nested  
"value\_field": "value", // Nested field  
"nested": "rdata",  
"facet\_filter": {  
"and": [  
{  
"term": {  
"mapid": 93  
}  
},  
{  
"not": {  
"term": {  
"value": "-99"  
}  
}  
}  
]  
},  
"ranges": [  
{  
"from": "2012-06-01",  
"to": "2012-06-30"  
}  
]  
}  
}  
}  
}

Any help is appreciated,  
Abhishek

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 4, 2013, 8:35am UTC](https://discuss.elastic.co/t/range-faceting-help/14225/2 "2013-11-04T08:35:36Z")

</div>

Hey,

can you provide a minimum example maybe? Including a document you index,  
the mapping you have, and most importantly, what do you expect to be  
returned (or better, explain your use-case), so people can try to  
understand and help better...

Thanks a lot!

--Alex

On Fri, Nov 1, 2013 at 9:45 PM, Abhishek Andhavarapu  
[abhishek376@gmail.com](mailto:abhishek376@gmail.com)wrote:

> Hi All,
> 
> I'm trying to run range faceting where my key\_field is a regular field  
> where as value\_field is a nested document property.
> 
> My nested document structure
> 
> {  
> "rdata" :  
> { "mapid" : "integer", "value" : "float" }  
> }
> 
> {  
> "query": {  
> "match\_all" : {}  
> },  
> "facets": {  
> "StatisticalFacetResult": {  
> "range": {  
> "key\_field": "rdate", //Non nested  
> "value\_field": "value", // Nested field  
> "nested": "rdata",  
> "facet\_filter": {  
> "and": [  
> {  
> "term": {  
> "mapid": 93  
> }  
> },  
> {  
> "not": {  
> "term": {  
> "value": "-99"  
> }  
> }  
> }  
> ]  
> },  
> "ranges": [  
> {  
> "from": "2012-06-01",  
> "to": "2012-06-30"  
> }  
> ]  
> }  
> }  
> }  
> }
> 
> Any help is appreciated,  
> Abhishek
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:09am UTC](https://discuss.elastic.co/t/range-faceting-help/14225/3 "2017-07-06T02:09:05Z")

</div>


