Feature #11427
closedField Override for indexing
0%
Description
It would be nice to have the possibility to override certain fields like item_crdate so you can filter entries by year.
A possible application of this might be tt_news.
This is what has to be added to the method submitPage in tx_indexedsearch_indexer
foreach($conf['overrideConfig.'] as $config) { foreach($config as $key => $el) { if($key == 'mapping.') { foreach($el['override.'] as $k => $v) { // Assume that ids that are passed are not deleted $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( $v, $el['table'], ' '.$el['tableKey'].'='.$_GET[$el['extKey']][$el['var']] ); $val = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); $this->conf[$k] = $val[$v]; } } } }
And this is what has to be added to the method submitFilePage in tx_indexedsearch_indexed:
foreach($conf['overrideConfig.'] as $config) { if($config['overrideFiles']) { foreach($config as $key => $el) { if($key == 'mapping.') { foreach($el['override.'] as $k => $v) { // Assume that ids that are passed are not deleted $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( $v, $el['table'], ' '.$el['tableKey'].'='.$_GET[$el['extKey']][$el['var']] ); $val = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); $this->conf[$k] = $val[$v]; } } } } }
This is what the config would look like
overrideConfig { mapping { tt_news { table = tt_news tableKey = uid extKey = tx_ttnews // Field to override override.item_crdate = tt_news.datetime // pi var var = tt_news } } overrideFiles = 1 }
Thanks for youre feedback.
Updated by Jonas Felix over 13 years ago
This is a very nice solution I tested it.
I used it to insert event dates into the search index, this way users can sort by the event starting date within indexed search!
Nice one Tizian! Thank you ver much!
Please check and integrate that into indexed_search!
Updated by Oliver Hader over 11 years ago
- Project changed from 1382 to TYPO3 Core
Updated by Benni Mack almost 9 years ago
- Target version changed from 7.5 to 7 LTS
Updated by Susanne Moog over 4 years ago
- Status changed from New to Closed
Due to low demand / low priority I'm going to close this issue now. If anyone takes time to implement it, simply open a new issue please. Thanks.