# Problem with faceting

**URL:** <https://discuss.elastic.co/t/problem-with-faceting/4351>\
**Category:** Elasticsearch\
**Created:** [May 5, 2011, 7:02am UTC](https://discuss.elastic.co/t/problem-with-faceting/4351 "2011-05-05T07:02:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![senthil\_prabhu](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@senthil\_prabhu](https://discuss.elastic.co/u/senthil_prabhu)\
**Post date:** [May 5, 2011, 7:02am UTC](https://discuss.elastic.co/t/problem-with-faceting/4351/1 "2011-05-05T07:02:04Z")

</div>

hi team,  
i have problem with faceting.

My Mapping:-

{"included":{"\_routing":{"required":true},"properties":{"\_included":  
{"store":"yes","analyzer":"standard","type":"string"},"parentrelationid":  
{"omit\_term\_freq\_and\_positions":false,"index":"analyzed","omit\_norms":false,"store":"yes","type":"long"},"\_updatedby":  
{"omit\_term\_freq\_and\_positions":false,"omit\_norms":false,"store":"yes","type":"long"},"\_updatedon":  
{"omit\_term\_freq\_and\_positions":false,"omit\_norms":false,"store":"yes","format":"MMM/  
dd/yyyy HH:mm:ss","type":"date"}},"\_parent":{"type":"metadata"}}}

When quering data i got:

{"took":0,"timed\_out":false,"\_shards":{"total":5,"successful":  
5,"failed":0},"hits":{"total":100,"max\_score":1.0,"hits":  
[{"\_index":"db265","\_type":"included","\_id":"-  
l123u7GRMafitbhPWtddw","\_score":1.0,"fields":  
{"\_included":"STATUS2STATUS","\_updatedby":  
1,"parentrelationid":"0010000001","\_updatedon":"May/03/2011  
17:38:48"}},  
{"\_index":"db265","\_type":"included","\_id":"BkJLM4S9T\_awIRi0i7bzEg","\_score":  
1.0,"fields":{"\_included":"STATUS2STATUS","\_updatedby":  
1,"parentrelationid":"0010000006","\_updatedon":"May/03/2011  
17:38:48"}},  
{"\_index":"db265","\_type":"included","\_id":"LCL31bqrRGWaAn2ryRNCFQ","\_score":  
1.0,"fields":{"\_included":"STATUS2STATUS","\_updatedby":  
1,"parentrelationid":"0010000013","\_updatedon":"May/03/2011  
17:38:48"}},  
{"\_index":"db265","\_type":"included","\_id":"DgrPrCE4SvKgJNaHUgTHsw","\_score":  
1.0,"fields":{"\_included":"STATUS2STATUS","\_updatedby":  
1,"parentrelationid":"0010000018","\_updatedon":"May/03/2011  
17:38:48"}},  
{"\_index":"db265","\_type":"included","\_id":"2mnfzbk6RMy6F45EsTP6Rw","\_score":  
1.0,"fields":{"\_included":"STATUS2STATUS","\_updatedby":  
1,"parentrelationid":"0010000020","\_updatedon":"May/03/2011  
17:38:48"}}]}}

but when i faceting field parentrelationid

{"took":0,"timed\_out":false,"\_shards":{"total":5,"successful":  
5,"failed":0},"hits":{"total":100,"max\_score":1.0,"hits":[]},"facets":  
{"tagparentrelationid":{"\_type":"terms","missing":0,"terms":[{"term":"  
\b","count":100},{"term":"X\u0001\u0000","count":100},{"term":"T  
\u0010\u0000","count":100},{"term":"P\u0002\u0000\u0000","count":100},  
{"term":"L \u0000\u0000","count":100},{"term":"H  
\u0004\u0000\u0000\u0000","count":100},{"term":"D@  
\u0000\u0000\u0000","count":100},{"term":"@\b  
\u0000\u0000\u0000\u0000","count":100},{"term":"\<  
\u0001\u0000\u0000\u0000\u0000\u0000","count":100},  
{"term":"8\u0010\u0000\u0000\u0000\u0000\u0000","count":100},  
{"term":"4\u0002\u0000\u0000\u0000\u0000\u0000\t","count":100},  
{"term":"0 \u0000\u0000\u0000\u0000\u0001\u0018","count":100},  
{"term":",\u0004\u0000\u0000\u0000\u0000\u0000\u0013\t","count":100},  
{"term":"(@\u0000\u0000\u0000\u0000\u00021\u0016"]}}}

Please help....

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 5, 2011, 9:34pm UTC](https://discuss.elastic.co/t/problem-with-faceting/4351/2 "2011-05-05T21:34:27Z")

</div>

Can you post a gist recreation? ([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)). Seems like somewhere the field is treated as long, and then as string.  
On Thursday, May 5, 2011 at 10:02 AM, senthil prabhu wrote:

> hi team,  
> i have problem with faceting.
> 
> My Mapping:-
> 
> {"included":{"\_routing":{"required":true},"properties":{"\_included":  
> {"store":"yes","analyzer":"standard","type":"string"},"parentrelationid":  
> {"omit\_term\_freq\_and\_positions":false,"index":"analyzed","omit\_norms":false,"store":"yes","type":"long"},"\_updatedby":  
> {"omit\_term\_freq\_and\_positions":false,"omit\_norms":false,"store":"yes","type":"long"},"\_updatedon":  
> {"omit\_term\_freq\_and\_positions":false,"omit\_norms":false,"store":"yes","format":"MMM/  
> dd/yyyy HH:mm:ss","type":"date"}},"\_parent":{"type":"metadata"}}}
> 
> When quering data i got:
> 
> {"took":0,"timed\_out":false,"\_shards":{"total":5,"successful":  
> 5,"failed":0},"hits":{"total":100,"max\_score":1.0,"hits":  
> [{"\_index":"db265","\_type":"included","\_id":"-  
> l123u7GRMafitbhPWtddw","\_score":1.0,"fields":  
> {"\_included":"STATUS2STATUS","\_updatedby":  
> 1,"parentrelationid":"0010000001","\_updatedon":"May/03/2011  
> 17:38:48"}},  
> {"\_index":"db265","\_type":"included","\_id":"BkJLM4S9T\_awIRi0i7bzEg","\_score":  
> 1.0,"fields":{"\_included":"STATUS2STATUS","\_updatedby":  
> 1,"parentrelationid":"0010000006","\_updatedon":"May/03/2011  
> 17:38:48"}},  
> {"\_index":"db265","\_type":"included","\_id":"LCL31bqrRGWaAn2ryRNCFQ","\_score":  
> 1.0,"fields":{"\_included":"STATUS2STATUS","\_updatedby":  
> 1,"parentrelationid":"0010000013","\_updatedon":"May/03/2011  
> 17:38:48"}},  
> {"\_index":"db265","\_type":"included","\_id":"DgrPrCE4SvKgJNaHUgTHsw","\_score":  
> 1.0,"fields":{"\_included":"STATUS2STATUS","\_updatedby":  
> 1,"parentrelationid":"0010000018","\_updatedon":"May/03/2011  
> 17:38:48"}},  
> {"\_index":"db265","\_type":"included","\_id":"2mnfzbk6RMy6F45EsTP6Rw","\_score":  
> 1.0,"fields":{"\_included":"STATUS2STATUS","\_updatedby":  
> 1,"parentrelationid":"0010000020","\_updatedon":"May/03/2011  
> 17:38:48"}}]}}
> 
> but when i faceting field parentrelationid
> 
> {"took":0,"timed\_out":false,"\_shards":{"total":5,"successful":  
> 5,"failed":0},"hits":{"total":100,"max\_score":1.0,"hits":},"facets":  
> {"tagparentrelationid":{"\_type":"terms","missing":0,"terms":[{"term":"  
> \b","count":100},{"term":"X\u0001\u0000","count":100},{"term":"T  
> \u0010\u0000","count":100},{"term":"P\u0002\u0000\u0000","count":100},  
> {"term":"L \u0000\u0000","count":100},{"term":"H  
> \u0004\u0000\u0000\u0000","count":100},{"term":"D@  
> \u0000\u0000\u0000","count":100},{"term":"@\b  
> \u0000\u0000\u0000\u0000","count":100},{"term":"\<  
> \u0001\u0000\u0000\u0000\u0000\u0000","count":100},  
> {"term":"8\u0010\u0000\u0000\u0000\u0000\u0000","count":100},  
> {"term":"4\u0002\u0000\u0000\u0000\u0000\u0000\t","count":100},  
> {"term":"0 \u0000\u0000\u0000\u0000\u0001\u0018","count":100},  
> {"term":",\u0004\u0000\u0000\u0000\u0000\u0000\u0013\t","count":100},  
> {"term":"(@\u0000\u0000\u0000\u0000\u00021\u0016"]}}}
> 
> Please help....

---

<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, 4:06am UTC](https://discuss.elastic.co/t/problem-with-faceting/4351/3 "2017-07-06T04:06:52Z")

</div>


