Escape colons in Lunr search query filters
Signed-off-by: Jesse Bye <jbye@riskalyze.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-search-backend-node': patch
|
||||
---
|
||||
|
||||
Escape : characters in the query
|
||||
@@ -57,6 +57,9 @@ export class LunrSearchEngine implements SearchEngine {
|
||||
.map(([field, value]) => {
|
||||
// Require that the given field has the given value (with +).
|
||||
if (['string', 'number', 'boolean'].includes(typeof value)) {
|
||||
if (typeof value === 'string') {
|
||||
return ` +${field}:${value.replace(':', '\\:')}`;
|
||||
}
|
||||
return ` +${field}:${value}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user