StructuredSearchSession

public protocol StructuredSearchSession

A session represents the current state of the structured search process. The search proceeds as a series of steps and intermediate searches until the client reaches the destination address.

  1. The session starts with the StructuredSearchSession.fetchStructuredSearchState(completion:) call, which returns the initial state.
  2. Then, the client can select a candidate in the current step with the ‘StructuredSearchSession.selectCandidate(candidate:completion:)call. [Optional] 3. After proceeding with the search, the client can go back to the previous step with theStructuredSearchSession.goBack(step:completion:)` call.

Here is a flow to get to the house address using Structured Search:

  • prefecture/metropolitan -> municipality -> oaza -> chome/aza -> (gaiku-)houseNumber(-sub)

For example:

  • “Japan” -> “Saitama Prefecture” -> “Saitama City Minami Ward” -> “Negishi” -> “5 chome” -> “2-13-3”

    Note

    for more information, see StructuredSearch documentation.
  • goBack(completion:) Extension method

    Go back to the previous selection from current step. If nothing was selected before, nothing will happen.

    Declaration

    Swift

    public func goBack(completion: @escaping (Result<StructuredSearchResponse, Error>) -> ())

    Parameters

    completion

    The completion closure is called after the response to the request has been processed. If no errors occurred, StructuredSearchResponse contains the latest structured search state.