[TYPO3-Solr] tt_news with language [all]

raka raka86 at gmx.de
Thu Jul 12 10:19:32 CEST 2012


hi,

i have a lot of news configured with language [all]. (L=-1)

they will be indexed in every core (multlianguage system) but i can't 
find them over frontend search.

what i want is that they will be indexed only in the default core 
(default language) and only be found when searching within this core.

is there any proper way to handle this?

at the moment i'm using my own indexer where i only overwrite the 
function itemToDocument:

code snippet:
// setting the document's language
         if 
(isset($GLOBALS['TCA'][$item->getType()]['ctrl']['languageField'])) {
             // if L=-1
             if 
($itemRecord[$GLOBALS['TCA'][$item->getType()]['ctrl']['languageField']] 
== -1) {
                 $document->setField(
                     'language',
                     0
                 );
             }
             else {
                 $document->setField(
                     'language',
$itemRecord[$GLOBALS['TCA'][$item->getType()]['ctrl']['languageField']]
                 );
             }
         } else {
             $document->setField('language', $language);
         }


of course the news now still get indexed into every core, but at least i 
find them now when searching the default language.

so is there a way to only index them into one core and is the solution 
with the own indexer the right way to solve this?

thanks, raka


More information about the TYPO3-project-solr mailing list