I have some entries to filter with geo location in stores channel. I want to filter all the stores near my zip code between some miles. I implemented it with geo coder and distance filter of low search and it working fine too except the sort order.
All the entries are displaying in random order of distance. for an example:
Shop 1 : 7 ml away
Shop 2 : 20 ml away
Shop 3 : 5 ml away
I want to list the entries in asc order of distance so the output sholud be:
Shop 3 : 5 ml away
Shop 1 : 7 ml away
Shop 2 : 20 ml away
Let me know if I do something wrong.
My Form page query is:
{exp:low_search:form query="{segment_3}" result_page="/stores/search-results/" form_id="search_stores" collections="stores"}
<input type="hidden" id="location" name="distance:from" value="">
<input type="hidden" name="distance:radius" value="200">
<input type="hidden" name="distance:unit" value="mi">
<input type="text" name="search:store_country" value=""> {!--Country field of channel entry--}
<input type="text" type="keywords" name="keywords" value="{low_search_keywords}">
<input type="submit" name="submit" value="Search">
{/exp:low_search:form}
My query string get from form is /?distance:from={my_lat}|{my_long}&distance:unit=mi&keywords={keywords}&distance:radius=200&search:store_country={country}
My result query is:
{exp:low_search:results query="{segment_3}" distance:to="store_latitude|store_longitude" channel="stores" collections="stores" require_all="category" limit="6" paginate="bottom"}
<p>{title}: {low_search_distance} ml away</p>
{/exp:low_search:results}
(Asc order of low search geo location is working if I dont use KEYWORDS and use any other variable)
ey...
string)?