Configuring database search criteria in XML
You use the search-config.xml file to define a mapping between the key data entities and certain non-persistent entities used for search criteria. The entries in the file have the following basic structure:
<CriteriaDef entity="name" targetEntity="name">
<Criterion property="attributename" targetProperty="attributename" matchType="type"/>
</CriteriaDef>
You can map a single search criteria entity to more than one target entity.
Do not add new <CriteriaDef> elements into
search-config.xml. Only modify the contents of existing
criteria definitions. Do not remove a required base CriteriaDef
element. Adding or removing these elements can introduce problems into your PolicyCenter installation.
<CriteriaDef> elements that exist in the base
configuration.Search criteria XML elements
The following table describes the XML elements in the search-config.xml file.
Element name |
Subelement |
Description |
More information |
|---|---|---|---|
|
|
Root element in search-config.xml. |
|
|
|
Specifies the mapping from a search criteria entity to the target entity on which to search. WARNING
Do not add or remove |
|
|
Specifies how PolicyCenter matches a column (field) on the search criteria to the query against the target entity. Use this element to perform simple matching only. Simple matches are criteria that match values in a single column of the same type in the target entity. |
The <CriteriaDef> element
A <CriteriaDef>
element specifies the mapping from a search criteria entity to the target entity on which to
search. For example, a <CriteriaDef>
element can specify a mapping between a DocumentSearchCriteria entity and a Document entity. A <CriteriaDef> element uses
the following syntax.
<CriteriaDef entity="entityName" targetEntity="targetEntityName">These attributes have the following definitions.
|
Required |
Description |
|---|---|---|
|
• | Type name of the criteria entity |
|
• | Type name of the target entity. |
A <CriteriaDef> element can have the following subelement.
|
Description |
More information |
|---|---|---|
|
Performs simple, one-to-one mapping between a criteria entity attribute and a target entity attribute. |
The <Criterion> subelement
Within a <CriteriaDef> element you can define zero or more <Criterion> subelements. A <Criterion> element performs simple, one-to-one mapping between a criteria entity attribute and a target entity attribute. A <Criterion> element uses the following syntax.
<Criterion property="attributename"
targetProperty="attributename"
forceEqMatchType="booleanproperty"
matchType="type"/>
These attributes have the following definitions.
|
Required |
Description |
|---|---|---|
|
• | The |
|
• | This attribute is dependent on the data type of the |
|
The name of a Boolean property on the criteria entity:
For example:
This code uses a |
|
|
The IMPORTANT Do not use a virtual property on the entity as the search field. |
The following list describes the valid matchType values. For String objects, matchType case-sensitivity depends
on the database, except for startsWith and contains, which are always case-insensitive.
Match type |
Evaluates to |
Use with data type |
Notes |
|---|---|---|---|
|
|
IMPORTANT Guidewire strongly recommends that you avoid
using the |
|
|
equals |
Numeric or |
|
|
greater than or equal |
Numeric or |
|
|
greater than |
Numeric or |
|
|
less than or equal |
Numeric or |
|
|
less than |
Numeric or |
|
|
|
The |
Performance tuning for specific search criteria
For some searches, adding an index can improve performance. The exact index to add depends on the database that you use and the details of the situation. Whenever you change the search criteria by adding or modifying a <Criterion> subelement, ensure that appropriate indexes are in place. Guidewire recommends that you consult a database expert.
For example, suppose that you add a column that is the most restrictive equality condition in your search implementation. In this case, consider adding an index with this column as the leading key column.
contains match type. The contains match type is the most expensive type in terms of performance. Do not attempt to modify the required search properties
Guidewire divides the main search screens into required and optional sections. Guidewire has carefully chosen the properties in the required section to enhance performance. Therefore, do not change which properties are required properties. Adding your own required search criteria can cause performance issues severe enough to bring down a production database.
In addition, Guidewire has carefully chosen the match types of the existing required properties, due to restrictions on configuring fields on tables that are joined to the search table. Therefore, do not change the match types of existing required fields.
