File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,11 +106,15 @@ It expects the search term as a parameter named `q` (as defined in `AjaxSearch.f
106106renders the search results and returns them as HTML without any of the page template. It can therefore
107107be used to request search results via AJAX and display the result by adding it to the DOM as needed.
108108
109- ## Remove special chars from search term
109+ ## Removing special chars from search term
110110
111- You might not need special chars to prevent search result erros. Some chars are reserved and you can replace them before rendering the search results.
111+ You might need to remove special chars to prevent search errors. Some chars are reserved in Elasticsearch
112+ and you can replace them before submitting the search like this:
112113
113114 prototype(Flowpack.SearchPlugin:Search) {
114115 searchTerm = ${request.arguments.search}
115116 searchTerm.@process.removeSpecialChars = ${String.pregReplace(value, "/[^a-zA-Z0-9äöüÄÖÜß]/", "")}
116117 }
118+
119+ Keep in mind, that this blocks the explicit use of wildcards (` * ` ) and phrase search (` "search exactly this" ` )
120+ for your users, in case you want to support that.
You can’t perform that action at this time.
0 commit comments