By default, two basic queries are predefined in the Candidate Select file, one phonetic and one exact alphanumeric. If the default queries do not meet your query requirements, you can define new queries for the master index application. You can either use an existing query builder class or create a custom query builder by creating a custom plug-in (for more information, see Custom Plug-Ins for Master Index Custom Components (Repository) in Developing Sun Master Indexes (Repository)).
The changes you make on the Query page of the Configuration Editor are reflected in the Candidate Select file. For more information about this file and the configurable query options, see Candidate Select Configuration (Repository) in Understanding Sun Master Index Configuration Options (Repository). If you create a new query to use from the EDM, make sure to add that query to one of the search definitions in the Enterprise Data Manager file. Unless specifically defined for range searching in the Enterprise Data Manager file, basic queries use exact searching. No configuration is required in the Candidate Select file for basic exact or range searching.
You can create basic queries either through the Configuration Editor or by modifying the XML file directly. Both methods are described here.
In the Projects window, right-click the master index application you want to modify, and then click Open.
If the Configuration Editor dialog box appears, click Edit to check out the listed files.
The Configuration Editor appears.
Click the Query tab.
The Query page appears.
In the Basic Queries section, click Add.
The Basic Query Builder dialog box appears.
Enter values and select options for the fields described in Master Index Query Builder Dialog Box Fields and XML Elements (Repository).
On the Configuration Editor toolbar, click Save.
In the Projects window, expand the Configuration node in the project you want to modify, and then double-click the Candidate Select file.
The file opens in the NetBeans XML editor.
Create a new query-builder element in the QueryBuilderConfig element.
Make sure the new element is created outside of any existing query-builder elements.
For the new query-builder element, define the attributes listed in Master Index Query Builder Dialog Box Fields and XML Elements (Repository).
For example:
<query-builder name="PHONETIC-SEARCH" class= "com.stc.eindex.user.CustomQueryBuilder" parser-class= "com.stc.eindex.configurator.impl.querybuilder.KeyValueConfiguration" standardize="false" phoneticize="true"> </query-builder> |
To configure the query to use wildcard characters, do the following:
Add a new config element after the opening query-builder element.
For example:
<query-builder name="ALPHA-SEARCH" class= "com.stc.eindex.querybuilder.BasicQueryBuilder" parser-class= "com.stc.eindex.configurator.impl.querybuilder.KeyValueConfiguration" standardize="true" phoneticize="true"> <config> </config> </query-builder> |
In the new config element, create an option element and then define key and value attributes for the new element.
For example:
<config> <option key="UseWildcard" value="true"/> </config> |
For the default basic query, only the UseWildcard parameter is supported. If you create a custom basic query builder, you can use these elements to define additional parameters. For more information, see Master Index Query Builder Dialog Box Fields and XML Elements (Repository).
Save and close the file.
The following table lists and describes the fields on the Basic Query Builder and Blocking Query Builder dialog boxes on the Configuration Editor, along with the corresponding elements and attributes in the Candidate Select file.