Structure of Kibanas "Micro Analysis" query

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! :slight_smile:

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/42f2a7f9-12c1-46ea-9e2d-1746de65ebb6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.