How can I search within comments in a topic?
You can create an index to search within comments in a topic.
Symptom
I want to search within comments that are encapsulated with <!–
-->
.
Problem
This index is not defined in the default configuration and must be added manually.
Solution
This index creates a column titled XML Comments
that will
indicate either no comment
or contains comments
.
In the TEXTML Administration perspective, perform the following:
- Edit the Index Definition file to add
the following
index:
<index NAME="comments" SYNC="False"> <stringindex KEEPEXTRACTEDVALUES="True"> <elements> <element XPATH="if (//*[comment()]) then 'contains comments' else 'no comment'" DEPTH="INFINITE"/ </elements> </stringindex> </index>
- In the summaries section, add the following
field:
<field NAME="comments" TYPE="Index" VALUE="All"/>
- To add the index to the Advanced Search panel in the
Search view, edit the system/conf/advancedSearchIndexes.xml file and add the
following:
<index attr="false" display="XML Comments" listable="true" name="comments" type="index" views="ALL"/>
- To display a column named
XML Comments
in the Search Results view and other views, edit the system/conf/display.xml file and add the following:<key halign="LEFT" label=" XML Comments" name="comments" sortOrder="ASC" sortType="ALPHA" type="Index" visibility="255" width="30"/>
- Right-click on your Content Store. Click Rebuild All Indexes.
- When the indexing is complete, restart your IXIASOFT CCMS Desktop.
- Add the new column to your Search Results view.