Page 1 of 1

How to set a NamedSearchOption in xLocate 1

Posted: Thu Sep 19, 2019 4:03 pm
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 316 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