Using Matrix with PT with distance filter in Low Search
I have the latitude and longitude for each entry saved in a Matrix field. I'm attempting to pass this info to the {low_search} tag but it doesn't output anything.
{exp:low_search:results
channel="properties"
category="8"
distance:from="41.806204699999995|-87.6050047"
distance:to="property-location:latitude|property-location:longitude"
distance:unit="mi"
}
Am I able to target Matrix fields in this way? Matrix fields are marked searchable.
Replies
Low 16 Mar 2014 08:02
I'm afraid that's not possible at the moment. The Distance filter must use 2 Text Input channel fields, marked as decimal. It cannot target Matrix columns. Just imagine what the behaviour should be if there are multiple Matrix rows, with multiple lat/long values that differ. Which would be applicable to the entry? Since LS will only return Entries, not Matrix/Grid rows, you need to define the lat/long values as 2 separate fields.