# Facets are missing - only 10

**URL:** <https://discuss.elastic.co/t/facets-are-missing-only-10/6240>\
**Category:** Elasticsearch\
**Created:** [December 27, 2011, 5:01am UTC](https://discuss.elastic.co/t/facets-are-missing-only-10/6240 "2011-12-27T05:01:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrblue](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mrblue/32/23268_2.png) [@mrblue](https://discuss.elastic.co/u/mrblue)\
**Post date:** [December 27, 2011, 5:01am UTC](https://discuss.elastic.co/t/facets-are-missing-only-10/6240/1 "2011-12-27T05:01:58Z")

</div>

Hi,

i try to make some facets here, but some are missing - elasticsearch  
always return 10 facets in random order:

{  
"query" : { "match\_all" : { } }

```
  ,

"facets" : {
  "uhren-facetten" : { "terms" : {"fields" : ["Hersteller" ,

```

"Ziffernblattfarbe" , "Anzeige" , "Uhrwerk" , "Armbandfarbe" ,  
"Funktionen" , "Armbandmaterial" ] } , "all\_terms" : true } }  
}

}

There should be over 30 facets, but it always returns 10. I tried less  
terms and always two terms and then the correct facets are showing.  
But never more than ten 😉

I use this for the output right now:

$response = json\_decode($jason\_output, true);

$output = '' ;

$output.= print\_r($response['hits']['hits']);

$output.= print\_r($response['facets']);

On a side note: Will i have performance issues if i always run against  
all elements as long as there are less than ~5k objects ?

thx a lot in advance !

---

<div class="post-metadata">

**Author:** ![Kartavya](https://avatars.discourse-cdn.com/v4/letter/k/65b543/32.png) [@Kartavya](https://discuss.elastic.co/u/Kartavya)\
**Post date:** [December 27, 2011, 5:28am UTC](https://discuss.elastic.co/t/facets-are-missing-only-10/6240/2 "2011-12-27T05:28:25Z")

</div>

By Default Elasticsearch gives 10 results.  
You can put size with facet search.

Regards,  
Pulkit Agrawall

On Tue, Dec 27, 2011 at 10:31 AM, mrblue  
[john.agricola.27@googlemail.com](mailto:john.agricola.27@googlemail.com) wrote:

> Hi,
> 
> i try to make some facets here, but some are missing - elasticsearch  
> always return 10 facets in random order:
> 
> {  
> "query" : { "match\_all" : { } }
> 
> ```
> ,
> 
> "facets" : {
> "uhren-facetten" : { "terms" : {"fields" : ["Hersteller" ,
> 
> ```
> 
> "Ziffernblattfarbe" , "Anzeige" , "Uhrwerk" , "Armbandfarbe" ,  
> "Funktionen" , "Armbandmaterial" ] } , "all\_terms" : true } }  
> }
> 
> }
> 
> There should be over 30 facets, but it always returns 10. I tried less  
> terms and always two terms and then the correct facets are showing.  
> But never more than ten 😉
> 
> I use this for the output right now:
> 
> $response = json\_decode($jason\_output, true);
> 
> $output = '' ;
> 
> $output.= print\_r($response['hits']['hits']);
> 
> $output.= print\_r($response['facets']);
> 
> On a side note: Will i have performance issues if i always run against  
> all elements as long as there are less than ~5k objects ?
> 
> thx a lot in advance !

---

<div class="post-metadata">

**Author:** ![mrblue](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mrblue/32/23268_2.png) [@mrblue](https://discuss.elastic.co/u/mrblue)\
**Post date:** [December 27, 2011, 5:50am UTC](https://discuss.elastic.co/t/facets-are-missing-only-10/6240/3 "2011-12-27T05:50:15Z")

</div>

This was it, thx. Had to figure out where to put it.. if anyone  
wonders:

{  
"query" : { "match\_all" : { } }

```
  ,

"facets" : {
  "uhren-facetten" : { "terms" : {"fields" : ["Hersteller" ,

```

"Ziffernblattfarbe" , "Anzeige" , "Uhrwerk" , "Armbandfarbe" ,  
"Funktionen" , "Armbandmaterial" ], "size" : "20" } , "all\_terms" :  
true } }  
}

}

On Dec 27, 6:28 am, Pulkit Agrawal [pulkitdot...@gmail.com](mailto:pulkitdot...@gmail.com) wrote:

