Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.37k stars 4.79k forks source link

[BUG] Can't index Geospatial Data #17228

Closed thdotnet closed 3 years ago

thdotnet commented 3 years ago

Using the provided SimpleFieldAttribute for a GeographyPoint, it's creating a complex field rather than Edm.GeographyPoint. Also, if I try to push data to a manually created Edm.GeographyPoint field in my index: GeographyPoint.Create(item.Latitude, item.Longitude)

I'm getting the following error:

The request is invalid. Details: parameters : Invalid GeoJSON. The 'type' member is required, but was not found. Indeed there's no type when GeographyPoint is serialized:

{"Latitude":80.206673,"Longitude":13.018703,"IsEmpty":false,"Z":null,"M":null,"CoordinateSystem":{"EpsgId":4326,"Id":"4326","Name":"WGS84"}}

So in summary, how to add GeographyPoint data to an index? Is there any updated sample application on Github or somewhere else? Should I add data using REST rather than the official Nuget package?

jsquire commented 3 years ago

Hi @thdotnet. Thank you for your feedback and we regret that you're experiencing difficulties. Unfortunately, I'm not able to determine what library you're working with from the context in your description. Would you please help me understand more about your environment and scenario so that I can route you to the right folks to assist?

jcelgin-bh commented 3 years ago

Hi @jsquire , I am also seeing this behavior, using Azure.Search.Documents 11.2.0-beta.2. If it would be helpful, I can probably produce a minimum repro app.

thdotnet commented 3 years ago

Hi friends,

using the beta package is working fine. Here's a sample: https://stackoverflow.com/a/65079044/1384539