Describe the bug
In Global Search, users are unable to see search results when searching for names containing . (dot), for example: Deal 10.1.
The issue originates from the _formatAndSanitize method in query.builder.ts, which is used by search.provider.ts.
Current implementation:
_formatAndSanitize(param) {
return param
.replace(/[^A-Za-z\s0-9]/g, ' ')
.split(' ')
.filter(p => p)
.map(p => ${p}:*)
.join('<->');
}
The current logic replaces all non-alphanumeric characters (including .) with spaces before generating the PostgreSQL full-text search query.
Example:
'Deal 10.1'
=> 'Deal 10 1'
=> ['Deal', '10', '1']
=> 'Deal:<->10:<->1:*'
Because of this transformation, 10.1 gets split into 10 and 1, causing search mismatches for values containing dots.
To Reproduce
Steps to reproduce the behavior:
- Go to Global Search
- Search for an entity containing . in its name (e.g. Deal 10.1)
- Observe that no matching results are returned
Expected behavior
Search should correctly handle values containing . and return matching results without breaking terms like 10.1 into separate tokens.
Additional context
Need to update the sanitization logic in _formatAndSanitize so that meaningful characters like . are preserved during search query generation.
Describe the bug
In Global Search, users are unable to see search results when searching for names containing . (dot), for example: Deal 10.1.
The issue originates from the _formatAndSanitize method in query.builder.ts, which is used by search.provider.ts.
Current implementation:
_formatAndSanitize(param) {
return param
.replace(/[^A-Za-z\s0-9]/g, ' ')
.split(' ')
.filter(p => p)
.map(p =>
${p}:*).join('<->');
}
The current logic replaces all non-alphanumeric characters (including .) with spaces before generating the PostgreSQL full-text search query.
Example:
'Deal 10.1'
=> 'Deal 10 1'
=> ['Deal', '10', '1']
=> 'Deal:<->10:<->1:*'
Because of this transformation, 10.1 gets split into 10 and 1, causing search mismatches for values containing dots.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Search should correctly handle values containing . and return matching results without breaking terms like 10.1 into separate tokens.
Additional context
Need to update the sanitization logic in _formatAndSanitize so that meaningful characters like . are preserved during search query generation.