Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class Substring extends Operator<string> {
// TODO IMPROVEMENT 27.4.2020 - we could use regular expressions to search for substrings which would solve the unintuitive
// behavior that occurs when we search for strings that contain spaces. We need to escape the input string in a special way
// if we choose to do this
const escapedValue = Operator.escapeInput(args[0]).value.replace(' ', '\\ ');
const escapedValue = Operator.escapeInput(args[0]).value.replace(/ /g, '\\ ');
return Operator.forEachKeyword(elasticKeywords, keyword => new Query(`(${keyword}:*${escapedValue}*)`));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class SearchService implements OnDestroy {
* @param searchedSubstring value that should be searched on all full text fields
*/
public setFullTextFilter(searchedSubstring: string): void {
const whiteSpacedSubstring = searchedSubstring.replace(' ', '\\ ');
const whiteSpacedSubstring = searchedSubstring.replace(/ /g, '\\ ');
this._fullTextFilter = new SimpleFilter('', this._baseFilter.type, {fullText: whiteSpacedSubstring});
this.updateActiveFilter();
}
Expand Down