> By Default Elasticsearch gives 10 results.  
> You can put size with facet search.
> 
> Regards,  
> Pulkit Agrawall
> 
> On Tue, Dec 27, 2011 at 10:31 AM, mrblue
> 
> [john.agricola...@googlemail.com](mailto:john.agricola...@googlemail.com) wrote:
> 
> > Hi,
> 
> > i try to make some facets here, but some are missing - elasticsearch  
> > always return 10 facets in random order:
> 
> > {  
> > "query" : { "match\_all" : { } }
> 
> > ```
> > ,
> > 
> > ```
> 
> > ```
> > "facets" : {
> > "uhren-facetten" : { "terms" : {"fields" : ["Hersteller" ,
> > 
> > ```
> > 
> > "Ziffernblattfarbe" , "Anzeige" , "Uhrwerk" , "Armbandfarbe" ,  
> > "Funktionen" , "Armbandmaterial" ] } , "all\_terms" : true } }  
> > }
> 
> > }
> 
> > There should be over 30 facets, but it always returns 10. I tried less  
> > terms and always two terms and then the correct facets are showing.  
> > But never more than ten 😉
> 
> > I use this for the output right now:
> 
> > $response = json\_decode($jason\_output, true);
> 
> > $output = '' ;
> 
> > $output.= print\_r($response['hits']['hits']);
> 
> > $output.= print\_r($response['facets']);
> 
> > On a side note: Will i have performance issues if i always run against  
> > all elements as long as there are less than ~5k objects ?
> 
> > thx a lot in advance !

---

<div class="post-metadata">

**Author:** ![Kartavya](https://avatars.discourse-cdn.com/v4/letter/k/65b543/32.png) [@Kartavya](https://discuss.elastic.co/u/Kartavya)\
**Post date:** [December 27, 2011, 6:01am UTC](https://discuss.elastic.co/t/facets-are-missing-only-10/6240/4 "2011-12-27T06:01:26Z")

</div>

try this

{  
"query" : { "match\_all" : { } }

```
     ,

   "facets" : {
 "uhren-facetten" : { "terms" : {"fields" : ["Hersteller" ,

```

"Ziffernblattfarbe" , "Anzeige" , "Uhrwerk" , "Armbandfarbe" ,  
"Funktionen" , "Armbandmaterial" ], "size" : 20 } , "all\_terms" :  
true } }

i.e without quotes around 20

On Tue, Dec 27, 2011 at 11:20 AM, mrblue  
[john.agricola.27@googlemail.com](mailto:john.agricola.27@googlemail.com) wrote:

> This was it, thx. Had to figure out where to put it.. if anyone  
> wonders:
> 
> {  
> "query" : { "match\_all" : { } }
> 
> ```
> ,
> 
> "facets" : {
> "uhren-facetten" : { "terms" : {"fields" : ["Hersteller" ,
> 
> ```
> 
> "Ziffernblattfarbe" , "Anzeige" , "Uhrwerk" , "Armbandfarbe" ,  
> "Funktionen" , "Armbandmaterial" ], "size" : "20" } , "all\_terms" :  
> true } }  
> }
> 
> }
> 
> On Dec 27, 6:28 am, Pulkit Agrawal [pulkitdot...@gmail.com](mailto:pulkitdot...@gmail.com) wrote:
> 
> > By Default Elasticsearch gives 10 results.  
> > You can put size with facet search.
> > 
> > Regards,  
> > Pulkit Agrawall
> > 
> > On Tue, Dec 27, 2011 at 10:31 AM, mrblue
> > 
> > [john.agricola...@googlemail.com](mailto:john.agricola...@googlemail.com) wrote:
> > 
> > > Hi,
> > 
> > > i try to make some facets here, but some are missing - elasticsearch  
> > > always return 10 facets in random order:
> > 
> > > {  
> > > "query" : { "match\_all" : { } }
> > 
> > > ```
> > > ,
> > > 
> > > ```
> > 
> > > ```
> > > "facets" : {
> > > "uhren-facetten" : { "terms" : {"fields" : ["Hersteller" ,
> > > 
> > > ```
> > > 
> > > "Ziffernblattfarbe" , "Anzeige" , "Uhrwerk" , "Armbandfarbe" ,  
> > > "Funktionen" , "Armbandmaterial" ] } , "all\_terms" : true } }  
> > > }
> > 
> > > }
> > 
> > > There should be over 30 facets, but it always returns 10. I tried less  
> > > terms and always two terms and then the correct facets are showing.  
> > > But never more than ten 😉
> > 
> > > I use this for the output right now:
> > 
> > > $response = json\_decode($jason\_output, true);
> > 
> > > $output = '' ;
> > 
> > > $output.= print\_r($response['hits']['hits']);
> > 
> > > $output.= print\_r($response['facets']);
> > 
> > > On a side note: Will i have performance issues if i always run against  
> > > all elements as long as there are less than ~5k objects ?
> > 
> > > thx a lot in advance !

---

<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:44am UTC](https://discuss.elastic.co/t/facets-are-missing-only-10/6240/5 "2017-07-06T03:44:19Z")

</div>


