How to set a NamedSearchOption in xLocate 1

deals with geocoding and reverse geocoding in the context of PTV Geocoding&Places, PTV Geocoding&Places OSM and PTV xLocate 1 and 2
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2695
Joined: Mon Apr 14, 2014 10:28 am
Contact:

How to set a NamedSearchOption in xLocate 1

Post by Bernd Welter »

Hi there,

currently I have to deal with a task where the solution is based on "use the named search options" of xLocate 1 to override native configuration values through the API.

Though the standard documentation mentions the class NamedSearchOption the document does not really explain the meaning of this parameter. Let me close this gap:
  • The methods findAddress and findAddressByText offer a parameter array of type SearchOptionBase
  • SearchOptionBase is an abstract base class
  • Within the xLocate Server's configuration folder you can find various files named "native-*.xml", e.g.
    native-default.xml
    native-default.xml taken from a xLocate 1.28.0.1
    (4.5 KiB) Downloaded 315 times
  • Such a file tunes the engine via more than 50 parameters, e.g.

    Code: Select all

    <ExtensiveSearch Value="1" Type="bool"/>
  • You can override each and every one of those values from client side
  • A NamedSearchOption is based on two properties:
    Attribute nametypedescription
    paramStringThe parameter of the searchoption.
    valuestringThe value of the parameter.
  • So to override the extensive search parameter from the native default just set:

    Code: Select all

    {
          "$type": "NamedSearchOption",
          "value": "false",
          "param": "ExtensiveSearch"
        }
  • use this object to fill the array of the options in the signature of findAddress or findAddressByText
Feel free to get back to me in case of questions!

Best regards,
Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply