...
Code Block |
---|
|
public GeoPoint(double latitude, double longitude)
public GeoPoint(string latitude, string longitude) |
Example of introducing the GeoPoint for indexing in a custom pipe:
Code Block |
---|
|
public class LocationItemPageAttributesPipe : IPipe<IPageIndexingCommand<LocationItemPage>>
{
public int Order => 360;
public string Name => "Location Page Attributes";
private readonly IUrlResolver _urlResolver;
public LocationItemPageAttributesPipe(IUrlResolver urlResolver)
{
_urlResolver = urlResolver;
}
public void Execute(IPageIndexingCommand<LocationItemPage> command)
{
foreach (var entry in command.Entries)
{
var contentItem = entry.OutputEntry;
var page = entry.InputEntry;
contentItem.Attributes["ImageUrl"] = new List<string> { _urlResolver.GetUrl(page.Image) };
contentItem.Attributes["Description"] = new List<string> { page.MainIntro };
contentItem.Attributes["coordinates"] = new List<GeoPoint> { new GeoPoint(page.Latitude, page.Longitude) };
}
}
} |
Troubleshooting
If you happen to receive from Hawksearch the message (also displayed in the Indexing Jobs' logs)
...