forked from TYPO3-CMS/indexed_search
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathext_localconf.php
More file actions
73 lines (64 loc) · 2.92 KB
/
ext_localconf.php
File metadata and controls
73 lines (64 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
declare(strict_types=1);
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
use TYPO3\CMS\IndexedSearch\Controller\SearchController;
use TYPO3\CMS\IndexedSearch\FileContentParser;
use TYPO3\CMS\IndexedSearch\Hook\DeleteIndexedData;
use TYPO3\CMS\IndexedSearch\Utility\DoubleMetaPhoneUtility;
defined('TYPO3') or die();
// register plugin
ExtensionUtility::configurePlugin(
'IndexedSearch',
'Pi2',
[SearchController::class => 'form,search,noTypoScript'],
[SearchController::class => 'form,search']
);
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearPageCacheEval']['indexed_search'] = DeleteIndexedData::class . '->delete';
// Configure default document parsers:
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] = [
'pdf' => FileContentParser::class,
'doc' => FileContentParser::class,
'docx' => FileContentParser::class,
'dotx' => FileContentParser::class,
'pps' => FileContentParser::class,
'ppsx' => FileContentParser::class,
'ppt' => FileContentParser::class,
'pptx' => FileContentParser::class,
'potx' => FileContentParser::class,
'xls' => FileContentParser::class,
'xlsx' => FileContentParser::class,
'xltx' => FileContentParser::class,
'sxc' => FileContentParser::class,
'sxi' => FileContentParser::class,
'sxw' => FileContentParser::class,
'ods' => FileContentParser::class,
'odp' => FileContentParser::class,
'odt' => FileContentParser::class,
'rtf' => FileContentParser::class,
'txt' => FileContentParser::class,
'html' => FileContentParser::class,
'htm' => FileContentParser::class,
'csv' => FileContentParser::class,
'xml' => FileContentParser::class,
'jpg' => FileContentParser::class,
'jpeg' => FileContentParser::class,
'tif' => FileContentParser::class,
];
$extConf = GeneralUtility::makeInstance(
ExtensionConfiguration::class
)->get('indexed_search');
if (isset($extConf['useMysqlFulltext']) && (bool)$extConf['useMysqlFulltext']) {
// Use all index_* tables except "index_rel" and "index_words"
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['use_tables'] =
'index_phash,index_fulltext,index_section,index_grlist,index_stat_word,index_debug,index_config';
} else {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['use_tables'] =
'index_phash,index_fulltext,index_rel,index_words,index_section,index_grlist,index_stat_word,index_debug,index_config';
}
// Use the advanced doubleMetaphone parser instead of the internal one (usage of metaphone parsers is generally disabled by default)
if (isset($extConf['enableMetaphoneSearch']) && (int)$extConf['enableMetaphoneSearch'] == 2) {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['metaphone'] = DoubleMetaPhoneUtility::class;
}
unset($extConf);