buildExpression = function (field, value, op) {
  // for values required to be strings in the search expression
  /* eslint-disable no-useless-escape */
  const needQuotes = (value !== 'EXISTS!' && !(value.startsWith('[') && value.endsWith(']')) &&
    /[^-+a-zA-Z0-9_.@:*?/,]+/.test(value)) ||
    (value.startsWith('/') && value.endsWith('/'));

  // escape unescaped quotes
  value = value.toString().replace(/\\([\s\S])|(")/g, '\\$1$2');
  if (needQuotes) { value = `"${value}"`; }

  return `${field} ${op} ${value}`;
}
Builds an expression for search.
Stringifies necessary values and escapes necessary characters

@example
'{{ 'ip.dst' | buildExpression('10.0.0.1', '==') }}'
this.$options.filters.buildExpression('ip.dst', '10.0.0.1', '==');

@param {string} field  The field name
@param {string} value  The field value
@param {string} op     The relational operator
@returns {string}      The fully built expression