Hybrid queries

Qualified and free form input can be combined. This can be helpful, for instance, when the end-user inputs the free-form text into a single search box while the application provides the structured elements in the background for local focus.

Another example, when the application provides to the end-user an input box for a free-form address text and e.g. a drop-down box for postal codes.

The address query 141 Boulevard Émile Thomas with postal code set to 83300 can be formulated with the following:

GET https://geocode.search.hereapi.com/v1/
    geocode
    ?q=141+Boulevard+Émile+Thomas
    &qq=
        postalCode=83300

Authorization: Bearer [your token]

The response to the above request looks like the following:

{
  "items": [
    {
      "title": "141 Boulevard Émile Thomas, 83300 Draguignan, France",
      "id": "here:af:streetsection:hqlRKFTx4wa5F6e9DhA2HA:EAIaAzE0MShk",
      "resultType": "houseNumber",
      "houseNumberType": "interpolated",
      "address": {
        "label": "141 Boulevard Émile Thomas, 83300 Draguignan, France",
        "countryCode": "FRA",
        "countryName": "France",
        "state": "Provence-Alpes-Côte d'Azur",
        "county": "Var",
        "city": "Draguignan",
        "street": "Boulevard Émile Thomas",
        "postalCode": "83300",
        "houseNumber": "141"
      },
      "position": {
        "lat": 43.52948,
        "lng": 6.48007
      },
      "access": [
        {
          "lat": 43.52945,
          "lng": 6.48025
        }
      ],
      "mapView": {
        "west": 6.47883,
        "south": 43.52858,
        "east": 6.48131,
        "north": 43.53038
      },
      "scoring": {
        "queryScore": 1,
        "fieldScore": {
          "streets": [
            1
          ],
          "houseNumber": 1,
          "postalCode": 1
        }
      }
    }
  ]
}

More details about /geocode parameters can be found in the API Reference.

results matching ""

    No results matching ""