Example: Index ancestors of glossentry topics

This example shows how to configure the indexes for reusable content. With these changes, IXIASOFT CCMS indexes referable-content topics plus all ancestors of glossentry topics.

Configuration changes

The lines of code that you need to add for this change are highlighted:

<index NAME="reusable_element_id">
   <stringindex KEEPEXTRACTEDVALUES="True">
      <elements>
         <element DEPTH="INFINITE" XPATH="//rcbody/*[@id]/@id"/>
         <element DEPTH="INFINITE" XPATH="//glossentry//*[@id]/@id"/>

	</elements>
   </stringindex>
</index>
<index NAME="reusable_element_name">
   <stringindex KEEPEXTRACTEDVALUES="True">
      <elements>
         <element DEPTH="INFINITE" XPATH="for $e in (//rcbody/*[@id]) return local-name($e)"/>
         <element DEPTH="INFINITE" XPATH="for $e in (//glossentry//*[@id]) return local-name($e)"/>

      </elements>
   </stringindex>
</index>
<index NAME="reusable_fulltext">
   <!-- System index required by the DITA CMS -->
   <admindescription>Fulltext index on the documents</admindescription>
   <wordindex>
      <elements>
         <element DEPTH="INFINITE" XPATH="//rcbody/*"/>
         <element DEPTH="INFINITE" XPATH="//glossentry//*"/>

      </elements>
   </wordindex>
</index>
<unit NAME="reusable_units">
   <unitelements>
      <unitelement XPATH="//rcbody/*[@id]"/>
      <unitelement XPATH="//glossentry//*[@id]"/>

   </unitelements>
</unit>

Example of elements indexed

<glossterm> and the <p> inside <glossdef> have an id attribute.

Both the <glossterm> and <p> element are indexed and appear as reusable content.

However, <glossdef> does not appear as reusable content because it does not have an id attribute. If <glossdef> had an id attribute, it would be indexed as well.