@@ -21,6 +21,18 @@ Inclusion of the routes from this package into your main `Configuration/Routes.y
2121
2222## Configuration
2323
24+ ### Custom index name
25+
26+ It is usually a good idea to specify a custom index name for a project, instead of the default ` typo3cr ` . That
27+ way no conflicts can arise when multiple projects use the same Elasticsearch server.
28+
29+ To specify a custom index name, the following is needed:
30+
31+ Neos:
32+ ContentRepository:
33+ Search:
34+ elasticSearch:
35+ indexName: acmecom
2436
2537### Pagination
2638
@@ -47,9 +59,50 @@ Feel free to use the `DocumentSearchResult.html` in the Flowpack.SearchPlugin as
4759## Search completions and suggestions
4860
4961The default search form template comes with a ` data-autocomplete-source ` attribute pointing to the
50- ` SuggestController ` of this package. Fed with a ` term ` parameter via a ` GET ` request, it returns a
51- JSON-encoded array of suggestions from Elasticsearch. These are fetched with a term suggester from
52- 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".
53106
54107These can be used to provide autocompletion on the search input using a JS library of your choice.
55108In case you need to build the URI to the suggest controller yourself, this is what the form uses:
0 commit comments