Retrieves the name of the Index Queue Configuration for a record.

@param string $recordTable Table to read from
@param int $recordUid Id of the record
@param TypoScriptConfiguration $solrConfiguration
@return string Name of indexing configuration
426973
public function getIndexingConfigurationName($recordTable, $recordUid, TypoScriptConfiguration $solrConfiguration)
    {
        $name = $recordTable;
        $indexingConfigurations = $solrConfiguration->getEnabledIndexQueueConfigurationNames();
        foreach ($indexingConfigurations as $indexingConfigurationName) {
            if (!$solrConfiguration->getIndexQueueConfigurationIsEnabled($indexingConfigurationName)) {
                // ignore disabled indexing configurations
                continue;
            }

            $record = $this->getRecordIfIndexConfigurationIsValid($recordTable, $recordUid,
                $indexingConfigurationName, $solrConfiguration);
            if (!empty($record)) {
                $name = $indexingConfigurationName;
                // FIXME currently returns after the first configuration match
                break;
            }
        }

        return $name;
    }
1215269
protected function getTypoScriptConfigurationInstance(array $configurationArray = null, $contextPageId = null)
    {
        return GeneralUtility::makeInstance(
            TypoScriptConfiguration::class,
            /** @scrutinizer ignore-type */ $configurationArray,
            /** @scrutinizer ignore-type */ $contextPageId
        );
    }
1221020
private function getRecordsFromDatabase($typoScriptUrlEntry)
    {
        if (!isset($GLOBALS['TCA'][$typoScriptUrlEntry['table']])
            || !is_array($GLOBALS['TCA'][$typoScriptUrlEntry['table']]['ctrl'])
        ) {
            return false;
        }

        $language = '';
        if ((int)$typoScriptUrlEntry['hideIfNotTranslated'] === 1) {
            $language = 'AND (sys_language_uid=\'-1\' OR sys_language_uid="' . (int)GeneralUtility::_GET('L') . '") ';
        }

        return $this->getDatabaseConnection()->exec_SELECTquery(
            '*',
            $typoScriptUrlEntry['table'],
            'pid!=0 ' . $language . ' ' . AdditionalWhereService::getWhereString(
                $typoScriptUrlEntry['additionalWhere']
            ) . $this->pageRepository->enableFields(
                $typoScriptUrlEntry['table']
            ),
            '',
            OrderByService::getOrderByString(
                $typoScriptUrlEntry['orderBy'],
                $typoScriptUrlEntry['table']
            ),
            LimitService::getLimitString(
                $typoScriptUrlEntry['limit']
            )
        );
    }
287951
public function getRecord($recordId, $contentTypeName = null, DataDimensions $dataDimensions = null)
    {
        if ($contentTypeName == null)
        {
            $contentTypeName = $this->getCurrentContentTypeName();
        }

        if ($dataDimensions == null)
        {
            $dataDimensions = $this->getCurrentDataDimensions();
        }

        $folder = $this->getConfiguration()->getFolderNameRecords($contentTypeName, $dataDimensions);

        $fileName = $folder . '/' . $recordId . '.json';

        if ($this->fileExists($fileName))
        {
            $data = $this->readRecord($fileName);

            if ($data)
            {
                $data = json_decode($data, true);

                $definition = $this->getContentTypeDefinition($contentTypeName);

                $record = $this->getRecordFactory()
                               ->createRecordFromJSON($definition, $data, $dataDimensions->getViewName(), $dataDimensions->getWorkspace(), $dataDimensions->getLanguage());

                return $this->exportRecord($record, $dataDimensions);
            }
        }

        KVMLogger::instance('anycontent-connection')
                 ->info('Record ' . $recordId . ' not found for content type ' . $this->getCurrentContentTypeName());

        return false;

    }
866660
public function findForPaginate(PaginateFinderConfiguration $configuration, array $siteIds)
    {
        $order = $configuration->getOrder();
        $qa = $this->createQueryWithFilter($configuration, $siteIds, $order);

        $qa->skip($configuration->getSkip());
        $qa->limit($configuration->getLimit());

        return $this->hydrateAggregateQuery($qa);
    }
301407
protected function getIndexQueueConfigurationTableMap()
    {
        $indexingTableMap = [];

        $solrConfiguration = $this->site->getSolrConfiguration();
        $configurationNames = $solrConfiguration->getEnabledIndexQueueConfigurationNames();
        foreach ($configurationNames as $configurationName) {
            $indexingTableMap[$configurationName] = $solrConfiguration->getIndexQueueTableNameOrFallbackToConfigurationName($configurationName);
        }

        return $indexingTableMap;
    }
307709
public function getIndexQueueIndexerConfigurationByConfigurationName($configurationName, $defaultIfEmpty = [])
    {
        $path = 'plugin.tx_solr.index.queue.' . $configurationName . '.indexer.';
        $result = $this->getObjectByPathOrDefault($path, $defaultIfEmpty);
        return $result;
    }
578249
private String getOrcStagingDataLocation(String orcStagingTableName) {
    String orcDataLocation = getConversionConfig().getDestinationDataPath();

    return orcDataLocation + Path.SEPARATOR + orcStagingTableName;
  }
1025557
protected function applyIndexPagePostProcessors($pageDocument)
    {
        if (!is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['Indexer']['indexPagePostProcessPageDocument'])) {
            return;
        }

        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['Indexer']['indexPagePostProcessPageDocument'] as $classReference) {
            $postProcessor = GeneralUtility::makeInstance($classReference);
            if (!$postProcessor instanceof PageDocumentPostProcessor) {
                throw new \UnexpectedValueException(get_class($pageDocument) . ' must implement interface ' . PageDocumentPostProcessor::class, 1397739154);
            }

            $postProcessor->postProcessPageDocument($pageDocument, $this->page);
        }
    }
