To enable the search module, first configure which content types to index.
Go to the developer settings for the search app and select "Please
index this type" for the types to index. Optionally you can provide a
link template, using the %%ID%%
placeholder for the node
ID.
Now all fields of the enabled types will automatically be indexed as they are added/updated.
If you wish to refine this behavior you have two options:
To omit a field from being indexed, use the searchable-attribute as described in Section 4.2, “Common Field Attributes”.
If you want indexing of a node to depend on the setting of a
specific field (typically an online/offline selector), supply a
search
element with an indexTrigger
attribute, defining the field and value that will trigger indexing
of the node.
For example, the Moski2.net CMS has a status field in the page type that can be either "online" or "offline". To make sure that only online pages are indexed we supply this XML:
<contentType id="page" type="hier"> <title lang="en" number="single">Page</title> <title lang="en" number="plural">Pages</title> <title lang="da" number="single">Side</title> <title lang="da" number="plural">Sider</title> <search indexTrigger="status:online" /> <sorting type="user" /> <fields> ... <field id="status" linkField="0" multiLingual="0" searchable="0" type="select"> <title lang="da">Status</title> <title lang="en">Status</title> <options lang="en"> <option value="online">This page is online and available at my Web site</option> <option value="offline">This page is offline and can not be viewed by visitors at my Web site</option> </options> </field> ...