Configuring Sun Master Indexes (Repository)

ProcedureTo Create a Blocking Query (XML Editor)

  1. 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.

  2. Create a new query-builder element in the QueryBuilderConfig element.

    Make sure the new element is created outside of any existing query-builder elements.

  3. 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>
  4. Create a new config element between the query-builder tags.

  5. To create a query block, do the following:

    1. In the new config element, create a new block-definition element with a number attribute and assign a unique ID code to the number attribute.

      For example:


      <query-builder name="BLOCKING-SEARCH" class=
        "com.stc.eindex.querybuilder.BlockingQueryBuilder" 
        parser-class=
        "com.stc.eindex.configurator.impl.querybuilder.
      KeyValueConfiguration"
      standardize="true" phoneticize="true">
         <config>
            <block-definition number="ID1">
            </block-definition>
         </config>
      </query-builder>
    2. To add a database hint, create and define a new hint element in the new block-definition element.

      The following example illustrates an Oracle hint.


      <config>
         <block-definition number="ID1">
         <hint>FIRST_ROWS_100</hint>
         </block-definition>
      <config>

      Tip –

      Hints are especially useful when a blocking query uses only child object fields; the hint can specify to scan the child object table first. For SQL Server, only OPTION hints are supported.


    3. In the new block-definition element, create a block-rule element.

    4. For each field in the data block, create the elements and attributes listed in Master Index Query Block Fields and XML Elements (Repository).

      The following example illustrates the use of both range and equals elements, as well as upper and lower bounds.


      <config>
         <block-definition number="ID1">
            <hint>FIRST_ROWS_100</hint>
            <block-rule>
               <equals>
                  <field>Enterprise.SystemSBR.Person.FirstNamePh</field>
                  <source>Person.FirstNamePh</source>
               </equals>
               <equals>
                  <field>Enterprise.SystemSBR.Person.LastNamePh</field>
                  <source>Person.LastNamePh</source>
               </equals>
               <range>
                  <field>Enterprise.SystemSBR.Person.DateOfBirth</field>
                  <source>Person.DateOfBirth</source>
                  <default>
                     <lower-bound type=”offset”>-5</lower-bound>
                     <upper-bound type=”constant”>2009-01-01
                     </upper-bound>
                  </default>
               </range>
            </block-rule>
         </block-definition>
      <config>
  6. Repeat the previous step for each data block you need to define for the query.

    All data blocks for one query must be defined within one config element.

  7. Save and close the file.