917692
protected function removeFromIndexAndQueue($recordTable, $recordUid)
    {
        $garbageCollector = GeneralUtility::makeInstance(GarbageCollector::class);
        $garbageCollector->collectGarbage($recordTable, $recordUid);
    }
116809
def index_workflow_fields(solr_document)
      return unless object.persisted?
      entity = PowerConverter.convert_to_sipity_entity(object)
      return if entity.nil?
      solr_document[workflow_role_field] = workflow_roles(entity).map { |role| "#{entity.workflow.permission_template.source_id}-#{entity.workflow.name}-#{role}" }
      solr_document[workflow_state_name_field] = entity.workflow_state.name if entity.workflow_state
    end
817677
public function describeIndexes($conn, $table, $schema = null)
    {
        $dialect = $conn->getDialectType();
        $method = 'describeIndexes' . $dialect;
        if (!method_exists($this, $method)) {
            throw new Exception("Describe index for $dialect is not implemented yet");
        }
        return $this->$method($conn, $table, $schema);
    }
825946
public Integer extractNumFound(String jsonString, String recordId) {
    int numFound = 1;
    if (StringUtils.isBlank(jsonString)) {
      return numFound;
    }

    Object document = JSON_PROVIDER.parse(jsonString);
    if (document instanceof LinkedHashMap) {
      Map documentMap = (LinkedHashMap) document;
      if (documentMap.containsKey("response")) {
        Map response = (LinkedHashMap) documentMap.get("response");
        numFound = (int) response.get("numFound");
      } else {
        LOGGER.severe("No 'response' part in Solr response: " + jsonString);
      }
    } else {
      LOGGER.severe("Problem with parsing Solr response: >>" + document
          + "<< class:" + document.getClass());
    }

    return numFound;
  }
362135
public function initializeIndexQueueAction()
    {
        $initializedIndexingConfigurations = [];

        $indexingConfigurationsToInitialize = GeneralUtility::_POST('tx_solr-index-queue-initialization');
        if ((!empty($indexingConfigurationsToInitialize)) && (is_array($indexingConfigurationsToInitialize))) {
            // initialize selected indexing configuration
            $initializedIndexingConfigurations = $this->indexQueue->getInitializationService()->initializeBySiteAndIndexConfigurations($this->selectedSite, $indexingConfigurationsToInitialize);
        } else {
            $messageLabel = 'solr.backend.index_queue_module.flashmessage.initialize.no_selection';
            $titleLabel = 'solr.backend.index_queue_module.flashmessage.not_initialized.title';
            $this->addFlashMessage(
                LocalizationUtility::translate($messageLabel, 'Solr'),
                LocalizationUtility::translate($titleLabel, 'Solr'),
                FlashMessage::WARNING
            );
        }
        $messagesForConfigurations = [];
        foreach (array_keys($initializedIndexingConfigurations) as $indexingConfigurationName) {
            $itemCount = $this->indexQueue->getStatisticsBySite($this->selectedSite, $indexingConfigurationName)->getTotalCount();
            $messagesForConfigurations[] = $indexingConfigurationName . ' (' . $itemCount . ' records)';
        }

        if (!empty($initializedIndexingConfigurations)) {
            $messageLabel = 'solr.backend.index_queue_module.flashmessage.initialize.success';
            $titleLabel = 'solr.backend.index_queue_module.flashmessage.initialize.title';
            $this->addFlashMessage(
                LocalizationUtility::translate($messageLabel, 'Solr', [implode(', ', $messagesForConfigurations)]),
                LocalizationUtility::translate($titleLabel, 'Solr'),
                FlashMessage::OK
            );
        }

        $this->redirect('index');
    }
609966
public function generateTable(BeanInterface $bean, $findCondition = "", $returnString = false)
    {
        //Load the config
        $this->loadConfig();
        if((is_array($findCondition) && !isset($findCondition['limit'])) || empty($findCondition))
        {
            $recordLimitOnOnePage = $this->getConfigForElement($this->_table_config, 'recordLimitOnOnePage', $bean->getName(), 'beans');
            if (empty($recordLimitOnOnePage)) {
                $recordLimitOnOnePage = 10;
            }

            $findCondition['limit'] = $recordLimitOnOnePage;
        }

        $result = $bean->find($findCondition, true);

        if ($returnString) {
            return $this->generateTableHtml($bean, $result);
        }

        echo $this->generateTableHtml($bean, $result);
    }
561786
public function preview_onLoadConvertGuestForm($recordId)
    {
        $this->vars['groups'] = UserGroup::where('code', '!=', UserGroup::GROUP_GUEST)->get();

        return $this->makePartial('convert_guest_form');
    }
378062
protected function getConfigurationPageId($recordTable, $recordPageId, $recordUid)
    {
        $rootPageId = $this->rootPageResolver->getRootPageId($recordPageId);
        if ($this->rootPageResolver->getIsRootPageId($rootPageId)) {
            return $recordPageId;
        }

        $alternativeSiteRoots = $this->rootPageResolver->getAlternativeSiteRootPagesIds($recordTable, $recordUid, $recordPageId);
        $lastRootPage = array_pop($alternativeSiteRoots);
        return empty($lastRootPage) ? 0 : $lastRootPage;
    }