Further followup – debugging through the code I discovered /directorist/includes/classes/class-geo-query.php which I suspect is managing the query handling the radius search. A simple test of 35 miles around the zip code 45237 yields the following query (among, many, many others, but this is the only one that seems like it relates to geo data and may be related to the zip code):
wp_5_posts.ID, ( 3959 * acos( cos( radians(48.164960) ) * cos( radians( atbdp_geo_query_lat.meta_value ) ) * cos( radians( atbdp_geo_query_lng.meta_value ) – radians(21.988825) ) + sin( radians(48.164960) ) * sin( radians( atbdp_geo_query_lat.meta_value ) ) ) ) AS atbdp_geo_query_distance
(note the posts table is wp_5_posts, because this is a subsite of multisite wp install)
Note that the Lat/Long in the query is from somewhere in Hungary rather than in Ohio, USA (which is where my search zip code is located). My guess is that this is trying to take the search zip code and converting it to lat/long so it can be compared against other listings, but it is getting the wrong zip somehow? The other logical alternative is that the query is one of the listings it is trying to compare against, but that isn’t true since I have 100+ pages of listings but only one this query appears to use lat/long data.
I double checked – and the lat/long for hungary is what shows up in the hidden fields associated to the zip/radius search control. I also noticed that as I type the zipcode in, a menu appears to select from – apparently different countries that the zipcode could match on, and even though I select US, it still brings in the lat/long for hungary.
I went ahead and reset the search filter, then entered the 45237 zip again, and the lat/long showing in the hidden controls is now correct. however, searching on that zip with a radius of 28 miles returns no hits, whereas a search with a radius of 0 miles returns a single hit (the one entry is in that exact zip code). You can see an image of the developer tool data here: https://ibb.co/GTPMJzw
Not sure at this point what more info I can gather from my end.
-
This reply was modified 4 months, 1 week ago by mflc.
-
This reply was modified 4 months, 1 week ago by mflc.