0
votes

i´m currently trying to index new IRRE ContentElements with Solr in TYPO3.

I have multiple new Elements, like "Tiles" and "Banners" etc.

My index queue is looking like this but its not working (solr needs a minimum of fields -> title, content and url - but i dont want a new url, i want the url from the page where the content is currently displayed... like every text/image element or like the standard elements from tt_content.

My solr config is looking like this:

plugin.tx_solr.index.queue {
    extname_tile = 1
    extname_tile {
        table = tx_extname_domain_model_tile
        fields {
            header = header
            bodytext = bodytext
        }
    }
}

My tt_content override looks like this

'tx_extname_tile' => [
        'label' => 'LLL:EXT:extname/Resources/Private/Language/locallang_db.xlf:tx_extname_tile',
        'config' => [
            'type' => 'inline',
            'foreign_table' => 'tx_extname_domain_model_tile',
            'foreign_field' => 'parentid',
            'foreign_table_field' => 'parenttable',
            'appearance' => [
                'collapseAll' => 1,
                'expandSingle' => 1,
                'useSortable' => 1,
                'showSynchronizationLink' => 1,
                'showAllLocalizationLink' => 1,
                'showPossibleLocalizationRecords' => 1,
                'showRemovedLocalizationRecords' => 1,
            ],
            'maxitems' => 24,
            'behaviour' => [
                'localizeChildrenAtParentLocalization' => true,
            ],
        ]
    ],
1

1 Answers

0
votes

If I understand correctly you want to be able to find content elements based on tiles or banners attached to them. If so, you don't need to index the tiles and banners, but you have to index the tt_content records and add the tiles and banners as fields. With normal records this wouldn't be a problem. With tt_content however it is. The solr extension can't (easily) index tt_content records as they are normally indexed as part of a page. So the page is indexed instead of the separate content elements. Unfortunately this behavior is hardcoded in the solr extension.

Now if you want to find pages that have content elements that have a specific tile or banner, that's doable. Without actually testing it, it's something like:

plugin.tx_solr.index.queue.pages.fields.tiles_stringM = CONTENT
plugin.tx_solr.index.queue.pages.fields.tiles_stringM {
  table = tt_content
  select {
    pidInList.field = uid
    selectFields = tx_extname_tile
  }
  renderObj = CONTENT
  renderObj {
    table = tx_extname_domain_model_tile
    select {
      pidInList.field = pid
      where = parentid = ###contentuid###
      markers {
        contentuid.field = uid
      }
    }
    renderObj = TEXT
    renderObj {
      field = title
      wrap = |,
    }
  }
}

You'll then have to add this field to the search fields or to a filter, depending on what you want to use it for exactly.