Configuration information can be set an updated for NameWorks by using the Configuration class in an application. This class
enables specifying default configuration settings and overrides through the
CompParmsOverrides class.
About this task
This task is typically completed by an application developer working works directly with
the NameWorks API. Refer to the API Reference documentation for more
information on how to use the Configuration class. Note: The requirements of a
client application determine which methods of the Configuration class are used and
how instances of this class fit into that application. This information is meant to provide a
high-level description of the steps that are required to use the Configuration
class instead of an NameWorks configuration file. The following procedure includes code samples for Java™, but the steps for C®++ are the same.
Procedure
-
Using a development application, create a
Configuration object. The following
line of code creates an empty Configuration object. The subsequent steps illustrate
additional information that is part of your Configuration object.
Configuration configuration = new Configuration();
-
Create a
Datalist object to specify the datalist that you want to use for
searching.
The following sample creates a
Configuration object that contains a datalist
called
Customers, and specifies that TAQs should not be included when searching.
You can specify additional parameters, such as adding a list entry to the datalist, depending on the
type of the search.
Configuration configuration = new Configuration();
Datalist customers = configuration.addDatalist("Customers");
customers.setIncludeTaqs(false);
-
Create a
Strategy object by using the
Strategy class. You call this search strategy in
your program to be used in pair-wise comparisons and searching.
The following sample creates a
Broad search
strategy with several variables specified.
Strategy broad = configuration.addStrategy("Broad");
broad.setMinScore(75)
.setMaxReply(1000)
.setSearchOptions(EnumSet.of(NameCategory.PERSONAL));
-
Call various methods to specify configuration data, such as the
maximum number of threads to be used in searching and the name of file
that contains default comparison parameter overrides.
configuration.setMaxThreads(8)
.setDefaultCompParmsOverridesFile("compparms.config");
-
Pass the
Configuration object to the Analytics()
constructor, the Scoring() constructor, or both to create Analytics and Scoring
objects. After these objects are created, the Configuration object can be discarded
and subsequent changes have no effect unless you want to use the same Configuration
object to create more Analytics or Scoring objects.
Analytics analytics = new Analytics(configuration);
Scoring scoring = new Scoring(configuration);