Skip to content

Commit

Permalink
debug mapping and indexing (index only 3 docs)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-sc committed Jan 6, 2025
1 parent 2d07dc4 commit b36764c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
21 changes: 14 additions & 7 deletions Classes/Processing/BibElasticMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
],
],
],
]
],
]
Expand Down
15 changes: 2 additions & 13 deletions Configuration/TypoScript/setup.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b36764c

Please sign in to comment.