Skip to content

Commit

Permalink
TASK: Refactor nodeTypes to separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellienert committed May 4, 2020
1 parent 2f80e3c commit 8b6a878
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 119 deletions.
48 changes: 48 additions & 0 deletions Configuration/NodeTypes.Override.Document.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
'Neos.Neos:Document':
search:
fulltext:
isRoot: true
properties:
'uriPathSegment':
search:
elasticSearchMapping:
type: keyword
title:
search:
fulltextExtractor: ${Indexing.extractInto('h1', value)}
'__fulltextParts':
search:
elasticSearchMapping:
type: object
enabled: false
indexing: ''
'__fulltext':
search:
indexing: ''
elasticSearchMapping:
type: object
properties:
'h1':
type: text
boost: 20
'h2':
type: text
boost: 12
'h3':
type: text
boost: 10
'h4':
type: text
boost: 5
'h5':
type: text
boost: 3
'h6':
type: text
boost: 2
'text':
type: text
boost: 1
'_hiddenInIndex':
search:
indexing: '${node.hiddenInIndex}'
70 changes: 70 additions & 0 deletions Configuration/NodeTypes.Override.Node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
'Neos.Neos:Node': &node
search:
fulltext:
enable: true
properties:
'__identifier':
search:
elasticSearchMapping:
type: keyword
indexing: '${node.identifier}'

'__workspace':
search:
elasticSearchMapping:
type: keyword
indexing: '${node.context.workspace.name}'

'__path':
search:
elasticSearchMapping:
type: keyword
indexing: '${node.path}'

'__parentPath':
search:
elasticSearchMapping:
type: keyword
# we index *all* parent paths as separate tokens to allow for efficient searching without a prefix query
indexing: '${Indexing.buildAllPathPrefixes(node.parentPath)}'

'__sortIndex':
search:
elasticSearchMapping:
type: integer
indexing: '${node.index}'

'_removed':
search:
elasticSearchMapping: '' # deliberately don't map or index this
indexing: ''

# we index the node type INCLUDING ALL SUPERTYPES
'__typeAndSupertypes':
search:
elasticSearchMapping:
type: keyword
indexing: '${Indexing.extractNodeTypeNamesAndSupertypes(node.nodeType)}'

'_lastModificationDateTime':
search:
elasticSearchMapping:
type: date
format: 'date_time_no_millis'
indexing: '${(node.lastModificationDateTime ? Date.format(node.lastModificationDateTime, "Y-m-d\TH:i:sP") : null)}'

'_lastPublicationDateTime':
search:
elasticSearchMapping:
type: date
format: 'date_time_no_millis'
indexing: '${(node.lastPublicationDateTime ? Date.format(node.lastPublicationDateTime, "Y-m-d\TH:i:sP") : null)}'

'_creationDateTime':
search:
elasticSearchMapping:
type: date
format: 'date_time_no_millis'
indexing: '${(node.creationDateTime ? Date.format(node.creationDateTime, "Y-m-d\TH:i:sP") : null)}'

'unstructured': *node
119 changes: 0 additions & 119 deletions Configuration/NodeTypes.yaml
Original file line number Diff line number Diff line change
@@ -1,74 +1,3 @@
'Neos.Neos:Node': &node
search:
fulltext:
enable: true
properties:
'__identifier':
search:
elasticSearchMapping:
type: keyword
indexing: '${node.identifier}'

'__workspace':
search:
elasticSearchMapping:
type: keyword
indexing: '${node.context.workspace.name}'

'__path':
search:
elasticSearchMapping:
type: keyword
indexing: '${node.path}'

'__parentPath':
search:
elasticSearchMapping:
type: keyword
# we index *all* parent paths as separate tokens to allow for efficient searching without a prefix query
indexing: '${Indexing.buildAllPathPrefixes(node.parentPath)}'

'__sortIndex':
search:
elasticSearchMapping:
type: integer
indexing: '${node.index}'

'_removed':
search:
elasticSearchMapping: '' # deliberately don't map or index this
indexing: ''

# we index the node type INCLUDING ALL SUPERTYPES
'__typeAndSupertypes':
search:
elasticSearchMapping:
type: keyword
indexing: '${Indexing.extractNodeTypeNamesAndSupertypes(node.nodeType)}'

'_lastModificationDateTime':
search:
elasticSearchMapping:
type: date
format: 'date_time_no_millis'
indexing: '${(node.lastModificationDateTime ? Date.format(node.lastModificationDateTime, "Y-m-d\TH:i:sP") : null)}'

'_lastPublicationDateTime':
search:
elasticSearchMapping:
type: date
format: 'date_time_no_millis'
indexing: '${(node.lastPublicationDateTime ? Date.format(node.lastPublicationDateTime, "Y-m-d\TH:i:sP") : null)}'

'_creationDateTime':
search:
elasticSearchMapping:
type: date
format: 'date_time_no_millis'
indexing: '${(node.creationDateTime ? Date.format(node.creationDateTime, "Y-m-d\TH:i:sP") : null)}'

'unstructured': *node

'Neos.Neos:Hidable':
properties:
'_hidden':
Expand All @@ -92,54 +21,6 @@
indexing: '${(node.hiddenAfterDateTime ? Date.format(node.hiddenAfterDateTime, "Y-m-d\TH:i:sP") : null)}'


'Neos.Neos:Document':
search:
fulltext:
isRoot: true
properties:
'uriPathSegment':
search:
elasticSearchMapping:
type: keyword
title:
search:
fulltextExtractor: ${Indexing.extractInto('h1', value)}
'__fulltextParts':
search:
elasticSearchMapping:
type: object
enabled: false
indexing: ''
'__fulltext':
search:
indexing: ''
elasticSearchMapping:
type: object
properties:
'h1':
type: text
boost: 20
'h2':
type: text
boost: 12
'h3':
type: text
boost: 10
'h4':
type: text
boost: 5
'h5':
type: text
boost: 3
'h6':
type: text
boost: 2
'text':
type: text
boost: 1
'_hiddenInIndex':
search:
indexing: '${node.hiddenInIndex}'

'Neos.NodeTypes.BaseMixins:TextMixin':
properties:
Expand Down

0 comments on commit 8b6a878

Please sign in to comment.