@@ -33,27 +33,6 @@ To specify a custom index name, the following is needed:
3333 Search:
3434 elasticSearch:
3535 indexName: acmecom
36-
37- Flowpack:
38- ElasticSearch:
39- indexes:
40- default: # client name used to connect (see Flowpack.ElasticSearch.clients)
41- acmecom: # custom index name
42- analysis:
43- filter:
44- autocompleteFilter:
45- max_shingle_size: 5
46- min_shingle_size: 2
47- type: 'shingle'
48- analyzer:
49- autocomplete:
50- filter: [ 'lowercase', 'autocompleteFilter' ]
51- char_filter: [ 'html_strip' ]
52- type: 'custom'
53- tokenizer: 'standard'
54-
55- The latter is the custom analysis configuration used by the completion / suggestion and must be
56- repeated for a custom index name.
5736
5837### Pagination
5938
@@ -80,9 +59,50 @@ Feel free to use the `DocumentSearchResult.html` in the Flowpack.SearchPlugin as
8059## Search completions and suggestions
8160
8261The default search form template comes with a ` data-autocomplete-source ` attribute pointing to the
83- ` SuggestController ` of this package. Fed with a ` term ` parameter via a ` GET ` request, it returns a
84- JSON-encoded array of suggestions from Elasticsearch. These are fetched with a term suggester from
85- the ` _all ` field, i.e. "the fulltext index".
62+ ` SuggestController ` of this package.
63+
64+ To use this term suggester, you need to configure the indexing like this, to define a custom
65+ analyzer to be used:
66+
67+ Flowpack:
68+ ElasticSearch:
69+ indexes:
70+ default: # client name used to connect (see Flowpack.ElasticSearch.clients)
71+ acmecom: # your (custom) index name
72+ analysis:
73+ filter:
74+ autocompleteFilter:
75+ max_shingle_size: 5
76+ min_shingle_size: 2
77+ type: 'shingle'
78+ analyzer:
79+ autocomplete:
80+ filter: [ 'lowercase', 'autocompleteFilter' ]
81+ char_filter: [ 'html_strip' ]
82+ type: 'custom'
83+ tokenizer: 'standard'
84+
85+ Then you need to configure the node types to be be included in the suggestion building, this can be
86+ done like this:
87+
88+ 'Neos.Neos:Document':
89+ superTypes:
90+ 'Flowpack.SearchPlugin:SuggestableMixin': true
91+ 'Flowpack.SearchPlugin:AutocompletableMixin': true
92+
93+ 'Neos.Neos:Shortcut':
94+ superTypes:
95+ 'Flowpack.SearchPlugin:SuggestableMixin': false
96+ 'Flowpack.SearchPlugin:AutocompletableMixin': false
97+
98+ 'Neos.NodeTypes:TitleMixin':
99+ superTypes:
100+ 'Flowpack.SearchPlugin:SuggestableMixin': true
101+ 'Flowpack.SearchPlugin:AutocompletableMixin': true
102+
103+ When fed with a ` term ` parameter via a ` GET ` request, the ` SuggestController ` will return a
104+ JSON-encoded array of suggestions from Elasticsearch. They are fetched with a term suggester
105+ from the ` _all ` field, i.e. "the fulltext index".
86106
87107These can be used to provide autocompletion on the search input using a JS library of your choice.
88108In case you need to build the URI to the suggest controller yourself, this is what the form uses:
0 commit comments