Example: Index descendants of topic element with outputclass

This example shows how to configure the indexes for reusable content. With these changes, IXIASOFT CCMS indexes descendant elements of the <topic> element that have outputclass=“referable” in addition to referable-content topics.

This change is useful if you want to use one of the standard topic types (topic, concept, task, reference, troubleshooting) as sources for conrefs, but you want only certain topic types and elements to be available.

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"/>
         <element DEPTH="INFINITE" XPATH="//topic[@outputclass='referable']//*[@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)"/>
         <element DEPTH="INFINITE" XPATH="for $e in (//topic[@outputclass='referable']//*[@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//*"/>
         <element DEPTH="INFINITE" XPATH="//topic[@outputclass='referable']//*"/>

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

Example of elements indexed

The root <topic> element of the topic has outputclass=“referable”, and the first two <p> elements have an id.

Both <p> elements are indexed.