# \[Facet\] No search result, but there was facet result

**URL:** https://discuss.elastic.co/t/facet-no-search-result-but-there-was-facet-result/13454
**Category:** Elasticsearch
**Created:** [September 4, 2013, 7:36am UTC](https://discuss.elastic.co/t/facet-no-search-result-but-there-was-facet-result/13454 "2013-09-04T07:36:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Henry\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henry_2/32/3449_2.png) [@Henry\_2](https://discuss.elastic.co/u/Henry_2)
#### Post date: [September 4, 2013, 7:36am UTC](https://discuss.elastic.co/t/facet-no-search-result-but-there-was-facet-result/13454/1 "2013-09-04T07:36:37Z")

</div>

Hello there.

I have some question.  
Is there a facet result when a result didn't have any document.  
I'm testing on a facet function that i got a below result.  
Is it possible?

I'm using 0.90.2 and testing terms\_stats function.

{  
"took": 64,  
"timed\_out": false,  
"\_shards": {  
"total": 8,  
"successful": 8,  
"failed": 0  
},  
"hits": {  
"total": 0,  
"max\_score": null,  
"hits": []  
},  
"facets": {  
"prdShopFacet": {  
"\_type": "terms\_stats",  
"missing": 0,  
"terms": [  
{  
"term": "3327\_174813\_120427",  
"count": 109,  
"total\_count": 109,  
"min": 1,  
"max": 1,  
"total": 109,  
"mean": 1  
},  
{  
"term": "3327\_174813",  
"count": 109,  
"total\_count": 109,  
"min": 1,  
"max": 1,  
"total": 109,  
"mean": 1  
},  
{  
"term": "3327\_116443\_738971",  
"count": 109,  
"total\_count": 109,  
"min": 1,  
"max": 1,  
"total": 109,  
"mean": 1  
},  
{  
"term": "3327\_116443",  
"count": 109,  
"total\_count": 109,  
"min": 1,  
"max": 1,  
"total": 109,  
"mean": 1  
},  
{  
"term": "3327",  
"count": 109,  
"total\_count": 109,  
"min": 1,  
"max": 1,  
"total": 109,  
"mean": 1  
}  
]  
}  
}  
}

--  
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: ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)
#### Post date: [September 4, 2013, 9:47pm UTC](https://discuss.elastic.co/t/facet-no-search-result-but-there-was-facet-result/13454/2 "2013-09-04T21:47:22Z")

</div>

It depends on your query. If you have a top-level filter, then your  
documents will get filtered, but your facets will be run on non-filtered  
documents. Can you share your query?

Cheers,

Ivan

On Wed, Sep 4, 2013 at 12:36 AM, Henry [sophistlv@gmail.com](mailto:sophistlv@gmail.com) wrote:

> Hello there.
> 
> I have some question.  
> Is there a facet result when a result didn't have any document.  
> I'm testing on a facet function that i got a below result.  
> Is it possible?
> 
> I'm using 0.90.2 and testing terms\_stats function.
> 
> {  
> "took": 64,  
> "timed\_out": false,  
> "\_shards": {  
> "total": 8,  
> "successful": 8,  
> "failed": 0  
> },  
> "hits": {  
> "total": 0,  
> "max\_score": null,  
> "hits":   
> },  
> "facets": {  
> "prdShopFacet": {  
> "\_type": "terms\_stats",  
> "missing": 0,  
> "terms": [  
> {  
> "term": "3327\_174813\_120427",  
> "count": 109,  
> "total\_count": 109,  
> "min": 1,  
> "max": 1,  
> "total": 109,  
> "mean": 1  
> },  
> {  
> "term": "3327\_174813",  
> "count": 109,  
> "total\_count": 109,  
> "min": 1,  
> "max": 1,  
> "total": 109,  
> "mean": 1  
> },  
> {  
> "term": "3327\_116443\_738971",  
> "count": 109,  
> "total\_count": 109,  
> "min": 1,  
> "max": 1,  
> "total": 109,  
> "mean": 1  
> },  
> {  
> "term": "3327\_116443",  
> "count": 109,  
> "total\_count": 109,  
> "min": 1,  
> "max": 1,  
> "total": 109,  
> "mean": 1  
> },  
> {  
> "term": "3327",  
> "count": 109,  
> "total\_count": 109,  
> "min": 1,  
> "max": 1,  
> "total": 109,  
> "mean": 1  
> }  
> ]  
> }  
> }  
> }
> 
> --  
> 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:18am UTC](https://discuss.elastic.co/t/facet-no-search-result-but-there-was-facet-result/13454/3 "2017-07-06T02:18:08Z")

</div>


