# Structure of Kibanas "Micro Analysis" query

**URL:** https://discuss.elastic.co/t/structure-of-kibanas-micro-analysis-query/18853
**Category:** Elasticsearch
**Created:** [July 24, 2014, 2:08am UTC](https://discuss.elastic.co/t/structure-of-kibanas-micro-analysis-query/18853 "2014-07-24T02:08:57Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Finn\_Poitier](https://avatars.discourse-cdn.com/v4/letter/f/ccd318/32.png) [@Finn\_Poitier](https://discuss.elastic.co/u/Finn_Poitier)
#### Post date: [July 24, 2014, 2:08am UTC](https://discuss.elastic.co/t/structure-of-kibanas-micro-analysis-query/18853/1 "2014-07-24T02:08:57Z")

</div>

Kindly enough, the queries being used in Kibana are mostly shown via the  
information icon "i". But unfortunately there´s no query shown for the  
"micro analyses" of specific fields and I wonder about their structure  
actually.

Let me explain:

For example the micro analysis for the field user.screen\_name would show me  
10 users with the highest doc\_count and I would query them this way:

{  
"query": { "match\_all": {} },  
"aggs": {  
"user\_list": {  
"terms": {  
"field": "user.screen\_name",  
"size": 10  
}  
}

},  
"size": 0  
}

But this obviously only works because the screen\_name is a single string  
without any more terms in the field. For another field, such as user.name,  
which probably consists of more than just one term (first name, last name),  
the query above wouldn´t work anymore.

Somewhere else I saw the suggestion to redindex the documents and set the  
mapping to: "user.name": "not\_analysed" which leads to the effect, that the  
entire field gets handled as one single term.

But this is not what I want and as Kibana successfully queries its micro  
analysis on fields, which indeed _are_ mapped with an analyser, I´d like to  
find out, how the query would look like.

Thanks for your help on this! 🙂

--  
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/42f2a7f9-12c1-46ea-9e2d-1746de65ebb6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/42f2a7f9-12c1-46ea-9e2d-1746de65ebb6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:13am UTC](https://discuss.elastic.co/t/structure-of-kibanas-micro-analysis-query/18853/2 "2017-07-06T01:13:37Z")

</div>


