How to set a NamedSearchOption in xLocate 1

deals with geocoding and reverse geocoding

How to set a NamedSearchOption in xLocate 1

Postby Bernd Welter » Thu Sep 19, 2019 4:03 pm

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 2 times
  • Such a file tunes the engine via more than 50 parameters, e.g.
    xml code
    <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:
    javascript code
    {
    "$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
Senior Technical Consultant Developer Components
PTV GROUP - Germany

Bernd at Youtube
User avatar
Bernd Welter
Site Admin
 
Posts: 1395
Joined: Mon Apr 14, 2014 10:28 am

Return to PTV xLocateServer

cron