Excluding content element columns
With Include content elements enabled, the page
indexer adds the text of every visible content element found on a page to
the page's content attribute. This includes content stored in columns
that the page templates of the site never render, for example a
project-specific storage column for unused elements.
To leave such columns out, list their col values in the TypoScript
option exclude:
module.tx_typo3searchalgolia.indexer.pages.excludeColPos = 9999
The example value is specific to a site. Only list columns that your page
templates do not render. Column 0 is the default main content column of
TYPO3, so listing it on a site that renders it removes the main content
from the index.
-
- Type
- comma-separated list of integers
- Default
- not set
The
colvalues whose content elements are left out of thePos contentattribute of page records. Whitespace around the entries is ignored. An entry that is not a plain whole number is ignored as well, for example letters, decimals, numbers with leading zeros or a plus sign. A typo can therefore never be read ascol0. Because such an entry is dropped silently, check the result after changing the option.Pos
How the option behaves
- Any
colcan be listed, including columns that are not part of a backend layout, such as the child columns of container elements.Pos - Only the listed columns are excluded. A column that is not listed, for example a storage column added later or the child columns of a disabled container element, stays indexed.
- If the option is not set, nothing is excluded and every
colis indexed. Do not assign an empty value in your own TypoScript, leave the option out instead.Pos - The option applies to all indexing services of type Pages that have Include content elements enabled.
- The content element indexer is not
affected. It keeps indexing all content elements regardless of
col. If you also run an indexing service of that type, content in the excluded columns stays searchable through it.Pos
Where to set the option
Set the option in the TypoScript of your site package, so it is versioned and identical on every environment. A value entered in the Setup field of a TypoScript template record in the backend is stored in the database. It is not deployed with the code and has to be maintained on each environment separately. By default only administrators can edit template records.
When the indexing runs on the command line, as the queue worker does, the TypoScript is resolved for the first site root page and not for the site of the page being indexed. On a multi-site installation, set the option in TypoScript that applies to all sites, such as a site package that the root template of every site includes.
Reindexing after a change
Content that was indexed before the option changed stays in the index until the pages are indexed again. Queue the pages again after changing the option, see When records are indexed.