Skip to content

Commit 2dd788f

Browse files
committed
TASK: Document SearchTermHelper
1 parent aa86f1c commit 2dd788f

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,11 @@ be used to request search results via AJAX and display the result by adding it t
124124

125125
## Removing special chars from search term
126126

127-
You might need to remove special chars to prevent search errors. Some chars are reserved in Elasticsearch
128-
and you can replace them before submitting the search like this:
127+
It is recommended to remove characters, which are reserved in Elasticsearch from the search term to prevent errors. There is
128+
an eel helper to replace them before submitting the search like this:
129129

130130
prototype(Flowpack.SearchPlugin:Search) {
131-
searchTerm = ${request.arguments.search}
132-
searchTerm.@process.removeSpecialChars = ${String.pregReplace(value, "/[^a-zA-Z0-9äöüÄÖÜß]/", "")}
131+
searchTerm = Flowpack.SearchPlugin.SearchTerm.sanitize(${request.arguments.search})
133132
}
134133

135134
Keep in mind, that this blocks the explicit use of wildcards (`*`) and phrase search (`"search exactly this"`)

0 commit comments

Comments
 (0)