The properties for the predefined queries are defined in query.xml. Some of the information entered into the default configuration file is based on the fields you specified for blocking in the wizard, and some is standard across all implementations. For most implementations, this file will require some customization.
The following topics provide information about working with query.xml:
You can modify query.xml at any time, but you must regenerate the application and redeploy the project after making any changes to the file. The properties of the blocking query used by the match process should not be modified after moving into production because it can cause unexpected matching weight results. The possible modifications to this file are restricted by the schema definition, so be sure to validate the file after making any changes. Most of the components in this file can be configured using the Configuration Editor, which simplifies the process of defining queries by providing a graphical interface to perform the required tasks.
This topic describes the structure of the XML file, including general requirements and constraints, and provides a sample implementation.
Table 2 lists each element in query.xml and provides a description of each element along with any requirements or constraints for each element.
Table 2 query.xml File Structure
Element/Attribute |
Description |
||||
---|---|---|---|---|---|
The configuration class for the query builders. This should not be modified. |
|||||
A list of query definitions. This element defines each query and the attributes of each query. |
|||||
A unique ID for the element. This element is used to identify the Query Builder and is referenced from midm.xml when specifying the query to use on a search page. It is also referenced from mefa.xml when specifying the query to use for matching. No spaces are allowed in this attribute. |
|||||
The fully qualified name of the query class. Two default Query Builder classes are provided.
|
|||||
The fully qualified name of the class that parses the config elements for each query. This should not be modified for the default queries. |
|||||
An indicator of whether the query criteria is standardized before being passed to the query. Specify true if any fields are standardized for the query; specify false if no fields are standardized for the query. |
|||||
An indicator of whether the query criteria is phonetically encoded before being passed to the query. Specify true if any fields are phonetically encoded for the query specify; false if no fields are phonetically encoded for the query. |
|||||
The configuration information for a query. Each query-builder element contains one config element. |
|||||
One query parameter, specified by key and value attributes, as described below. This is only used by basic queries; blocking queries do not use this element. |
|||||
A parameter for the query option. For the default basic query, only the UseWildCard key is available. |
|||||
The value of the key specified by the corresponding key attribute. For the default option, UseWildCard, specify true to allow wildcard characters for that query type; otherwise specify false. When wildcard characters are enabled, you can enter a percent sign (%) to indicate multiple unknown characters. |
|||||
A list of database hints and defined query criteria blocks, which are identified by unique ID numbers. |
|||||
An attribute of the block-definition element that specifies the unique ID number of each query block. Each block defined for the blocking query must be identified by a unique ID. |
|||||
A hint to add to the query to help optimize query execution. Hints are especially useful when a blocking query uses only child object fields; the hint can specify to scan the child object table first. This element is optional. For SQL Server, only OPTION hints are supported. |
|||||
A list of fields to be included in each query block, including indicators of whether a range is to be used and, if so, what type of range search to perform. |
|||||
An indicator of the type of search to perform on the field defined in the following elements. Each type of search element defines one field in a block-rule element; that is, one field in a query block. This element includes a field element, a source or constant element, and, for range searches only, a default element that defines lower and upper bounds. Specify one of the following types.
Tip – If a field is to be used for simple range searching (where the user or incoming message supplies lower and upper limits of the range are supplied) be sure to define that field for range searching in midm.xml for the searches that use this query. For more complex range searches that use offset values or constants instead of user-supplied limits, do not define the field for range searching in midm.xml. |
|||||
The fully qualified field name of the field to be included in the query block (for example, Enterprise.Person.Address.AddressLine1). |
|||||
The qualified field name of the source field in the object from which the criteria is obtained (for example, Person.Address.AddressLine1). An asterisk (*) can be used as a wildcard character. If the criteria should be a constant value instead of being supplied by a user or incoming message, define a constant element instead of a source element. Tip – When a field in a child object is defined for a blocking query, use the asterisk wildcard character in the ePath to the source field to ensure all instances of the child object in an incoming message are used as search criteria. Each instance is joined by an OR operator. For example, this configuration:
would result in a WHERE clause similar to this:
|
|||||
A constant value that provides the criteria for a search. Define this element instead of a source element if the criteria is a constant rather than being user defined. You can use a constant value with the following types of queries: equals, not-equals, greater-than-or-equals, and less-than-or-equals. |
|||||
A list of upper and lower limits defining a range search. If no limits are defined, the search is a simple range search in which the upper and lower values are supplied by the user or the incoming message (for example, in “Date of Birth From” and “Date of Birth To” fields). |
|||||
The lower limit of a constant or offset range search. Use a negative number for the lower limit of an offset search. This number is added to the value supplied for the search to determine the lower limit of the range. The value can be numeric, date, or string. See Range Search Processing for more information. |
|||||
The type of range search. Define the type attribute as offset to use an offset value or as constant to define a lower constant. |
|||||
The upper limit of a constant or offset range search. The value can be numeric, date, or string. See Range Search Processing or more information. |
|||||
The type of range search. Define the type attribute as offset to use an offset value or as constant to define an upper constant. |
Below is a sample illustrating the elements in query.xml.
<QueryBuilderConfig module-name="QueryBuilder" parser-class= "com.sun.mdm.index.configurator.impl.querybuilder.QueryBuilderConfiguration"> <query-builder name="ALPHA-SEARCH" class="com.sun.mdm.index.querybuilder.BasicQueryBuilder" parser-class="com.sun.mdm.index.configurator.impl.querybuilder. KeyValueConfiguration" standardize="true" phoneticize="false"> <config> <option key="UseWildcard" value="true"/> </config> </query-builder> <query-builder name="PHONETIC-SEARCH" class="com.sun.mdm.index.querybuilder.BasicQueryBuilder" parser-class="com.sun.mdm.index.configurator.impl.querybuilder. KeyValueConfiguration" standardize="true" phoneticize="true"> <config> <option key="UseWildcard" value="false"/> </config> </query-builder> <query-builder name="BLOCKER-SEARCH" class="com.sun.mdm.index.querybuilder.BlockerQueryBuilder" parser- class="com.sun.mdm.index.configurator.impl.blocker.BlockerConfig" standardize="true" phoneticize="true"> <config> <block-definition number="ID000000"> <block-rule> <equals> <field>Enterprise.SystemSBR.Person.FnamePhonetic </field> <source>Person.FnamePhoneticCode</source> </equals> <equals> <field>Enterprise.SystemSBR.Person.LnamePhonetic </field> <source>Person.LnamePhoneticCode</source> </equals> </block-rule> </block-definition> <block-definition number="ID000001"> <block-rule> <equals> <field>Enterprise.SystemSBR.Person.SSN</field> <source>Person.SSN</source> </equals> </block-rule> </block-definition> <block-definition number="ID000002"> <hint>ALL_ROWS</hint> <block-rule> <equals> <field>Enterprise.SystemSBR.Person.FnamePhonetic </field> <source>Person.FnamePhoneticCode</source> </equals> <range> <field>Enterprise.SystemSBR.Person.DOB</field> <source>Person.DOB</source> <default> <lower-bound type="offset">-5</lower-bound> <upper-bound type="offset">5</upper-bound> </default> </range> <equals> <field>Enterprise.SystemSBR.Person.Gender</field> <source>Person.Gender</source> </equals> </block-rule> </block-definition> </config> </query-builder> </QueryBuilderConfig> |