Skip to content

Commit ff4f5b6

Browse files
committed
TASK: Adjust suggestions and completions to ESCRA v7
1 parent c917e94 commit ff4f5b6

3 files changed

Lines changed: 7 additions & 12 deletions

File tree

Classes/Controller/SuggestController.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ protected function buildRequestForTerm(string $term, string $contextNodeIdentifi
127127
$query = $this->elasticSearchQueryBuilder
128128
->query($contextNode)
129129
->queryFilter('prefix', [
130-
'__completion' => $termPlaceholder
130+
'neos_completion' => $termPlaceholder
131131
])
132132
->limit(0)
133133
->aggregation('autocomplete', [
134134
'terms' => [
135-
'field' => '__completion',
135+
'field' => 'neos_completion',
136136
'order' => [
137137
'_count' => 'desc'
138138
],
@@ -143,13 +143,12 @@ protected function buildRequestForTerm(string $term, string $contextNodeIdentifi
143143
->suggestions('suggestions', [
144144
'prefix' => $termPlaceholder,
145145
'completion' => [
146-
'field' => '__suggestions',
146+
'field' => 'neos_suggestion',
147147
'fuzzy' => true,
148148
'size' => $this->searchAsYouTypeSettings['suggestions']['size'] ?? 10,
149149
'contexts' => [
150-
'parentPath' => $contextNode->getPath(),
150+
'parent_path' => $contextNode->getPath(),
151151
'workspace' => 'live',
152-
'dimensionCombinationHash' => md5(json_encode($contextNode->getContext()->getDimensions())),
153152
]
154153
]
155154
]);

Configuration/NodeTypes.Mixin.Autocompletable.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'Flowpack.SearchPlugin:AutocompletableMixin':
22
abstract: true
33
properties:
4-
'__completion':
4+
'neos_completion':
55
search:
66
elasticSearchMapping:
77
type: text
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'Flowpack.SearchPlugin:SuggestableMixin':
22
abstract: true
33
properties:
4-
'__suggestions':
4+
'neos_suggestion':
55
search:
66
elasticSearchMapping:
77
type: completion
@@ -11,11 +11,7 @@
1111
type: category
1212
path: 'neos_workspace'
1313
-
14-
name: 'parentPath'
14+
name: 'parent_path'
1515
type: category
1616
path: 'neos_parent_path '
17-
-
18-
name: 'dimensionCombinationHash'
19-
type: category
20-
path: '__dimensionCombinationHash'
2117
indexing: "${Flowpack.SearchPlugin.Suggestion.build(q(node).property('title') ? q(node).property('title') : '', 20)}"

0 commit comments

Comments
 (0)