Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v10 here: TYPO3 ELTS.
search
search
-
- Path
-
$GLOBALS['TCA'][$table]['columns'][$field]['config']
- type
-
array
- Scope
-
Search
- Types
Defines additional search-related options for a given field.
pidonly
-
- type
-
boolean
Searches in the column only if search happens on the single page, does not search the field if searching in the whole table.
case
-
- type
-
boolean
Makes the search case-sensitive. This requires a proper database collation for the field, see your database documentation.
andWhere
-
- type
-
string
Additional SQL WHERE statement without 'AND'. With this it is possible to place an additional condition on the field when it is searched
Example from "tt_content" bodytext:
'bodytext' => [ 'config' => [ 'search' => [ 'andWhere' => '{#CType}=\'text\' OR {#CType}=\'textpic\'', ], ... ], ... ],
Copied!This means that the "bodytext" field of the "tt_content" table will be searched in only for elements of type Text and Text & Images. This helps making any search more relevant.
The above example uses the special field quoting syntax
{#...}
around identifiers of the QueryHelper to be as DBAL compatible as possible.