Skip to content

/AWS1/IF_GEP=>SEARCHTEXT()

About SearchText

SearchText searches for geocode and place information. You can then complete a follow-up query suggested from the Suggest API via a query id.

For more information, see Search Text in the Amazon Location Service Developer Guide.

Method Signature

METHODS /AWS1/IF_GEP~SEARCHTEXT
  IMPORTING
    !IV_QUERYTEXT TYPE /AWS1/GEPSENSITIVESTRING OPTIONAL
    !IV_QUERYID TYPE /AWS1/GEPSENSITIVESTRING OPTIONAL
    !IV_MAXRESULTS TYPE /AWS1/GEPINTEGER OPTIONAL
    !IT_BIASPOSITION TYPE /AWS1/CL_GEPPOSITION_W=>TT_POSITION OPTIONAL
    !IO_FILTER TYPE REF TO /AWS1/CL_GEPSEARCHTEXTFILTER OPTIONAL
    !IT_ADDITIONALFEATURES TYPE /AWS1/CL_GEPSRCHTXTADDLFTLST_W=>TT_SEARCHTEXTADDLFEATURELIST OPTIONAL
    !IV_LANGUAGE TYPE /AWS1/GEPLANGUAGETAG OPTIONAL
    !IV_POLITICALVIEW TYPE /AWS1/GEPCOUNTRYCODE OPTIONAL
    !IV_INTENDEDUSE TYPE /AWS1/GEPSEARCHTEXTINTENDEDUSE OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/GEPTOKEN OPTIONAL
    !IV_KEY TYPE /AWS1/GEPAPIKEY OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_gepsearchtextresponse
  RAISING
    /AWS1/CX_GEPACCESSDENIEDEX
    /AWS1/CX_GEPINTERNALSERVEREX
    /AWS1/CX_GEPTHROTTLINGEX
    /AWS1/CX_GEPVALIDATIONEX
    /AWS1/CX_GEPCLIENTEXC
    /AWS1/CX_GEPSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Optional arguments:

iv_querytext TYPE /AWS1/GEPSENSITIVESTRING /AWS1/GEPSENSITIVESTRING

The free-form text query to match addresses against. This is usually a partially typed address from an end user in an address box or form.

Exactly one of the following fields must be set: QueryText or QueryId.

iv_queryid TYPE /AWS1/GEPSENSITIVESTRING /AWS1/GEPSENSITIVESTRING

The query Id returned by the suggest API. If passed in the request, the SearchText API will preform a SearchText query with the improved query terms for the original query made to the suggest API. Not available in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.

Exactly one of the following fields must be set: QueryText or QueryId.

iv_maxresults TYPE /AWS1/GEPINTEGER /AWS1/GEPINTEGER

An optional limit for the number of results returned in a single call.

Default value: 20

it_biasposition TYPE /AWS1/CL_GEPPOSITION_W=>TT_POSITION TT_POSITION

The position, in longitude and latitude, that the results should be close to. Typically, place results returned are ranked higher the closer they are to this position. Stored in [lng, lat] and in the WGS 84 format.

Exactly one of the following fields must be set: BiasPosition, Filter.BoundingBox, or Filter.Circle.

io_filter TYPE REF TO /AWS1/CL_GEPSEARCHTEXTFILTER /AWS1/CL_GEPSEARCHTEXTFILTER

A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.

it_additionalfeatures TYPE /AWS1/CL_GEPSRCHTXTADDLFTLST_W=>TT_SEARCHTEXTADDLFEATURELIST TT_SEARCHTEXTADDLFEATURELIST

A list of optional additional parameters, such as time zone, that can be requested for each result. For GrabMaps customers, ap-southeast-1 and ap-southeast-5 regions support only the TimeZone value.

iv_language TYPE /AWS1/GEPLANGUAGETAG /AWS1/GEPLANGUAGETAG

A list of BCP 47 compliant language codes for the results to be rendered in. If there is no data for the result in the requested language, data will be returned in the default language for the entry. For GrabMaps customers, ap-southeast-1 and ap-southeast-5 regions support only the following codes: en, id, km, lo, ms, my, pt, th, tl, vi, zh

iv_politicalview TYPE /AWS1/GEPCOUNTRYCODE /AWS1/GEPCOUNTRYCODE

The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country. Not available in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.

iv_intendeduse TYPE /AWS1/GEPSEARCHTEXTINTENDEDUSE /AWS1/GEPSEARCHTEXTINTENDEDUSE

