Problem sorting with "geoDistance"

I’m creating nodes with “NodeLib” and these contents all have a “data” object as one property with some attributes, one of these attributes is a geo location (ex: “55.45111,12.45111”).

Now, I have to query these contents by some attributes and sort them based on the geo location. For example:

{
	query: "_path LIKE '/mynode/*' AND data.attr1 = 'val1' AND data.attr2 = 'val2'",
	sort: "geoDistance('data.location', '55.45111,12.45111')"
}

or like this:

{
	query: "_path LIKE '/mynode/*'",
	sort: "geoDistance('data.location', '55.45111,12.45111')"
}

My problem is that it seems that the sort is not taking effect, I have contents with geolocation exactly like the one that I’m querying for but it does not come as the first. I’m thinking that it has something to do with indexing and I tried to create the node with the property below, but it also did not work:

_indexConfig: {
	configs: [
		{
			path: 'data.location',
			config: {
				decideByType: true,
				enabled: true,
				nGram: false,
				fulltext: false
			}
		}
	]
}

I wonder what I’m doing wrong here and I’d love some help.

Enonic version: 7.6.0
OS: Ubuntu 20

Are you storing the value as a geopoint?

Yeah, did not know about this. A coworker gave me this tip and it worked.