Project

General

Profile

Actions

Feature #11427

closed

Field Override for indexing

Added by Anonymous over 13 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Indexed Search
Target version:
Start date:
2010-12-13
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

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.

Actions #1

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!

Actions #2

Updated by Oliver Hader about 11 years ago

  • Target version set to 2222
Actions #3

Updated by Oliver Hader about 11 years ago

  • Project changed from 1382 to TYPO3 Core
Actions #4

Updated by Oliver Hader about 11 years ago

  • Category set to Indexed Search
Actions #5

Updated by Oliver Hader about 11 years ago

  • Target version deleted (2222)
Actions #6

Updated by Mathias Schreiber over 9 years ago

  • Target version set to 7.5
Actions #7

Updated by Benni Mack over 8 years ago

  • Target version changed from 7.5 to 7 LTS
Actions #8

Updated by Susanne Moog about 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.

Actions

Also available in: Atom PDF