# Custom search

**URL:** <https://discuss.elastic.co/t/custom-search/38591>\
**Category:** Kibana\
**Created:** [January 7, 2016, 10:13am UTC](https://discuss.elastic.co/t/custom-search/38591 "2016-01-07T10:13:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bering](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bering/32/4044_2.png) [@bering](https://discuss.elastic.co/u/bering)\
**Post date:** [January 7, 2016, 10:13am UTC](https://discuss.elastic.co/t/custom-search/38591/1 "2016-01-07T10:13:02Z")

</div>

Hi,

I have created a search in Sense that i would like to use in Kibana it that possible?

Search:

> ```
> GET logstash-duplicates-2016.01/_search
> {
> "size": 0,
> "aggs": {
> "duplicateNames2": {
> "terms": {
> "field": "MD5checksum.raw",
> "size": 750,
> "min_doc_count": 2,
> "order": {
> "name": "desc"
> }
> },
> "aggs": {
> "name": {
> "sum": {
> "field": "Size"
>                  
> }
> }
> }
> }
> }
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [January 7, 2016, 7:00pm UTC](https://discuss.elastic.co/t/custom-search/38591/2 "2016-01-07T19:00:45Z")

</div>

Not directly, no. You'll have to re-create the query using the agg builder in Visualize - that is, the interface on the left side there.

Things like `min_doc_count` we don't offer controls for in the interface, but if you click the _Advanced_ link at the bottom, it will expose a JSON input, which you can use to add that to the terms agg, like `{ "min_doc_count": 2 }`

![](https://us1.discourse-cdn.com/elastic/original/2X/1/1ab610dc41531d704021c2289732517e2c797ec0.png)

To see that you have a match, click the green play button at the top to run the aggregation, and consult the spy panel below the visualization. Opening it will expose a _Request_ area, which will allow you to see the exact request that was made to Elasticsearch.

![](https://us1.discourse-cdn.com/elastic/original/2X/7/7d6e96e9fefd8025bfbc4efd940ed6e00aa5bec5.png)

_NOTE: You won't see a Debug option if you are running a released build of Kibana_

Alternatively, you could get something close, and then save it. Then, go in to Setting \> Objects \> Visualizations, find the vis you just saved, and edit the _aggs_ section under _visState_. This is sort of a last-ditch effort though, and can lead to you breaking the visualization and putting Kibana into a weird (but recoverable) state...

---

<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:05pm UTC](https://discuss.elastic.co/t/custom-search/38591/3 "2017-07-06T14:05:34Z")

</div>


