Get an instance of "IndexField". Unknown field works as "text, searchable" field, if it works without domain.
function(fieldName) {
    var field;
    if (this.domain && fieldName) {
      field = this.domain.getIndexField(fieldName);
      if (!field.exists()) {
        this.throwValidationError(
          'CS-UnknownFieldInMatchExpression',
          'Field \'' + fieldName + '\' is not defined in the metadata for this ' +
            'collection. All fields used in the match expression must be ' +
            'defined in the metadata.'
        );
      } else if (!field.searchEnabled) {
        this.available = false;
      }
    }
    if (!field)
      field = new IndexField(fieldName).setType("text");
    return field;
  }