From b36764c23c70b3af0f396b24034d39c744166ce4 Mon Sep 17 00:00:00 2001 From: thomas-sc Date: Mon, 6 Jan 2025 17:08:23 +0100 Subject: [PATCH] debug mapping and indexing (index only 3 docs) --- Classes/Processing/BibElasticMapping.php | 21 ++++++++++++++------- Configuration/TypoScript/setup.typoscript | 15 ++------------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/Classes/Processing/BibElasticMapping.php b/Classes/Processing/BibElasticMapping.php index 99e124c..4c74328 100644 --- a/Classes/Processing/BibElasticMapping.php +++ b/Classes/Processing/BibElasticMapping.php @@ -53,15 +53,22 @@ public static function getMappingParams(string $index): array ] ], 'fulltext' => [ 'type' => 'text' ], - BibEntryProcessor::HEADER_FIELD => [ 'type' => 'text' ], - BibEntryProcessor::BODY_FIELD => [ 'type' => 'text' ], - BibEntryProcessor::FOOTER_FIELD => [ 'type' => 'text' ], - BibEntryProcessor::SEARCHABLE_FIELD => ['type' => 'text', 'copy_to' => 'fulltext'], - BibEntryProcessor::BOOSTED_FIELD => ['type' => 'text'], - BibEntryProcessor::CREATORS_FIELD => [ + 'tx_lisztcommon_header' => [ 'type' => 'text' ], + 'tx_lisztcommon_body' => [ 'type' => 'text' ], + 'tx_lisztcommon_footer' => [ 'type' => 'text' ], + 'tx_lisztcommon_searchable' => ['type' => 'text', 'copy_to' => 'fulltext'], + 'tx_lisztcommon_boosted' => ['type' => 'text'], + 'tx_lisztcommon_creators' => [ 'type' => 'nested', 'properties' => [ - 'fullName' => ['type' => 'text'], + 'fullName' => [ + 'type' => 'text', + 'fields' => [ + 'keyword' => [ + 'type' => 'keyword', 'ignore_above' => 256 + ], + ], + ], ] ], ] diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript index e79a435..ed06157 100644 --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -41,20 +41,9 @@ plugin.tx_lisztcommon_searchlisting { type = keyword } 1 { - field = creators + field = tx_lisztcommon_creators type = nested - script ( - String firstName = doc['creators.firstName.keyword'].size() > 0 ? doc['creators.firstName.keyword'].value : ''; - String lastName = doc['creators.lastName.keyword'].size() > 0 ? doc['creators.lastName.keyword'].value : ''; - String type = doc['creators.creatorType'].size() > 0 ? doc['creators.creatorType'].value : ''; - if (type == 'translator') { - return null; - } - if (firstName == '' && lastName == '') { - return null; - } - return (firstName + ' ' + lastName).trim(); - ) + key = fullName } 2 { field = date