Changing facets type


I am new to Dgraph and i am still getting to know the tool. I followed this recommendation engine tutorial and was able to do everything except the last part with cosine distance - i was permanently getting “Division by zero” errors.

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?

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?