Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate automaticRadius deserialization issue #518

Closed
aseure opened this issue Jul 15, 2019 · 0 comments · Fixed by #523
Closed

Investigate automaticRadius deserialization issue #518

aseure opened this issue Jul 15, 2019 · 0 comments · Fixed by #523

Comments

@aseure
Copy link

aseure commented Jul 15, 2019

A user reported the following issue by email to us:

Thank you for reading this. I have a quick question and I am wondering if you could help :) I am using Algolia geosearch in my Golang backend, version 3.0.0. I am trying to call like this:

index = client.InitIndex("PartiersLocation")
res, err := index.Search("",
                           opt.AroundLatLng(
fmt.Sprintf("%f, %f", partier.Location.Lat, partier.Location.Lng))

And in the documentation here it seems like this should just work. but it does not work. I am getting this error message about automatic radius:

cannot deserialize response's body: json: cannot unmarshal string into Go struct field QueryRes.automaticRadius of type float64

Everything works correctly when I specify a radius like so:

res, err := index.Search("",
                           opt.AroundLatLng(fmt.Sprintf("%f, %f", partier.Location.Lat, partier.Location.Lng)),
                           opt.AroundRadius(20000))

but I believe I shouldn't have to do that according to the documentation.

What is wrong here? Am I doing something wrong? Or calling something incorrectly? Would love your thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant