Skip to content

Commit

Permalink
custom mappings, facettes for creator names, full text search with bo…
Browse files Browse the repository at this point in the history
…osting of phrases
  • Loading branch information
thomas-sc committed Nov 19, 2024
1 parent 7c5181e commit 73c2f6b
Showing 1 changed file with 45 additions and 2 deletions.
47 changes: 45 additions & 2 deletions Classes/Command/IndexCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,58 @@ protected function fullSync(InputInterface $input): void
$index = $this->extConf['elasticIndexName'];

// create a field "fulltext" and copy content of "tx_lisztcommon_searchable" to fulltext
// ToDo: stemming german in Fulltext?
// ToDo: "mappings": {"dynamic": false, // Prevents automatic mapping of all fields to then make individual fields searchable with "properties": {"first_name": { "type": "text"...
// ToDo: outsorce mapping to BibEntryMapping?
// ToDo: stemming field fulltext german in Fulltext?
$mappingParams = [
'index' => $index,
'body' => [
'mappings' => [
'dynamic' => false,
'properties' => [
'version' => [ 'type' => 'long' ],
'title' => [ 'type' => 'text'],
'university' => [ 'type' => 'text'],
'bookTitle' => [ 'type' => 'text'],
'series' => [ 'type' => 'text', 'fields' => [ 'keyword' => [ 'type' => 'keyword', 'ignore_above' => 256 ] ] ],
'publicationTitle' => [ 'type' => 'text', 'fields' => [ 'keyword' => [ 'type' => 'keyword', 'ignore_above' => 256 ] ] ],
'place' => [ 'type' => 'text', 'fields' => [ 'keyword' => [ 'type' => 'keyword', 'ignore_above' => 256 ] ] ],
'date' => [ 'type' => 'text', 'fields' => [ 'keyword' => [ 'type' => 'keyword', 'ignore_above' => 256 ] ] ],
'archiveLocation' => [ 'type' => 'text', 'fields' => [ 'keyword' => [ 'type' => 'keyword', 'ignore_above' => 256 ] ] ],
'itemType' => [ 'type' => 'keyword'],
'journalTitle' => [ 'type' => 'keyword'],
'creators' => [
'type' => 'nested',
'properties' => [
'creatorType' => [
'type' => 'keyword'
],
'firstName' => [
'type' => 'text',
'fields' => [
'keyword' => [
'type' => 'keyword', 'ignore_above' => 256
],
],
'copy_to' => 'creators.fullName'
],
'lastName' => [
'type' => 'text',
'fields' => [
'keyword' => [
'type' => 'keyword', 'ignore_above' => 256
]
],
'copy_to' => 'creators.fullName'
],
'fullName' => ['type' => 'text', 'fields' => [ 'keyword' => [ 'type' => 'keyword'] ] ],
]
],
'fulltext' => [ 'type' => 'text' ],
'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'],
]
]
]
Expand Down

0 comments on commit 73c2f6b

Please sign in to comment.