Pie Chart & Data Table not identifying fields correctly

There is some misbehaviour in grafana Pie chart and Data Table.

I have a field called Sites in elasticsearch.

Here is the problem,

The field names are like this,

  • ABC University
  • XYZ college
  • MNO school

Now, when I use the group by query on these sites, these are taken as 6 sites,

  • ABC
  • University
  • XYZ
  • College
  • MNO
  • College

Screenshot from 2017-09-08 17-51-34

These are 3 sites, taken as 6 sites.

The same thing happens in Data Table.

Is there any solution for this ?

Sounds like an indexing problem. They should be indexed as keywords but it sounds like they are indexed as text.