gramene-search 1.2.22 → 1.2.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- 12943691
2
- 1648570246527237000
1
+ 61378806
2
+ 1649954728209027000
Binary file
Binary file
package/dist/index.js CHANGED
@@ -503,7 +503,7 @@ function $b8aee296158e1013$var$_interopRequireDefault(obj) {
503
503
  "default": obj
504
504
  };
505
505
  }
506
- var $b8aee296158e1013$var$MAX_IDLIST_LENGTH = 10;
506
+ var $b8aee296158e1013$var$MAX_IDLIST_LENGTH = 20;
507
507
  function $b8aee296158e1013$var$findNodeWithLeftIdx(node, idx) {
508
508
  if (node.leftIdx === idx) return node;
509
509
  var result = null;
@@ -1033,6 +1033,7 @@ var $b8aee296158e1013$var$grameneFilters = {
1033
1033
  selectGrameneFiltersQueryString: function selectGrameneFiltersQueryString(state) {
1034
1034
  var hasSpaces = new RegExp(/^[^\[\(].*\s/);
1035
1035
  var isQuery = new RegExp(/\([a-zA-Z0-9_]+:[a-zA-Z0-9_]+\s/);
1036
+ var idWithColon = new RegExp(/^[a-zA-Z0-9_]+:[a-zA-Z0-9_]+$/);
1036
1037
  function getQuery(node) {
1037
1038
  var negate = node.negate ? 'NOT ' : '';
1038
1039
  if (node.hasOwnProperty('children')) // do some recursion
@@ -1041,8 +1042,9 @@ var $b8aee296158e1013$var$grameneFilters = {
1041
1042
  }).sort().join(" ".concat(node.operation, " ")), ")");
1042
1043
  else {
1043
1044
  // this node is a suggestion
1044
- if (isQuery.test(node.fq_value)) return "".concat(negate).concat(node.fq_value);
1045
+ if (isQuery.test(node.fq_value)) return "".concat(negate).concat(node.fq_value.replace(/:/g, '\\:'));
1045
1046
  if (hasSpaces.test(node.fq_value)) return "".concat(negate).concat(node.fq_field, ":\"").concat(node.fq_value, "\"");
1047
+ else if (idWithColon.test(node.fq_value)) return "".concat(negate).concat(node.fq_field, ":").concat(node.fq_value.replace(/:/g, '\\:'));
1046
1048
  else return "".concat(negate).concat(node.fq_field, ":").concat(node.fq_value);
1047
1049
  }
1048
1050
  }