# Table Aggregating On Text Field

**URL:** <https://discuss.elastic.co/t/table-aggregating-on-text-field/202588>\
**Category:** Kibana\
**Created:** [October 7, 2019, 8:12pm UTC](https://discuss.elastic.co/t/table-aggregating-on-text-field/202588 "2019-10-07T20:12:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)\
**Post date:** [October 7, 2019, 8:12pm UTC](https://discuss.elastic.co/t/table-aggregating-on-text-field/202588/1 "2019-10-07T20:12:54Z")

</div>

Ive got two tables of URLs, one of them counts the number of visits for the root path of a URL and the other is a list of all URLs visited. The field, `url.path`, is indexed as both a text and keyword field. I would like to be able to filter by a value on the root path table and the all urls table show everything under the root path.

As an example, below is my root paths table.  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/b/fb7f5b6eb7e8e17799999c8fb9f6bd3a62580a42.png)

I would like to be able to filter by /healthandwellness, which in turn would display the following in my all URLs table:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/f/8f58d9239c08bb13785f5a057cf14f7e7489b8f3.png)

Right now, it doesn't work that way, because they're both looking at the keyword field. I guess the better question is, can I create a table that aggregates on a non-keyword? I realize I can use the search bar and enter `url: \/healthandwellness`, but I'm trying to get this to work for non-technical users.

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [October 11, 2019, 1:36pm UTC](https://discuss.elastic.co/t/table-aggregating-on-text-field/202588/2 "2019-10-11T13:36:51Z")

</div>

What I would do, either at ingest time or with a scripted field would be to create a field that only contains the root path, and then use that to display in the first table and filtering with + and - signs will work properly.

---

<div class="post-metadata">

**Author:** ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)\
**Post date:** [October 12, 2019, 4:01am UTC](https://discuss.elastic.co/t/table-aggregating-on-text-field/202588/3 "2019-10-12T04:01:58Z")

</div>

As shown in the images of the original post, I already have a field that contains only the root paths. The field is stored as both text and keyword data types, but Kibana will only let me create a table based on the keyword data type. Meaning that filtering on that table's value will only return exact matches.

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [October 31, 2019, 9:30pm UTC](https://discuss.elastic.co/t/table-aggregating-on-text-field/202588/4 "2019-10-31T21:30:10Z")

</div>

You can only visualize keyword fields, but you can add a filter using the full query DSL- so if you have a `text` mapping and a `keyword` mapping for these paths, you can filter by the text and visualize the keywords.

---

<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:** [November 28, 2019, 9:30pm UTC](https://discuss.elastic.co/t/table-aggregating-on-text-field/202588/5 "2019-11-28T21:30:16Z")

</div>

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