-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEATURE: Add basic code for Autocomplete and Suggestions
- Loading branch information
1 parent
ad1bcd8
commit d844cba
Showing
10 changed files
with
121 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace PunktDe\Neos\AdvancedSearch; | ||
|
||
interface NodeTypeDefinitionInterface | ||
{ | ||
public const MIXIN_HIDDEN_FROM_INTERNAL_SEARCH = 'PunktDe.Neos.AdvancedSearch:Mixin.HiddenFromInternalSearch'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
PunktDe: | ||
Search: | ||
AlternativeSearchWords: | ||
Neos: | ||
AdvancedSearch: | ||
stopWordFolders: | ||
languageFolder: '%FLOW_PATH_PACKAGES%/Application/PunktDe.Search.AlternativeSearchWords/Resources/Private/StopWords' | ||
languageFolder: '%FLOW_PATH_PACKAGES%/Application/PunktDe.Neos.AdvancedSearch/Resources/Private/StopWords' | ||
# All files within this folder are loaded | ||
customerSpecificFolder: '' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'Neos.Neos:Document': | ||
superTypes: | ||
'Flowpack.SearchPlugin:AutocompletableMixin': true | ||
'Flowpack.SearchPlugin:SuggestableMixin': true | ||
|
||
properties: | ||
neos_fulltext_parts: | ||
search: | ||
elasticSearchMapping: | ||
type: flattened | ||
ignore_above: 1000 | ||
enabled: ~ | ||
|
||
esDocumentFacet: | ||
search: | ||
elasticSearchMapping: | ||
type: keyword | ||
indexing: "${'page'}" | ||
|
||
esAlternativeSearchword: | ||
search: | ||
elasticSearchMapping: | ||
type: keyword | ||
indexing: "${PunktDe.Neos.AdvancedSearch.stopWordFilteredTokenize(q(node).property('title') + ' ' + q(node).property('metaKeywords') + ' ' + q(node).property('metaDescription'), node)}" |
10 changes: 10 additions & 0 deletions
10
NodeTypes/Override/NodeTypes.Override.Mixin.Autocompletable.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
'Flowpack.SearchPlugin:AutocompletableMixin': | ||
abstract: true | ||
properties: | ||
'neos_completion': | ||
search: | ||
elasticSearchMapping: | ||
type: text | ||
analyzer: autocomplete | ||
fielddata: true | ||
indexing: "${PunktDe.Neos.AdvancedSearch.Indexing.indexCompletionIfSearchable(node, ['title', 'metaDescription'])}" |
11 changes: 11 additions & 0 deletions
11
NodeTypes/Override/NodeTypes.Override.Mixin.Suggestable.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'Flowpack.SearchPlugin:SuggestableMixin': | ||
abstract: true | ||
properties: | ||
'neos_suggestion': | ||
search: | ||
indexing: "${PunktDe.Neos.AdvancedSearch.Indexing.indexSuggestionIfSearchable(node, ['title','metaKeywords','metaDescription'], 20)}" | ||
|
||
esSuggestionSnippet: | ||
search: | ||
type: text | ||
indexing: "${Neos.Node.isOfType(node, 'PunktDe.Neos.AdvancedSearch:Mixin.HiddenFromInternalSearch') || node.hidden == true ? '' : FusionRendering.render(node, 'suggestion')}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters