Kentico and Collection(EDM.GeographyPoint)

Paymydoctor Login asked on May 8, 2020 06:01

I'm trying to add geolocations to an Azure index and build the type Collection(EDM.GeographyPoint), so i can have multiple geocodes attached to 1 index document.

I get this error Message: Creating or updating index 'azurecomplextypestest' failed with the following error: The request is invalid. Details: definition : The field 'geolocation' is of type 'Collection(Edm.GeographyPoint)' which is not supported in the API version used in the request.

Collection fields can only contain strings in this API version. Please upgrade to the latest API version to use collection fields of type 'Collection(Edm.GeographyPoint)'.

My version of Kentico is 12.0.53 for the following Kentico.AspNet.Mvc,Kentico.AspNet.Mvc.Libraries,Kentico.LanguagePack.English & Kentico.Libraries

Recent Answers


Dmitry Bastron answered on May 8, 2020 14:57

Well, it appears to be CMS restriction and the short answer would be "no, you can't do it".

To allow this you would be required to update Microsoft.Azure.Search.* nuget packages to a latest version 10+, because the higher version of these nuget packages targets more modern version of Azure Search API. But it will break Kentico functionality of rebuilding and updating indexes so that when you change something it won't be synchronized to Azure Search index.

I would suggest implementing this the other way round - you can create a separate index containing locations only and extend it with the parent item's data like ClassName and NodeGUID. It will allow you to search for locations and then retrieve parent items accordingly. Hope it helps.

Other option would be to contact Kentico support and ask their advice on how to update these nuget packages without breaking CMS functionality. Probably there is another way I'm just not aware of.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.