タグで検索します

メモ

API のエンドポイントは https://xyz.api.here.com/hubです。

機能にタグが割り当てられていますか ? その後、次のようにしてフィーチャーを検索できます。

リクエスト

Swagger で試してください

GET /spaces/{spaceId}/search?tags=mountain

応答

{
  "type": "FeatureCollection",
  "features": [
    {
      "id": "{featureId}",
      "bbox": [
        -125.8948,
        52.2131,
        -125.8948,
        52.2131
      ],
      "type": "Feature",
      "properties": {
        "name": "Glacier Mountain",
        "@ns:com:here:xyz": {
          "tags": [
            "mountain",
            "canada"
          ],
          "space": "{spaceId}",
          "createdAt": 1529927311578,
          "updatedAt": 1529927778325
        }
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          -125.8948,
          52.2131
        ]
      }
    }
  ]
}

これは、タグによる検索の最も簡単なバージョンにすぎません。 あなたの都市またはあなたの地域のすべてのレストランをあなたのスペースに持っていることを想像しなさい。 もちろん、食べ物の種類、食べ物の種類、料理の種類に応じて熱心にタグを付けてきました。 インド料理が菜食であれば、今夜インド料理を食べることに関心を持っているユーザーがいる可能性があります。 菜食以外のインド料理のレストランしかない場合、彼は菜食主義者に落ち着くだろう。 +AND,OR HERE Data Hub の検索リクエストは、次のようになります。

リクエスト

Swagger で試してください

GET /spaces/{spaceId}/search?tags=vegan+indian,vegetarian

応答

{
  "type": "FeatureCollection",
  "features": [
    {
      "id": "{featureId}",
      "bbox": [ ...  ],
      "type": "Feature",
      "properties": {
        "name": "...",
        "@ns:com:here:xyz": {
          "tags": [
            "vegetarian",
            "mexican"
          ],
          "space": "{spaceId}",
          "createdAt": ...,
          "updatedAt": ...
        }
      },
      "geometry": {
        "type": "Point",
        "coordinates": [ ... ]
      }
    },
    {
      "id": "{featureId}",
      "bbox": { ... },
      "type": "Feature",
      "properties": {
        "name": "...",
        "@ns:com:here:xyz": {
          "tags": [
            "vegan",
            "indian"
          ],
          "space": "{spaceId}",
          "createdAt": ...,
          "updatedAt": ...
        }
      },
      "geometry": {
        "type": "Point",
        "coordinates": [ ... ]
      }
    }
  ]
}

」に一致する結果は 件です

    」に一致する結果はありません