• Resolved simonb57

    (@simonb57)


    Hello,

    First I’d like to thank you for this amazing plugin, it saved me a lot of time !

    Unfortunately, I encounter a problem when I query the French version of a city located in the United States. For example:

    $query = new WP_Query([
          "post_type" => "users",
          "geo_query" => [
            "location" => "Las Vegas, Nevada, états-Unis",
            "radius" => 10,
            "units" => "km"
          ]
        ]);

    This query returns the complete list of users, even though none of them are located near Las Vegas.

    I tried with several other cities like Seattle or New York, same behavior.
    The request is working fine with other country or when I send the english version of the city “Las Vegas, NV, USA”.

    Do you have any idea how I can solve this problem? Or if it’s a problem with your plugin?

Viewing 1 replies (of 1 total)
  • Plugin Author jhackett1

    (@jhackett1)

    Hello,

    Probably a bit late to be of assistance to you, but for anyone else coming across this:

    The issue is with the third-party service used to geocode search queries into coordinates, in this case, Nominatim.

    These services are often US-based and that bias is reflected in how they work.

    Often, there’s a way to specify a “region” that it will search within to make sure irrelevant results aren’t returned.

    For example, Nominatim has a country parameter: https://nominatim.org/release-docs/develop/api/Search/

    The code on line 4 of inc/geocoder.php could be adapted to include this country parameter.

Viewing 1 replies (of 1 total)
  • The topic ‘Bug when location is in french’ is closed to new replies.