【问题标题】:TYPO3 - Index own IRRE Contentelements in SolrTYPO3 - 在 Solr 中索引自己的 IRRE 内容元素
【发布时间】:2018-11-30 09:46:24
【问题描述】:

我目前正在尝试使用 TYPO3 中的 Solr 索引新的 IRRE Con​​tentElements。

我有多个新元素,例如“瓷砖”和“横幅”等。

我的索引队列看起来像这样,但它不起作用(solr 需要最少的字段 -> 标题、内容和 url - 但我不想要新的 url,我想要当前显示内容的页面中的 url ...就像每个文本/图像元素或来自 tt_content 的标准元素。

我的 solr 配置如下所示:

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

我的 tt_content 覆盖看起来像这样

'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,
            ],
        ]
    ],

【问题讨论】:

    标签: solr typo3 typoscript extbase


    【解决方案1】:

    如果我理解正确,您希望能够根据附加的图块或横幅找到内容元素。如果是这样,您不需要索引图块和横幅,但您必须索引 tt_content 记录并将图块和横幅添加为字段。使用正常的记录,这不会是一个问题。但是 tt_content 就是这样。 solr 扩展不能(轻松)索引 tt_content 记录,因为它们通常作为页面的一部分进行索引。所以页面被索引而不是单独的内容元素。不幸的是,这种行为在 solr 扩展中是硬编码的。

    现在,如果您想查找具有特定磁贴或横幅的内容元素的页面,这是可行的。在没有实际测试的情况下,它类似于:

    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 = |,
        }
      }
    }
    

    然后,您必须将此字段添加到搜索字段或过滤器中,具体取决于您要使用它的确切用途。

    【讨论】:

      猜你喜欢
      • 2019-02-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-15
      • 1970-01-01
      • 2021-06-18
      • 1970-01-01
      • 2019-11-16
      • 1970-01-01
      相关资源
      最近更新 更多