Skip to content

Commit af4c810

Browse files
authored
Merge pull request #215 from giuunit/main
geo loc properties
2 parents 4ce89ea + e645c02 commit af4c810

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using Newtonsoft.Json;
2+
3+
namespace Umbraco.Cms.Integrations.Search.Algolia.Models
4+
{
5+
public class GeolocProperties
6+
{
7+
[JsonProperty("lat")]
8+
public double Latitude { get; set; }
9+
10+
[JsonProperty("lng")]
11+
public double Longitude { get; set; }
12+
}
13+
}

src/Umbraco.Cms.Integrations.Search.Algolia/Models/Record.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
namespace Umbraco.Cms.Integrations.Search.Algolia.Models
1+
using Newtonsoft.Json;
2+
3+
namespace Umbraco.Cms.Integrations.Search.Algolia.Models
24
{
35
public class Record
46
{
57
public Record()
68
{
79
Data = new Dictionary<string, object>();
10+
Geoloc = new List<GeolocProperties>();
811
}
912

1013
public Record(Record record)
@@ -22,6 +25,7 @@ public Record(Record record)
2225
Path = record.Path;
2326
Url = record.Url;
2427
Data = record.Data;
28+
Geoloc = record.Geoloc;
2529
}
2630

2731
public string ObjectID { get; set; }
@@ -58,6 +62,9 @@ public Record(Record record)
5862

5963
public string Url { get; set; }
6064

65+
[JsonProperty("_geoloc")]
66+
public List<GeolocProperties> Geoloc { get; set; }
67+
6168
public Dictionary<string, object> Data { get; set; }
6269
}
6370
}

0 commit comments

Comments
 (0)