# Tokenizing a Google Merchant Centre category field

**URL:** <https://discuss.elastic.co/t/tokenizing-a-google-merchant-centre-category-field/248844>\
**Category:** Elasticsearch\
**Created:** [September 16, 2020, 2:34pm UTC](https://discuss.elastic.co/t/tokenizing-a-google-merchant-centre-category-field/248844 "2020-09-16T14:34:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Davey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_davey/32/50393_2.png) [@Ryan\_Davey](https://discuss.elastic.co/u/Ryan_Davey)\
**Post date:** [September 16, 2020, 2:34pm UTC](https://discuss.elastic.co/t/tokenizing-a-google-merchant-centre-category-field/248844/1 "2020-09-16T14:34:20Z")

</div>

I'm a new Elastic Search user.

I've been presented with a problem where I need to set up a tokenizer for a storefront category property that conforms to google merchant center category text strings

For example:  
`Apparel & Accessories > Clothing > Dresses`

I need to tokenize this string such we can search by category and sub-category.

I initially thought to tokenize the above category text to the following keyword tokens for searching:  
`Apparel & Accessories`  
`Apparel & Accessories > Clothing`  
`Apparel & Accessories > Clothing > Dresses`

I've been struggling to get this right. Is this possible?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 16, 2020, 3:31pm UTC](https://discuss.elastic.co/t/tokenizing-a-google-merchant-centre-category-field/248844/2 "2020-09-16T15:31:56Z")

</div>

Have you looked at the [path hierarchy tokenizer](https://www.elastic.co/guide/en/elasticsearch/reference/7.9/analysis-pathhierarchy-tokenizer.html)?

---

<div class="post-metadata">

**Author:** ![Ryan\_Davey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_davey/32/50393_2.png) [@Ryan\_Davey](https://discuss.elastic.co/u/Ryan_Davey)\
**Post date:** [September 16, 2020, 6:39pm UTC](https://discuss.elastic.co/t/tokenizing-a-google-merchant-centre-category-field/248844/3 "2020-09-16T18:39:24Z")

</div>

That is perfect! Thank you. I'd missed that.

---

<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:** [October 14, 2020, 6:39pm UTC](https://discuss.elastic.co/t/tokenizing-a-google-merchant-centre-category-field/248844/4 "2020-10-14T18:39:51Z")

</div>

Closed on October 14, 2020, 6:39pm UTC

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