Skip to content

Commit b360766

Browse files
authored
TASK: Tweak hint a bit more…
1 parent 00d5fd8 commit b360766

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,15 @@ It expects the search term as a parameter named `q` (as defined in `AjaxSearch.f
106106
renders the search results and returns them as HTML without any of the page template. It can therefore
107107
be 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.

0 commit comments

Comments
 (0)