update pg search sanitize list (#31083)
Signed-off-by: Vladimir Kobzev <vkobzev@bol.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-search-backend-module-pg': patch
|
||||
---
|
||||
|
||||
Added the < character to the query filter regexp
|
||||
@@ -133,7 +133,7 @@ describe('PgSearchEngine', () => {
|
||||
it('should sanitize query term', async () => {
|
||||
const actualTranslatedQuery = searchEngine.translator(
|
||||
{
|
||||
term: 'H&e|l!l*o W\0o(r)l:d',
|
||||
term: 'H&e|l!l*o < W\0o(r)l:d',
|
||||
pageCursor: '',
|
||||
},
|
||||
{ highlightOptions },
|
||||
|
||||
@@ -196,7 +196,7 @@ export class PgSearchEngine implements SearchEngine {
|
||||
pgQuery: {
|
||||
pgTerm: query.term
|
||||
.split(/\s/)
|
||||
.map(p => p.replace(/[\0()|&:*!]/g, '').trim())
|
||||
.map(p => p.replace(/[\0()|&:*!<]/g, '').trim())
|
||||
.filter(p => p !== '')
|
||||
.map(p => `(${JSON.stringify(p)} | ${JSON.stringify(p)}:*)`)
|
||||
.join('&'),
|
||||
|
||||
Reference in New Issue
Block a user