# Changing facets type

**URL:** <https://discuss.dgraph.io/t/changing-facets-type/7251>\
**Category:** Dgraph\
**Tags:** mutation\
**Created:** [June 17, 2020, 2:16pm UTC](https://discuss.dgraph.io/t/changing-facets-type/7251 "2020-06-17T14:16:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kostjaigin](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/kostjaigin/32/3520_2.png) [@kostjaigin](https://discuss.dgraph.io/u/kostjaigin)\
**Post date:** [June 17, 2020, 2:16pm UTC](https://discuss.dgraph.io/t/changing-facets-type/7251/1 "2020-06-17T14:16:39Z")

</div>

Hi!

I am new to Dgraph and i am still getting to know the tool. I followed [this recommendation engine tutorial](https://dgraph.io/blog/post/recommendation/) and was able to do everything except the last part with cosine distance - i was permanently getting “Division by zero” errors.

 ![Screenshot 2020-06-17 at 16.11.16](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/d/decf169afe12e9fd321ba779f394c27917541912.png)  
I got stuck there. For a long time.  
But today i found out that dgraph interpreted rating @facets of rated and ~rated edges as integers and i started to read and found out that dgraph tries to find out the data type of the data set itself.  
The fact dgraph interprets my ratings from ML-100K dataset as integers is supposedly causing my “divide by zero” extensions when i try to execute the query for cosine distance. **Is there a way to change the type behind these facets?** I will have to reload the dataset correct?

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [June 17, 2020, 3:18pm UTC](https://discuss.dgraph.io/t/changing-facets-type/7251/2 "2020-06-17T15:18:29Z")

</div>

> [@kostjaigin](#):
>
> Is there a way to change the type behind these facets?

Nope, facets have a fixed/implicit type. This error you got is due some of the vars are returning zero. And math functions won’t accept divisions by zero. And feels like “ML-100K” should be a int, no?
