# Nested facets : only on first result document?

**URL:** <https://discuss.elastic.co/t/nested-facets-only-on-first-result-document/15830>\
**Category:** Elasticsearch\
**Created:** [February 16, 2014, 4:28pm UTC](https://discuss.elastic.co/t/nested-facets-only-on-first-result-document/15830 "2014-02-16T16:28:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tchinkatchuk](https://avatars.discourse-cdn.com/v4/letter/t/958977/32.png) [@Tchinkatchuk](https://discuss.elastic.co/u/Tchinkatchuk)\
**Post date:** [February 16, 2014, 4:28pm UTC](https://discuss.elastic.co/t/nested-facets-only-on-first-result-document/15830/1 "2014-02-16T16:28:05Z")

</div>

Hi everyone,

I think I misunderstood something.  
I have "products" documents with a nested property called "skus"

here's the query I do :  
{  
"query": {  
"query\_string": {  
"query": "\*"  
}  
},  
"facets": {  
"test\_nested": {  
"nested": "skus",  
"terms": {  
"field": "myfield"  
}  
}  
}  
}

I was expected to have all hits (ok) and a facets for those hits on every  
"myfield" possibilites.  
Instead of that, the facet return only the first result facet -\> value of  
skus.myfield of the first result.

Am i wrong somewhere ?

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e8e09c08-7a1c-4045-9497-bb3861bfd84f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e8e09c08-7a1c-4045-9497-bb3861bfd84f%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Tchinkatchuk](https://avatars.discourse-cdn.com/v4/letter/t/958977/32.png) [@Tchinkatchuk](https://discuss.elastic.co/u/Tchinkatchuk)\
**Post date:** [February 17, 2014, 1:10pm UTC](https://discuss.elastic.co/t/nested-facets-only-on-first-result-document/15830/2 "2014-02-17T13:10:22Z")

</div>

ok, my bad.

If anyone has the same issue, check carefully the datas you're indexing. It  
was my fault.  
If datas are ok, facets is ok.

Works alos with aggs in 1.0

Le dimanche 16 février 2014 17:28:05 UTC+1, Georges@Bibtol a écrit :

> Hi everyone,
> 
> I think I misunderstood something.  
> I have "products" documents with a nested property called "skus"
> 
> here's the query I do :  
> {  
> "query": {  
> "query\_string": {  
> "query": "\*"  
> }  
> },  
> "facets": {  
> "test\_nested": {  
> "nested": "skus",  
> "terms": {  
> "field": "myfield"  
> }  
> }  
> }  
> }
> 
> I was expected to have all hits (ok) and a facets for those hits on every  
> "myfield" possibilites.  
> Instead of that, the facet return only the first result facet -\> value of  
> skus.myfield of the first result.
> 
> Am i wrong somewhere ?

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/cf8182f3-7b0d-4598-820f-ca294e1a94b4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cf8182f3-7b0d-4598-820f-ca294e1a94b4%40googlegroups.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, 1:49am UTC](https://discuss.elastic.co/t/nested-facets-only-on-first-result-document/15830/3 "2017-07-06T01:49:40Z")

</div>

Closed on July 6, 2017, 1:49am UTC


