api icon indicating copy to clipboard operation
api copied to clipboard

address fallback queries containing a unit no

Open missinglink opened this issue 6 years ago • 1 comments

When providing a unit number, the address fallback query does not fallback to match the correct housenumber+street even when that address is available (examples below).

The error is only triggered in the case where a unit no is provided and is clear when using debug mode to inspect the elasticsearch query, this could likely be solved by adding an additional fallback step for queries containing a unit number.

/v1/search?text=15/5-7 Esplanade, Elizabeth Bay, NSW, Australia

      "parsed_text": {
        "number": "5-7",
        "street": "esplanade",
        "neighbourhood": "elizabeth bay",
        "state": "nsw",
        "country": "australia",
        "unit": "15"
      }

# returns street
/v1/search?text=5-7 Esplanade, Elizabeth Bay, NSW, Australia

      "parsed_text": {
        "number": "5-7",
        "street": "esplanade",
        "neighbourhood": "elizabeth bay",
        "state": "nsw",
        "country": "australia"
      }
    },

# returns address

missinglink avatar Sep 05 '19 09:09 missinglink

Nice find. Hopefully we can build a query where the unit number is a should condition. The logic for falling back is already pretty complicated, and adding another "level" of fallback would make things even more complicated.

orangejulius avatar Sep 05 '19 16:09 orangejulius