Indicates if the query results will be persisted in customer infrastructure. Defaults to SingleUse (not stored).

When storing SearchText responses, you must set this field to Storage to comply with the terms of service. These requests will be charged at a higher rate. Please review the user agreement and service pricing structure to determine the correct setting for your use case.

iv_nexttoken TYPE /AWS1/GEPTOKEN /AWS1/GEPTOKEN

If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page.

iv_key TYPE /AWS1/GEPAPIKEY /AWS1/GEPAPIKEY

Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.

RETURNING

oo_output TYPE REF TO /aws1/cl_gepsearchtextresponse /AWS1/CL_GEPSEARCHTEXTRESPONSE

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->searchtext(
  io_filter = new /aws1/cl_gepsearchtextfilter(
    io_circle = new /aws1/cl_gepfiltercircle(
      it_center = VALUE /aws1/cl_gepposition_w=>tt_position(
        ( new /aws1/cl_gepposition_w( |0.1| ) )
      )
      iv_radius = 123
    )
    it_boundingbox = VALUE /aws1/cl_gepboundingbox_w=>tt_boundingbox(
      ( new /aws1/cl_gepboundingbox_w( |0.1| ) )
    )
    it_includecountries = VALUE /aws1/cl_gepcountrycodelist_w=>tt_countrycodelist(
      ( new /aws1/cl_gepcountrycodelist_w( |string| ) )
    )
  )
  it_additionalfeatures = VALUE /aws1/cl_gepsrchtxtaddlftlst_w=>tt_searchtextaddlfeaturelist(
    ( new /aws1/cl_gepsrchtxtaddlftlst_w( |string| ) )
  )
  it_biasposition = VALUE /aws1/cl_gepposition_w=>tt_position(
    ( new /aws1/cl_gepposition_w( |0.1| ) )
  )
  iv_intendeduse = |string|
  iv_key = |string|
  iv_language = |string|
  iv_maxresults = 123
  iv_nexttoken = |string|
  iv_politicalview = |string|
  iv_queryid = |string|
  iv_querytext = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_string = lo_result->get_pricingbucket( ).
  LOOP AT lo_result->get_resultitems( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_sensitivestring = lo_row_1->get_placeid( ).
      lv_placetype = lo_row_1->get_placetype( ).
      lv_sensitivestring = lo_row_1->get_title( ).
      lo_address = lo_row_1->get_address( ).
      IF lo_address IS NOT INITIAL.
        lv_sensitivestring = lo_address->get_label( ).
        lo_country = lo_address->get_country( ).
        IF lo_country IS NOT INITIAL.
          lv_countrycode2 = lo_country->get_code2( ).
          lv_countrycode3 = lo_country->get_code3( ).
          lv_sensitivestring = lo_country->get_name( ).
        ENDIF.
        lo_region = lo_address->get_region( ).
        IF lo_region IS NOT INITIAL.
          lv_sensitivestring = lo_region->get_code( ).
          lv_sensitivestring = lo_region->get_name( ).
        ENDIF.
        lo_subregion = lo_address->get_subregion( ).
        IF lo_subregion IS NOT INITIAL.
          lv_sensitivestring = lo_subregion->get_code( ).
          lv_sensitivestring = lo_subregion->get_name( ).
        ENDIF.
        lv_sensitivestring = lo_address->get_locality( ).
        lv_sensitivestring = lo_address->get_district( ).
        lv_sensitivestring = lo_address->get_subdistrict( ).
        lv_sensitivestring = lo_address->get_postalcode( ).
        lv_sensitivestring = lo_address->get_block( ).
        lv_sensitivestring = lo_address->get_subblock( ).
        LOOP AT lo_address->get_intersection( ) into lo_row_2.
          lo_row_3 = lo_row_2.
          IF lo_row_3 IS NOT INITIAL.
            lv_intersectionstreet = lo_row_3->get_value( ).
          ENDIF.
        ENDLOOP.
        lv_sensitivestring = lo_address->get_street( ).
        LOOP AT lo_address->get_streetcomponents( ) into lo_row_4.
          lo_row_5 = lo_row_4.
          IF lo_row_5 IS NOT INITIAL.
            lv_sensitivestring = lo_row_5->get_basename( ).
            lv_sensitivestring = lo_row_5->get_type( ).
            lv_typeplacement = lo_row_5->get_typeplacement( ).
            lv_typeseparator = lo_row_5->get_typeseparator( ).
            lv_sensitivestring = lo_row_5->get_prefix( ).
            lv_sensitivestring = lo_row_5->get_suffix( ).
            lv_sensitivestring = lo_row_5->get_direction( ).
            lv_languagetag = lo_row_5->get_language( ).
          ENDIF.
        ENDLOOP.
        lv_sensitivestring = lo_address->get_addressnumber( ).
        lv_sensitivestring = lo_address->get_building( ).
        LOOP AT lo_address->get_secaddresscomponents( ) into lo_row_6.
          lo_row_7 = lo_row_6.
          IF lo_row_7 IS NOT INITIAL.
            lv_sensitivestring = lo_row_7->get_number( ).
            lv_sensitivestring = lo_row_7->get_designator( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
      lv_sensitiveboolean = lo_row_1->get_addressnumbercorrected( ).
      LOOP AT lo_row_1->get_position( ) into lo_row_8.
        lo_row_9 = lo_row_8.
        IF lo_row_9 IS NOT INITIAL.
          lv_double = lo_row_9->get_value( ).
        ENDIF.
      ENDLOOP.
      lv_distancemeters = lo_row_1->get_distance( ).
      LOOP AT lo_row_1->get_mapview( ) into lo_row_10.
        lo_row_11 = lo_row_10.
        IF lo_row_11 IS NOT INITIAL.
          lv_double = lo_row_11->get_value( ).
        ENDIF.
      ENDLOOP.
      LOOP AT lo_row_1->get_categories( ) into lo_row_12.
        lo_row_13 = lo_row_12.
        IF lo_row_13 IS NOT INITIAL.
          lv_sensitivestring = lo_row_13->get_id( ).
          lv_sensitivestring = lo_row_13->get_name( ).
          lv_sensitivestring = lo_row_13->get_localizedname( ).
          lv_sensitiveboolean = lo_row_13->get_primary( ).
        ENDIF.
      ENDLOOP.
      LOOP AT lo_row_1->get_foodtypes( ) into lo_row_14.
        lo_row_15 = lo_row_14.
        IF lo_row_15 IS NOT INITIAL.
          lv_sensitivestring = lo_row_15->get_localizedname( ).
          lv_sensitivestring = lo_row_15->get_id( ).
          lv_sensitiveboolean = lo_row_15->get_primary( ).
        ENDIF.
      ENDLOOP.
      LOOP AT lo_row_1->get_businesschains( ) into lo_row_16.
        lo_row_17 = lo_row_16.
        IF lo_row_17 IS NOT INITIAL.
          lv_sensitivestring = lo_row_17->get_name( ).
          lv_sensitivestring = lo_row_17->get_id( ).
        ENDIF.
      ENDLOOP.
      lo_contacts = lo_row_1->get_contacts( ).
      IF lo_contacts IS NOT INITIAL.
        LOOP AT lo_contacts->get_phones( ) into lo_row_18.
          lo_row_19 = lo_row_18.
          IF lo_row_19 IS NOT INITIAL.
            lv_sensitivestring = lo_row_19->get_label( ).
            lv_sensitivestring = lo_row_19->get_value( ).
            LOOP AT lo_row_19->get_categories( ) into lo_row_12.
              lo_row_13 = lo_row_12.
              IF lo_row_13 IS NOT INITIAL.
                lv_sensitivestring = lo_row_13->get_id( ).
                lv_sensitivestring = lo_row_13->get_name( ).
                lv_sensitivestring = lo_row_13->get_localizedname( ).
                lv_sensitiveboolean = lo_row_13->get_primary( ).
              ENDIF.
            ENDLOOP.
          ENDIF.
        ENDLOOP.
        LOOP AT lo_contacts->get_faxes( ) into lo_row_18.
          lo_row_19 = lo_row_18.
          IF lo_row_19 IS NOT INITIAL.
            lv_sensitivestring = lo_row_19->get_label( ).
            lv_sensitivestring = lo_row_19->get_value( ).
            LOOP AT lo_row_19->get_categories( ) into lo_row_12.
              lo_row_13 = lo_row_12.
              IF lo_row_13 IS NOT INITIAL.
                lv_sensitivestring = lo_row_13->get_id( ).
                lv_sensitivestring = lo_row_13->get_name( ).
                lv_sensitivestring = lo_row_13->get_localizedname( ).
                lv_sensitiveboolean = lo_row_13->get_primary( ).
              ENDIF.
            ENDLOOP.
          ENDIF.
        ENDLOOP.
        LOOP AT lo_contacts->get_websites( ) into lo_row_18.
          lo_row_19 = lo_row_18.
          IF lo_row_19 IS NOT INITIAL.
            lv_sensitivestring = lo_row_19->get_label( ).
            lv_sensitivestring = lo_row_19->get_value( ).
            LOOP AT lo_row_19->get_categories( ) into lo_row_12.
              lo_row_13 = lo_row_12.
              IF lo_row_13 IS NOT INITIAL.
                lv_sensitivestring = lo_row_13->get_id( ).
                lv_sensitivestring = lo_row_13->get_name( ).
                lv_sensitivestring = lo_row_13->get_localizedname( ).
                lv_sensitiveboolean = lo_row_13->get_primary( ).
              ENDIF.
            ENDLOOP.
          ENDIF.
        ENDLOOP.
        LOOP AT lo_contacts->get_emails( ) into lo_row_18.
          lo_row_19 = lo_row_18.
          IF lo_row_19 IS NOT INITIAL.
            lv_sensitivestring = lo_row_19->get_label( ).
            lv_sensitivestring = lo_row_19->get_value( ).
            LOOP AT lo_row_19->get_categories( ) into lo_row_12.
              lo_row_13 = lo_row_12.
              IF lo_row_13 IS NOT INITIAL.
                lv_sensitivestring = lo_row_13->get_id( ).
                lv_sensitivestring = lo_row_13->get_name( ).
                lv_sensitivestring = lo_row_13->get_localizedname( ).
                lv_sensitiveboolean = lo_row_13->get_primary( ).
              ENDIF.
            ENDLOOP.
          ENDIF.
        ENDLOOP.
      ENDIF.
      LOOP AT lo_row_1->get_openinghours( ) into lo_row_20.
        lo_row_21 = lo_row_20.
        IF lo_row_21 IS NOT INITIAL.
          LOOP AT lo_row_21->get_display( ) into lo_row_22.
            lo_row_23 = lo_row_22.
            IF lo_row_23 IS NOT INITIAL.
              lv_openinghoursdisplay = lo_row_23->get_value( ).
            ENDIF.
          ENDLOOP.
          lv_sensitiveboolean = lo_row_21->get_opennow( ).
          LOOP AT lo_row_21->get_components( ) into lo_row_24.
            lo_row_25 = lo_row_24.
            IF lo_row_25 IS NOT INITIAL.
              lv_sensitivestring = lo_row_25->get_opentime( ).
              lv_sensitivestring = lo_row_25->get_openduration( ).
              lv_sensitivestring = lo_row_25->get_recurrence( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_row_21->get_categories( ) into lo_row_12.
            lo_row_13 = lo_row_12.
            IF lo_row_13 IS NOT INITIAL.
              lv_sensitivestring = lo_row_13->get_id( ).
              lv_sensitivestring = lo_row_13->get_name( ).
              lv_sensitivestring = lo_row_13->get_localizedname( ).
              lv_sensitiveboolean = lo_row_13->get_primary( ).
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDLOOP.
      LOOP AT lo_row_1->get_accesspoints( ) into lo_row_26.
        lo_row_27 = lo_row_26.
        IF lo_row_27 IS NOT INITIAL.
          LOOP AT lo_row_27->get_position( ) into lo_row_8.
            lo_row_9 = lo_row_8.
            IF lo_row_9 IS NOT INITIAL.
              lv_double = lo_row_9->get_value( ).
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDLOOP.
      LOOP AT lo_row_1->get_accessrestrictions( ) into lo_row_28.
        lo_row_29 = lo_row_28.
        IF lo_row_29 IS NOT INITIAL.
          lv_sensitiveboolean = lo_row_29->get_restricted( ).
          LOOP AT lo_row_29->get_categories( ) into lo_row_12.
            lo_row_13 = lo_row_12.
            IF lo_row_13 IS NOT INITIAL.
              lv_sensitivestring = lo_row_13->get_id( ).
              lv_sensitivestring = lo_row_13->get_name( ).
              lv_sensitivestring = lo_row_13->get_localizedname( ).
              lv_sensitiveboolean = lo_row_13->get_primary( ).
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDLOOP.
      lo_timezone = lo_row_1->get_timezone( ).
      IF lo_timezone IS NOT INITIAL.
        lv_sensitivestring = lo_timezone->get_name( ).
        lv_sensitivestring = lo_timezone->get_offset( ).
        lv_durationseconds = lo_timezone->get_offsetseconds( ).
      ENDIF.
      lv_countrycode3 = lo_row_1->get_politicalview( ).
      lo_phonemedetails = lo_row_1->get_phonemes( ).
      IF lo_phonemedetails IS NOT INITIAL.
        LOOP AT lo_phonemedetails->get_title( ) into lo_row_30.
          lo_row_31 = lo_row_30.
          IF lo_row_31 IS NOT INITIAL.
            lv_sensitivestring = lo_row_31->get_value( ).
            lv_languagetag = lo_row_31->get_language( ).
            lv_sensitiveboolean = lo_row_31->get_preferred( ).
          ENDIF.
        ENDLOOP.
        lo_addresscomponentphoneme = lo_phonemedetails->get_address( ).
        IF lo_addresscomponentphoneme IS NOT INITIAL.
          LOOP AT lo_addresscomponentphoneme->get_country( ) into lo_row_30.
            lo_row_31 = lo_row_30.
            IF lo_row_31 IS NOT INITIAL.
              lv_sensitivestring = lo_row_31->get_value( ).
              lv_languagetag = lo_row_31->get_language( ).
              lv_sensitiveboolean = lo_row_31->get_preferred( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_addresscomponentphoneme->get_region( ) into lo_row_30.
            lo_row_31 = lo_row_30.
            IF lo_row_31 IS NOT INITIAL.
              lv_sensitivestring = lo_row_31->get_value( ).
              lv_languagetag = lo_row_31->get_language( ).
              lv_sensitiveboolean = lo_row_31->get_preferred( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_addresscomponentphoneme->get_subregion( ) into lo_row_30.
            lo_row_31 = lo_row_30.
            IF lo_row_31 IS NOT INITIAL.
              lv_sensitivestring = lo_row_31->get_value( ).
              lv_languagetag = lo_row_31->get_language( ).
              lv_sensitiveboolean = lo_row_31->get_preferred( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_addresscomponentphoneme->get_locality( ) into lo_row_30.
            lo_row_31 = lo_row_30.
            IF lo_row_31 IS NOT INITIAL.
              lv_sensitivestring = lo_row_31->get_value( ).
              lv_languagetag = lo_row_31->get_language( ).
              lv_sensitiveboolean = lo_row_31->get_preferred( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_addresscomponentphoneme->get_district( ) into lo_row_30.
            lo_row_31 = lo_row_30.
            IF lo_row_31 IS NOT INITIAL.
              lv_sensitivestring = lo_row_31->get_value( ).
              lv_languagetag = lo_row_31->get_language( ).
              lv_sensitiveboolean = lo_row_31->get_preferred( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_addresscomponentphoneme->get_subdistrict( ) into lo_row_30.
            lo_row_31 = lo_row_30.
            IF lo_row_31 IS NOT INITIAL.
              lv_sensitivestring = lo_row_31->get_value( ).
              lv_languagetag = lo_row_31->get_language( ).
              lv_sensitiveboolean = lo_row_31->get_preferred( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_addresscomponentphoneme->get_block( ) into lo_row_30.
            lo_row_31 = lo_row_30.
            IF lo_row_31 IS NOT INITIAL.
              lv_sensitivestring = lo_row_31->get_value( ).
              lv_languagetag = lo_row_31->get_language( ).
              lv_sensitiveboolean = lo_row_31->get_preferred( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_addresscomponentphoneme->get_subblock( ) into lo_row_30.
            lo_row_31 = lo_row_30.
            IF lo_row_31 IS NOT INITIAL.
              lv_sensitivestring = lo_row_31->get_value( ).
              lv_languagetag = lo_row_31->get_language( ).
              lv_sensitiveboolean = lo_row_31->get_preferred( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_addresscomponentphoneme->get_street( ) into lo_row_30.
            lo_row_31 = lo_row_30.
            IF lo_row_31 IS NOT INITIAL.
              lv_sensitivestring = lo_row_31->get_value( ).
              lv_languagetag = lo_row_31->get_language( ).
              lv_sensitiveboolean = lo_row_31->get_preferred( ).
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDLOOP.
  lv_token = lo_result->get_nexttoken( ).
ENDIF.