An indexing definition file begins with a top-level item element that specifies the item descriptor to use, and then lists the properties of that item type to include. The properties appear as property elements within text-properties or meta-properties elements. The values of properties included in text-properties elements are searchable text, while the values of properties included in meta-properties elements are used in constraints or facets.

For example, in a Commerce product catalog, you’d typically want a property containing a product description to be searchable, but you’d typically want a price property to be usable as a constraint (e.g., to constrain the results to include only those products whose price is less than $100). If you want a property to be both searchable and usable as a constraint, it must appear within both the text-properties and meta-properties elements. For example, you might use a manufacturer property this way, enabling searching for a specific manufacturer, or constraining the results to exclude items from a certain manufacturer.

The top-level item element in the definition file can contain child item elements for properties that refer to other repository items (or arrays, Collections, or Maps of repository items). Those child item elements in turn can contain property and item elements themselves.

For example, the following definition file enables indexing of site users and their home addresses:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE item PUBLIC "-//Art Technology Group, Inc.//DTD Repository Ouput
  Specifier 1.0//EN" "http://www.atg.com/dtds/search/indexing-dependency-
  schema.dtd">

<item item-descriptor-name="user" is-document="true">
    <title property-name="lastName"/>
    <meta-properties>
      <property name="dateOfBirth" type="date"/>
    </meta-properties>
    <text-properties>
      <property name="firstName"/>
      <property name="lastName"/>
    </text-properties>
    <item property-name="homeAddress">
      <text-properties>
        <property name="address1"/>
        <property name="address2"/>
        <property name="city"/>
        <property name="state"/>
        <property name="postalCode"/>
        <property name="phoneNumber"/>
      </text-properties>
    </item>
</item>

Note that in the above example, the top-level item element has the is-document attribute set to true. This attribute specifies that an XHTML document should be generated for each item of that type (in this case, each user item). If, instead, you want to generate a separate XHTML document per homeAddress item, you set is-document to true for the homeAddress item type and not for the user item type. In that case, the parent properties (firstName and lastName in the above example) are repeated in each XHTML document.

Property values that come from standard JavaBean properties of the RepositoryItem object (rather than dynamic bean properties) are specified using a dollar-sign ($) prefix; e.g., $repositoryId or $repository.repositoryName. These dollar-sign property specifiers are the only constructions in the definition file that support JavaBean dot notation.

 
loading table of contents...