I'm looking at how to add geolocation fields (https://www.drupal.org/project/geolocation) to an index (with a view to getting them to work with search_api_location...).
One stumbling block is that I need multiple fields on the index for a location query to work -- geolocation's Views filter expects the lat_sin, lat_cos, lng_rad to be present on the view.
Following the same pattern, what I was thinking to do for SearchAPI views is to have the geolocation field added as a whole to the index.
But the UI won't let me do this because the main property for the geolocation field is 'value', and that isn't found in the nested properties: so this code won't let the main field be added:
$main_property = $property->getMainPropertyName();
if ($main_property && isset($nested_properties[$main_property])) {
$parent_child_type = $property->getDataType() . '.';
$property = $nested_properties[$main_property];
$parent_child_type .= $property->getDataType();
unset($nested_properties[$main_property]);
$can_be_indexed = TRUE;
}
I suspect that is because geolocation module isn't correctly defining its field type in some way?
But even if that were fixed, I'm confused by the code above: if the main property were found to match a nested property, then only that one nested property is added.
Is there a way to cause all the nested properties of a field to get indexed?
Comments
Comment #2
veronicaSeveryn CreditAttribution: veronicaSeveryn commentedLinking to the issue inside Geolocation module where someone provided a custom fix, which could be elaborated into a stable patch.
Comment #3
geek-merlinThis looks solved now.
Comment #4
drunken monkeyThen I guess you meant to set it to "Fixed"?