# TSVB Tophits aggregation for strings doesn't work

**URL:** <https://discuss.elastic.co/t/tsvb-tophits-aggregation-for-strings-doesnt-work/278802>\
**Category:** Kibana\
**Created:** [July 15, 2021, 2:26pm UTC](https://discuss.elastic.co/t/tsvb-tophits-aggregation-for-strings-doesnt-work/278802 "2021-07-15T14:26:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![BitBucketUser\_user](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bitbucketuser_user/32/79679_2.png) [@BitBucketUser\_user](https://discuss.elastic.co/u/BitBucketUser_user)\
**Post date:** [July 15, 2021, 2:26pm UTC](https://discuss.elastic.co/t/tsvb-tophits-aggregation-for-strings-doesnt-work/278802/1 "2021-07-15T14:26:42Z")

</div>

Hello,  
I'm using Kibana 7.13.2.  
This is my data -

```auto
POST tsvb/_bulk?refresh
{"index":{}}
{ "date":"2021-07-14T00:03:13.679+02:00","words":["rain", "thunder"],"type":"monsoon"}
{"index":{}}
{"date":"2021-07-14T00:03:13.679+02:00","words":["sun", "heat"],"type":"summer"}
{"index":{}}
{"date":"2021-07-14T00:03:13.679+02:00","words":["cold", "snow"],"type":"winter"}
{"index":{}}
{"date":"2021-07-14T00:03:13.679+02:00","words":["cold", "umberella"],"type":"monsoon"}

```

I'm tying to create a **TSVB table visualization** with the above data. I'm expecting the data to look like this - (The below image was created using the "Table aggregation" visualization and I wanted to create a similar table using TVSB since I want to use the "last value" time range feature of TVSB on this table)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/8/f8a0330980969346449073d2a7806b786d25bcd5.png)

But the Tophits aggs of TSVB isn't working as expected, these are my setting and results :

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/0/5091751e47a24476e05e14ab696db73869250518.png)  
I don't see any values under the "type" column..  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/1/f11f664fd96fc6b721b6b9b9c6d4e23ffff6a537.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/7/57b742b8ddfbf9dfe14a703b2a4f82a6c861a5fb.png)  
Can I please get some help with this? Am I going wrong anywhere?

---

<div class="post-metadata">

**Author:** ![BitBucketUser\_user](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bitbucketuser_user/32/79679_2.png) [@BitBucketUser\_user](https://discuss.elastic.co/u/BitBucketUser_user)\
**Post date:** [July 19, 2021, 10:21am UTC](https://discuss.elastic.co/t/tsvb-tophits-aggregation-for-strings-doesnt-work/278802/3 "2021-07-19T10:21:40Z")

</div>

Can I get some help on this please? 🙏

---

<div class="post-metadata">

**Author:** ![ghudgins](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ghudgins/32/138532_2.png) [@ghudgins](https://discuss.elastic.co/u/ghudgins)\
**Post date:** [July 19, 2021, 12:54pm UTC](https://discuss.elastic.co/t/tsvb-tophits-aggregation-for-strings-doesnt-work/278802/4 "2021-07-19T12:54:25Z")

</div>

Might be easier to get the table you want out of Lens than TSVB. In Lens "Top Hits" is called "Top Values"

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/8/1861a5fe5e122e47ced6776f174292c276834366.png)

---

<div class="post-metadata">

**Author:** ![BitBucketUser\_user](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bitbucketuser_user/32/79679_2.png) [@BitBucketUser\_user](https://discuss.elastic.co/u/BitBucketUser_user)\
**Post date:** [July 22, 2021, 7:23am UTC](https://discuss.elastic.co/t/tsvb-tophits-aggregation-for-strings-doesnt-work/278802/6 "2021-07-22T07:23:13Z")

</div>

Thanks for the reply.  
Right, I can use Lens but it doesn't concatenate Top values if there are more than one .  
For example in the image below I want to have a view like option "2"  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/7/671f91780a117e6011b0357a8c6df86ef01865b0.png)

As described in the OP, I get blank "Type" column in TSVB. Is that a bug in TSVB? can you please correct me if my TSVB configurations were wrong please?

**PS: I want to use TSVB because I want to use the "last value" time range feature of TVSB on this table.**

---

<div class="post-metadata">

**Author:** ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)\
**Post date:** [July 22, 2021, 12:44pm UTC](https://discuss.elastic.co/t/tsvb-tophits-aggregation-for-strings-doesnt-work/278802/7 "2021-07-22T12:44:07Z")

</div>

Hey @BitBucketUser_user, there were some limitations with top\_hit aggregation in TSVB which will be solved in 7.15.0. You can find more information [here](https://github.com/elastic/kibana/issues/101705)

---

<div class="post-metadata">

**Author:** ![BitBucketUser\_user](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bitbucketuser_user/32/79679_2.png) [@BitBucketUser\_user](https://discuss.elastic.co/u/BitBucketUser_user)\
**Post date:** [July 23, 2021, 6:31am UTC](https://discuss.elastic.co/t/tsvb-tophits-aggregation-for-strings-doesnt-work/278802/8 "2021-07-23T06:31:34Z")

</div>

Thanks for the confirmation! 😃

---

<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:** [August 20, 2021, 6:32am UTC](https://discuss.elastic.co/t/tsvb-tophits-aggregation-for-strings-doesnt-work/278802/9 "2021-08-20T06:32:29Z")

</div>

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