Index PDF and Office file contents via Apache Tika

Solr 10 dropped the ExtractingRequestHandler, so a dedicated Tika
container on the Solr VPS (Caddy route /tika/*, own basic-auth
credential; Tika itself has no auth) extracts file text during
indexing: TikaDownloadContentIndexer listens on
BeforeDocumentIsProcessedForIndexingEvent, resolves the file through
the existing DownloadFileResolver and appends the text (mime
whitelist, 30 MB cap, 100k chars, fail-soft) to the document's content
field. Extractions are cached in var/tika-cache keyed on
path+size+mtime - a full re-index of 177 downloads drops from 2:12 min
to 27 s, replacing a file re-extracts naturally. Datasheet
specifications ("625i", "genlock") are now searchable. Spec v1.15.
This commit is contained in:
orasche committed 2026-09-11 13:15:05 +02:00
1 parent 5bb4e374b4
commit 8c881d153c
9 files changed
+499 -6

No files matched your search

@@ -73,6 +73,7 @@ class SearchJsonRenderer
'pages' => 'page',
'tx_vitec_domain_model_product' => 'product',
'tx_vitec_domain_model_market' => 'market',
'tx_vitec_domain_model_solution' => 'solution',
'tx_vitec_domain_model_usecase' => 'story',
'tx_news_domain_model_news' => 'news',
'tx_vitec_domain_model_download' => 'download',
@@ -152,6 +153,15 @@ class SearchJsonRenderer
$activeType = '';
}
// Secondary facet filters: value comes verbatim from facets.<name>[].value
$facetFilters = [];
foreach (['market', 'category'] as $facetParam) {
$facetValue = trim((string)($params[$facetParam] ?? ''));
if ($facetValue !== '') {
$facetFilters[$facetParam] = $facetValue;
}
}
if ($query === '') {
return (string)json_encode($this->emptyResult());
}
@@ -177,8 +187,15 @@ class SearchJsonRenderer
$search,
);
$arguments = ['q' => $query, 'page' => $page];
$filterArguments = [];
if ($activeType !== '') {
$arguments['filter'] = ['type:' . $typeFilterField];
$filterArguments[] = 'type:' . $typeFilterField;
}
foreach ($facetFilters as $facetName => $facetValue) {
$filterArguments[] = $facetName . ':' . $facetValue;
}
if ($filterArguments !== []) {
$arguments['filter'] = $filterArguments;
}
$searchRequest = GeneralUtility::makeInstance(SearchRequestBuilder::class, $typoScriptConfiguration)
->buildForSearch($arguments, $pageId, $languageId);
@@ -255,6 +272,7 @@ class SearchJsonRenderer
'numFound' => $numFound,
'totalPages' => $resultsPerPage > 0 ? (int)ceil($numFound / $resultsPerPage) : 0,
'filter' => $activeType !== '' ? $activeType : null,
'activeFacets' => (object)$facetFilters,
'facets' => (object)$facets,
'results' => $results,
'suggestions' => array_values(array_unique($suggestions)),
@@ -276,6 +294,7 @@ class SearchJsonRenderer
'numFound' => 0,
'totalPages' => 0,
'filter' => null,
'activeFacets' => new stdClass(),
'facets' => new \stdClass(),
'results' => [],
'suggestions' => [],