# Limit the number of search result in a dashboard

**URL:** https://discuss.elastic.co/t/limit-the-number-of-search-result-in-a-dashboard/85568
**Category:** Kibana
**Created:** [May 12, 2017, 1:05pm UTC](https://discuss.elastic.co/t/limit-the-number-of-search-result-in-a-dashboard/85568 "2017-05-12T13:05:42Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![ssiws](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@ssiws](https://discuss.elastic.co/u/ssiws)
#### Post date: [May 12, 2017, 1:05pm UTC](https://discuss.elastic.co/t/limit-the-number-of-search-result-in-a-dashboard/85568/1 "2017-05-12T13:05:42Z")

</div>

Hello,

is it possible to limit the number of results returned by a Saved Search on a dashboard ?

I want to display the last 100 documents for example. I can't use a datatable because I don't want aggregation, etc...

Thanks

---

<div class="post-metadata">

### Author: ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)
#### Post date: [May 12, 2017, 1:09pm UTC](https://discuss.elastic.co/t/limit-the-number-of-search-result-in-a-dashboard/85568/2 "2017-05-12T13:09:16Z")

</div>

Hello,  
You can change the number of results by changing this setting inside Management -\> Advanced Settings: `discover:sampleSize`  
The default is 500.

---

<div class="post-metadata">

### Author: ![ssiws](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@ssiws](https://discuss.elastic.co/u/ssiws)
#### Post date: [May 12, 2017, 1:23pm UTC](https://discuss.elastic.co/t/limit-the-number-of-search-result-in-a-dashboard/85568/3 "2017-05-12T13:23:29Z")

</div>

The saved search shown on the dashboard doesn't take this limit into account.

---

<div class="post-metadata">

### Author: ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)
#### Post date: [May 12, 2017, 1:35pm UTC](https://discuss.elastic.co/t/limit-the-number-of-search-result-in-a-dashboard/85568/4 "2017-05-12T13:35:05Z")

</div>

OK, I see the bug, i'll add it in Github and make sure that the setting is taken in account when using saved search queries on the dashboard as well.  
In the meantime you can modify the saved search in the Management -\> Saved Objects page and add `"size": 10` to the search object, like in the screenshot below.

 ![](https://us1.discourse-cdn.com/elastic/original/3X/f/a/fa3c14fbee0d717d4ee5b310aab9d9d1bfed29e7.png)

---

<div class="post-metadata">

### Author: ![ssiws](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@ssiws](https://discuss.elastic.co/u/ssiws)
#### Post date: [May 12, 2017, 1:54pm UTC](https://discuss.elastic.co/t/limit-the-number-of-search-result-in-a-dashboard/85568/5 "2017-05-12T13:54:41Z")

</div>

Ok, but it's still the same problem.

Here is the full json object:

```
{
  "index": "winlogbeat-*",
  "query": {
    "query_string": {
      "analyze_wildcard": true,
      "query": "*"
    }
  },
  "filter": [],
  "size": 10,
  "highlight": {
    "pre_tags": [
      "@kibana-highlighted-field@"
    ],
    "post_tags": [
      "@/kibana-highlighted-field@"
    ],
    "fields": {
      "*": {}
    },
    "require_field_match": false,
    "fragment_size": 2147483647
  },
  "highlightAll": true
}
```

---

<div class="post-metadata">

### Author: ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)
#### Post date: [May 12, 2017, 2:40pm UTC](https://discuss.elastic.co/t/limit-the-number-of-search-result-in-a-dashboard/85568/6 "2017-05-12T14:40:22Z")

</div>

And it still shows all of them on the dashboard? For me it just shows 10 and it doesn't let you tab through more:

 ![](https://us1.discourse-cdn.com/elastic/original/3X/9/4/94ad53a95ae78c3be21bc881dc809259449562da.png)

Maybe you're on a different version, i'm using 5.4.0.

---

<div class="post-metadata">

### Author: ![ssiws](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@ssiws](https://discuss.elastic.co/u/ssiws)
#### Post date: [May 12, 2017, 2:59pm UTC](https://discuss.elastic.co/t/limit-the-number-of-search-result-in-a-dashboard/85568/7 "2017-05-12T14:59:58Z")

</div>

Yes, it shows everything...

I'm using 5.4.0 too

![](https://us1.discourse-cdn.com/elastic/original/3X/4/3/43986e27a11374cebb45bb3b52a7bdcf7ad81296.png)

---

<div class="post-metadata">

### Author: ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)
#### Post date: [May 12, 2017, 3:10pm UTC](https://discuss.elastic.co/t/limit-the-number-of-search-result-in-a-dashboard/85568/8 "2017-05-12T15:10:45Z")

</div>

I think I may have found the problem. I still had the `discover:sampleSize` set.  
The behavior looks like this: that setting isn't taken in account in the dashboard, unless you have the `size` field inside your saved object. So for the workaround to work for you, you need to set both limits: the size inside the the object and the advanced setting (which is the one whose number is taken into account).

I had added an issue on the Kibana repo and I'll update it with this new information. [https://github.com/elastic/kibana/issues/11758](https://github.com/elastic/kibana/issues/11758)

---

<div class="post-metadata">

### Author: ![ssiws](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@ssiws](https://discuss.elastic.co/u/ssiws)
#### Post date: [May 12, 2017, 7:40pm UTC](https://discuss.elastic.co/t/limit-the-number-of-search-result-in-a-dashboard/85568/9 "2017-05-12T19:40:01Z")

</div>

Yes! it works !  
Thank you very much for your help and for your quick response.

---

<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: [June 9, 2017, 7:49pm UTC](https://discuss.elastic.co/t/limit-the-number-of-search-result-in-a-dashboard/85568/10 "2017-06-09T19:49:02Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
