We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33bdb8a commit 12612e0Copy full SHA for 12612e0
src/routes/projects/list.js
@@ -62,7 +62,18 @@ const SUPPORTED_FILTERS = [
62
63
const escapeEsKeyword = keyword => keyword.replace(/[+-=><!|(){}[&\]^"~*?:\\/]/g, '\\\\$&');
64
65
+/**
66
+ * ES need to skip special chars else it is considered as RegEx
67
+ *
68
+ * @param {String} query query being searched for
69
+ * @return {String} result after parsing
70
+ */
71
+function escapeElasticsearchQuery(query) {
72
+ return query.replace(/(\+|\-|\=|&&|\|\||\>|\<|\!|\(|\)|\{|\}|\[|\]|\^|"|~|\*|\?|\:|\\|\/)/g, '\\$&');
73
+}
74
+
75
const buildEsFullTextQuery = (keyword, matchType, singleFieldName) => {
76
+ keyword = escapeElasticsearchQuery(keyword);
77
let should = [
78
{
79
query_string: {
0 commit comments